- Freetype Update to 2.1.10. Reduces memory usage, increases speed and fixes drawing...
authorAlex Ionescu <aionescu@gmail.com>
Thu, 21 Jul 2005 04:38:26 +0000 (04:38 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Thu, 21 Jul 2005 04:38:26 +0000 (04:38 +0000)
 - Enable Bytecode. Weird_W's fonts finally look humanly readable.

Thanks to Waxdragon for testing.

<http://www.freetype.org>

LATEST CHANGES BETWEEN 2.1.10 and 2.1.9

  I. IMPORTANT BUG FIXES

    - The size comparison for BDF and PCF files could fail sometimes.

    - Some  CFF files  were still not  loaded  correctly.   Patch from
      Derek Noonburg.

    - The stroker still had some serious bugs.

    - Boris  Letocha  fixed a  bug in  the  TrueType interpreter:  The
      NPUSHW instruction wasn't skipped correctly in IF clauses.  Some
      fonts like `Helvetica 75 Bold' failed.

    - Another  serious  bug  in  handling  TrueType hints  caused many
      distortions.  It has been introduced in version 2.1.8, and it is
      highly recommended to upgrade.

    - FreeType didn't properly parse empty Type 1 glyphs.

    - An unbound dynamic buffer growth was fixed in the PFR loader.

    - Several bugs have been fixed in the cache sub-system.

    - FreeType behaved incorrectly when resizing two distinct but very
      close character pixel sizes through `FT_Set_Char_Size' (Savannah
      bug #12263).

    - The auto-hinter didn't work properly for fonts without a Unicode
      charmap -- it even refused to load the glyphs.

  II. IMPORTANT CHANGES

    - Many fixes have been applied to drastically reduce the amount of
      heap   memory   used   by   FreeType,   especially   when  using
      memory-mapped font files  (which is the default on Unix  systems
      which support them).

    - The auto-hinter  has been replaced with a new module, called the
      `auto-fitter'.  It consumes  less memory  than its  predecessor,
      and it is  prepared to support non-latin scripts  better in next
      releases.

    - George Williams  contributed code to read  kerning data from PFM
      files.

    - FreeType   now   uses    the   TT_NAME_ID_PREFERRED_FAMILY   and
      TT_NAME_ID_PREFERRED_SUBFAMILY   strings   (if   available)  for
      setting  family  and  style in SFNT  fonts  (patch from Kornfeld
      Eliyahu Peter).

    - A  new  API `FT_Sfnt_Table_Info'  (in FT_TRUETYPE_TABLES_H)  has
      been added to retrieve name and size information of SFNT tables.

    - A new API `FT_OpenType_Validate' (in FT_OPENTYPE_VALIDATE_H) has
      been added to validate OpenType tables  (BASE, GDEF, GPOS, GSUB,
      JSTF).   After validation  it is  no longer  necessary to  check
      for errors in those tables while accessing them.

      Note that  this module might  be moved to another library in the
      future  to avoid  a tight  dependency between  FreeType and  the
      OpenType specification.

    - A new API in FT_BITMAP_H  (`FT_Bitmap_New', `FT_Bitmap_Convert',
      `FT_Bitmap_Copy',  `FT_Bitmap_Embolden',  `FT_Bitmap_Done')  has
      been added.   Its  use is  to convert an  FT_Bitmap structure in
      1bpp, 2bpp,  4bpp, or 8bpp  format into  another 8bpp FT_Bitmap,
      probably using a different pitch, and to further manipulate it.

    - A new  API `FT_Outline_Embolden'  (in FT_OUTLINE_H) gives  finer
      control how  outlines are embolded.

    - `FT_GlyphSlot_Embolden' (in FT_SYNTHESIS_H)  now handles bitmaps
      also (code contributed  by Chia I Wu).  Note that this  function
      is still experimental and may be replaced with a better API.

    - The method  how BDF and PCF  bitmap fonts  are accessed has been
      refined.   Formerly,   FT_Set_Pixel_Sizes  and  FT_Set_Char_Size
      were  synonyms in  FreeType's  BDF and PCF interface.  This  has
      changed now.  FT_Set_Pixel_Sizes  should be  used to  select the
      actual  font dimensions  (the `strike',  which is the sum of the
      `FONT_ASCENT'    and    `FONT_DESCENT'    properties),     while
      FT_Set_Char_Size  selects  the  `nominal' size  (the `PIXELSIZE'
      property).  In both functions, the width parameter is ignored.

  III. MISCELLANEOUS

    - The BDF driver  no longer converts  all returned bitmaps  with a
      depth of 2bpp or 4bpp to a depth of 8bpp.  The documentation has
      not  mentioned  this  explicitly,  but  implementors  might have
      relied on this after looking into the source files.

    - A new option `--ftversion' has been  added to freetype-config to
      return the FreeType version.

    - The  memory  debugger  has  been  updated   to  dump  allocation
      statistics on  all allocation  sources in the library.   This is
      useful to  spot greedy  allocations when  loading and processing
      fonts.

    - We removed a huge array of constant pointers to constant strings
      in the `psnames' module.   The problem was that  compilations in
      PIC mode (i.e.,  when generating a  Unix shared object/dll)  put
      the array  into the non-shared  writable section of  the library
      since absolute pointers are not relocatable by nature.

      This reduces the memory consumption by approximately 16KByte per
      process linked  to FreeType.   We now also store  the array in a
      compressed form (as a trie) which saves about 20KByte of code as
      well.

    - Kirill  Smelkov provided  patches to make  src/raster/ftraster.c
      compile stand-alone again.

svn path=/trunk/; revision=16675

278 files changed:
reactos/lib/freetype/ChangeLog
reactos/lib/freetype/Jamfile
reactos/lib/freetype/Jamrules
reactos/lib/freetype/Makefile.freetype
reactos/lib/freetype/README
reactos/lib/freetype/README.CVS [new file with mode: 0644]
reactos/lib/freetype/autogen.sh [new file with mode: 0644]
reactos/lib/freetype/builds/amiga/README
reactos/lib/freetype/builds/amiga/include/freetype/config/ftconfig.h
reactos/lib/freetype/builds/amiga/include/freetype/config/ftmodule.h
reactos/lib/freetype/builds/amiga/makefile [new file with mode: 0644]
reactos/lib/freetype/builds/amiga/makefile.os4 [new file with mode: 0644]
reactos/lib/freetype/builds/amiga/smakefile
reactos/lib/freetype/builds/amiga/src/base/ftdebug.c
reactos/lib/freetype/builds/amiga/src/base/ftsystem.c
reactos/lib/freetype/builds/atari/ATARI.H
reactos/lib/freetype/builds/atari/FNames.SIC
reactos/lib/freetype/builds/atari/FREETYPE.PRJ
reactos/lib/freetype/builds/atari/README.TXT
reactos/lib/freetype/builds/compiler/gcc-dev.mk
reactos/lib/freetype/builds/compiler/gcc.mk
reactos/lib/freetype/builds/dos/detect.mk
reactos/lib/freetype/builds/dos/dos-wat.mk
reactos/lib/freetype/builds/freetype.mk
reactos/lib/freetype/builds/unix/aclocal.m4
reactos/lib/freetype/builds/unix/config.guess
reactos/lib/freetype/builds/unix/config.sub
reactos/lib/freetype/builds/unix/configure
reactos/lib/freetype/builds/unix/configure.ac
reactos/lib/freetype/builds/unix/freetype-config.in
reactos/lib/freetype/builds/unix/freetype2.m4
reactos/lib/freetype/builds/unix/ft-munmap.m4
reactos/lib/freetype/builds/unix/ftsystem.c
reactos/lib/freetype/builds/unix/install-sh
reactos/lib/freetype/builds/unix/install.mk
reactos/lib/freetype/builds/unix/ltmain.sh
reactos/lib/freetype/builds/unix/mkinstalldirs
reactos/lib/freetype/builds/win32/detect.mk
reactos/lib/freetype/builds/win32/visualc/freetype.dsp
reactos/lib/freetype/builds/win32/visualc/freetype.vcproj
reactos/lib/freetype/builds/win32/visualc/index.html
reactos/lib/freetype/configure
reactos/lib/freetype/devel/ftoption.h
reactos/lib/freetype/docs/CHANGES
reactos/lib/freetype/docs/CUSTOMIZE
reactos/lib/freetype/docs/DEBUG
reactos/lib/freetype/docs/FTL.txt
reactos/lib/freetype/docs/GPL.txt
reactos/lib/freetype/docs/INSTALL
reactos/lib/freetype/docs/INSTALL.ANY
reactos/lib/freetype/docs/INSTALL.GNU
reactos/lib/freetype/docs/INSTALL.UNX
reactos/lib/freetype/docs/INSTALL.VMS
reactos/lib/freetype/docs/PATENTS
reactos/lib/freetype/docs/TODO
reactos/lib/freetype/docs/TRUETYPE
reactos/lib/freetype/docs/UPGRADE.UNX
reactos/lib/freetype/docs/VERSION.DLL
reactos/lib/freetype/docs/formats.txt
reactos/lib/freetype/docs/license.txt
reactos/lib/freetype/docs/modules.txt
reactos/lib/freetype/docs/raster.txt
reactos/lib/freetype/docs/release
reactos/lib/freetype/freetype.def
reactos/lib/freetype/freetype.xml
reactos/lib/freetype/include/freetype/cache/ftccache.h
reactos/lib/freetype/include/freetype/cache/ftcglyph.h
reactos/lib/freetype/include/freetype/cache/ftcmru.h
reactos/lib/freetype/include/freetype/config/ftconfig.h
reactos/lib/freetype/include/freetype/config/ftheader.h
reactos/lib/freetype/include/freetype/config/ftmodule.h
reactos/lib/freetype/include/freetype/config/ftoption.h
reactos/lib/freetype/include/freetype/config/ftstdlib.h
reactos/lib/freetype/include/freetype/freetype.h
reactos/lib/freetype/include/freetype/ftbdf.h
reactos/lib/freetype/include/freetype/ftbitmap.h [new file with mode: 0644]
reactos/lib/freetype/include/freetype/ftcache.h
reactos/lib/freetype/include/freetype/ftchapters.h
reactos/lib/freetype/include/freetype/fterrors.h
reactos/lib/freetype/include/freetype/ftgzip.h
reactos/lib/freetype/include/freetype/ftimage.h
reactos/lib/freetype/include/freetype/ftlzw.h
reactos/lib/freetype/include/freetype/ftmac.h
reactos/lib/freetype/include/freetype/ftmoderr.h
reactos/lib/freetype/include/freetype/ftotval.h [new file with mode: 0644]
reactos/lib/freetype/include/freetype/ftoutln.h
reactos/lib/freetype/include/freetype/ftpfr.h
reactos/lib/freetype/include/freetype/ftrender.h
reactos/lib/freetype/include/freetype/ftsizes.h
reactos/lib/freetype/include/freetype/ftstroke.h
reactos/lib/freetype/include/freetype/fttypes.h
reactos/lib/freetype/include/freetype/ftwinfnt.h
reactos/lib/freetype/include/freetype/internal/ftcalc.h
reactos/lib/freetype/include/freetype/internal/ftmemory.h
reactos/lib/freetype/include/freetype/internal/ftobjs.h
reactos/lib/freetype/include/freetype/internal/ftserv.h
reactos/lib/freetype/include/freetype/internal/ftstream.h
reactos/lib/freetype/include/freetype/internal/fttrace.h
reactos/lib/freetype/include/freetype/internal/ftvalid.h [new file with mode: 0644]
reactos/lib/freetype/include/freetype/internal/internal.h
reactos/lib/freetype/include/freetype/internal/services/svotval.h [new file with mode: 0644]
reactos/lib/freetype/include/freetype/internal/services/svpsinfo.h
reactos/lib/freetype/include/freetype/internal/services/svsfnt.h
reactos/lib/freetype/include/freetype/internal/sfnt.h
reactos/lib/freetype/include/freetype/internal/tttypes.h
reactos/lib/freetype/include/freetype/t1tables.h
reactos/lib/freetype/include/freetype/ttnameid.h
reactos/lib/freetype/include/freetype/tttables.h
reactos/lib/freetype/include/freetype/tttags.h
reactos/lib/freetype/src/Jamfile
reactos/lib/freetype/src/autofit/Jamfile
reactos/lib/freetype/src/autofit/afangles.c
reactos/lib/freetype/src/autofit/afangles.h [new file with mode: 0644]
reactos/lib/freetype/src/autofit/afdummy.c
reactos/lib/freetype/src/autofit/afdummy.h
reactos/lib/freetype/src/autofit/aferrors.h [moved from reactos/lib/freetype/src/autohint/aherrors.h with 77% similarity]
reactos/lib/freetype/src/autofit/afglobal.c
reactos/lib/freetype/src/autofit/afglobal.h
reactos/lib/freetype/src/autofit/afhints.c
reactos/lib/freetype/src/autofit/afhints.h
reactos/lib/freetype/src/autofit/aflatin.c
reactos/lib/freetype/src/autofit/aflatin.h
reactos/lib/freetype/src/autofit/afloader.c
reactos/lib/freetype/src/autofit/afloader.h
reactos/lib/freetype/src/autofit/afmodule.c
reactos/lib/freetype/src/autofit/afmodule.h
reactos/lib/freetype/src/autofit/aftypes.h
reactos/lib/freetype/src/autofit/autofit.c
reactos/lib/freetype/src/autofit/module.mk [new file with mode: 0644]
reactos/lib/freetype/src/autofit/rules.mk [new file with mode: 0644]
reactos/lib/freetype/src/autohint/CatharonLicense.txt [deleted file]
reactos/lib/freetype/src/autohint/Jamfile [deleted file]
reactos/lib/freetype/src/autohint/ahangles.c [deleted file]
reactos/lib/freetype/src/autohint/ahangles.h [deleted file]
reactos/lib/freetype/src/autohint/ahglobal.c [deleted file]
reactos/lib/freetype/src/autohint/ahglobal.h [deleted file]
reactos/lib/freetype/src/autohint/ahglyph.c [deleted file]
reactos/lib/freetype/src/autohint/ahglyph.h [deleted file]
reactos/lib/freetype/src/autohint/ahhint.c [deleted file]
reactos/lib/freetype/src/autohint/ahhint.h [deleted file]
reactos/lib/freetype/src/autohint/ahloader.h [deleted file]
reactos/lib/freetype/src/autohint/ahmodule.c [deleted file]
reactos/lib/freetype/src/autohint/ahtypes.h [deleted file]
reactos/lib/freetype/src/autohint/autohint.c [deleted file]
reactos/lib/freetype/src/autohint/mather.py [deleted file]
reactos/lib/freetype/src/autohint/module.mk [deleted file]
reactos/lib/freetype/src/autohint/rules.mk [deleted file]
reactos/lib/freetype/src/base/Jamfile
reactos/lib/freetype/src/base/ftbdf.c
reactos/lib/freetype/src/base/ftbitmap.c [new file with mode: 0644]
reactos/lib/freetype/src/base/ftcalc.c
reactos/lib/freetype/src/base/ftdbgmem.c
reactos/lib/freetype/src/base/ftdebug.c
reactos/lib/freetype/src/base/ftglyph.c
reactos/lib/freetype/src/base/ftinit.c
reactos/lib/freetype/src/base/ftmac.c
reactos/lib/freetype/src/base/ftobjs.c
reactos/lib/freetype/src/base/ftotval.c [new file with mode: 0644]
reactos/lib/freetype/src/base/ftoutln.c
reactos/lib/freetype/src/base/ftpfr.c
reactos/lib/freetype/src/base/ftrfork.c
reactos/lib/freetype/src/base/ftstream.c
reactos/lib/freetype/src/base/ftstroke.c
reactos/lib/freetype/src/base/ftsynth.c
reactos/lib/freetype/src/base/fttrigon.c
reactos/lib/freetype/src/base/fttype1.c
reactos/lib/freetype/src/base/ftutil.c
reactos/lib/freetype/src/base/ftwinfnt.c
reactos/lib/freetype/src/base/ftxf86.c
reactos/lib/freetype/src/base/rules.mk
reactos/lib/freetype/src/bdf/Jamfile
reactos/lib/freetype/src/bdf/bdfdrivr.c
reactos/lib/freetype/src/bdf/bdflib.c
reactos/lib/freetype/src/cache/Jamfile
reactos/lib/freetype/src/cache/ftcbasic.c
reactos/lib/freetype/src/cache/ftccache.c
reactos/lib/freetype/src/cache/ftccmap.c
reactos/lib/freetype/src/cache/ftcglyph.c
reactos/lib/freetype/src/cache/ftcmanag.c
reactos/lib/freetype/src/cache/ftcsbits.c
reactos/lib/freetype/src/cff/Jamfile
reactos/lib/freetype/src/cff/cffcmap.c
reactos/lib/freetype/src/cff/cffdrivr.c
reactos/lib/freetype/src/cff/cffgload.c
reactos/lib/freetype/src/cff/cffload.c
reactos/lib/freetype/src/cff/cffobjs.c
reactos/lib/freetype/src/cff/cffparse.c
reactos/lib/freetype/src/cff/cfftoken.h
reactos/lib/freetype/src/cid/Jamfile
reactos/lib/freetype/src/cid/cidload.c
reactos/lib/freetype/src/cid/cidobjs.c
reactos/lib/freetype/src/cid/cidparse.c
reactos/lib/freetype/src/cid/cidriver.c
reactos/lib/freetype/src/gzip/Jamfile
reactos/lib/freetype/src/gzip/ftgzip.c
reactos/lib/freetype/src/lzw/Jamfile
reactos/lib/freetype/src/lzw/ftlzw.c
reactos/lib/freetype/src/lzw/zopen.c
reactos/lib/freetype/src/otvalid/Jamfile [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/module.mk [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvalid.c [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvalid.h [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvbase.c [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvcommn.c [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvcommn.h [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otverror.h [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvgdef.c [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvgpos.c [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvgpos.h [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvgsub.c [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvjstf.c [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvmod.c [new file with mode: 0644]
reactos/lib/freetype/src/otvalid/otvmod.h [moved from reactos/lib/freetype/src/autohint/ahmodule.h with 50% similarity]
reactos/lib/freetype/src/otvalid/rules.mk [new file with mode: 0644]
reactos/lib/freetype/src/pcf/Jamfile
reactos/lib/freetype/src/pcf/pcfdrivr.c
reactos/lib/freetype/src/pcf/pcfread.c
reactos/lib/freetype/src/pcf/pcfutil.c
reactos/lib/freetype/src/pfr/Jamfile
reactos/lib/freetype/src/pfr/pfrgload.c
reactos/lib/freetype/src/pfr/pfrload.c
reactos/lib/freetype/src/pfr/pfrobjs.c
reactos/lib/freetype/src/pfr/pfrtypes.h
reactos/lib/freetype/src/psaux/Jamfile
reactos/lib/freetype/src/psaux/psobjs.c
reactos/lib/freetype/src/psaux/t1decode.c
reactos/lib/freetype/src/pshinter/Jamfile
reactos/lib/freetype/src/pshinter/pshalgo.c
reactos/lib/freetype/src/psnames/Jamfile
reactos/lib/freetype/src/psnames/psmodule.c
reactos/lib/freetype/src/psnames/pstables.h
reactos/lib/freetype/src/raster/Jamfile
reactos/lib/freetype/src/raster/ftmisc.h [new file with mode: 0644]
reactos/lib/freetype/src/raster/ftraster.c
reactos/lib/freetype/src/raster/ftrend1.c
reactos/lib/freetype/src/sfnt/Jamfile
reactos/lib/freetype/src/sfnt/rules.mk
reactos/lib/freetype/src/sfnt/sfdriver.c
reactos/lib/freetype/src/sfnt/sferrors.h
reactos/lib/freetype/src/sfnt/sfnt.c
reactos/lib/freetype/src/sfnt/sfobjs.c
reactos/lib/freetype/src/sfnt/ttcmap.c [new file with mode: 0644]
reactos/lib/freetype/src/sfnt/ttcmap.h [new file with mode: 0644]
reactos/lib/freetype/src/sfnt/ttkern.c [new file with mode: 0644]
reactos/lib/freetype/src/sfnt/ttkern.h [new file with mode: 0644]
reactos/lib/freetype/src/sfnt/ttload.c
reactos/lib/freetype/src/sfnt/ttload.h
reactos/lib/freetype/src/sfnt/ttsbit.c
reactos/lib/freetype/src/sfnt/ttsbit.h
reactos/lib/freetype/src/sfnt/ttsbit0.c [new file with mode: 0644]
reactos/lib/freetype/src/sfnt/ttsbit0.h [new file with mode: 0644]
reactos/lib/freetype/src/smooth/Jamfile
reactos/lib/freetype/src/smooth/ftgrays.c
reactos/lib/freetype/src/smooth/ftsmooth.c
reactos/lib/freetype/src/tools/docmaker/sources.py
reactos/lib/freetype/src/tools/glnames.py
reactos/lib/freetype/src/truetype/Jamfile
reactos/lib/freetype/src/truetype/ttdriver.c
reactos/lib/freetype/src/truetype/ttgload.c
reactos/lib/freetype/src/truetype/ttgload.h
reactos/lib/freetype/src/truetype/ttgxvar.c
reactos/lib/freetype/src/truetype/ttinterp.c
reactos/lib/freetype/src/truetype/ttinterp.h
reactos/lib/freetype/src/truetype/ttobjs.c
reactos/lib/freetype/src/truetype/ttpload.c
reactos/lib/freetype/src/truetype/ttpload.h
reactos/lib/freetype/src/type1/Jamfile
reactos/lib/freetype/src/type1/t1afm.c
reactos/lib/freetype/src/type1/t1afm.h
reactos/lib/freetype/src/type1/t1driver.c
reactos/lib/freetype/src/type1/t1load.c
reactos/lib/freetype/src/type1/t1objs.c
reactos/lib/freetype/src/type1/t1parse.c
reactos/lib/freetype/src/type42/Jamfile
reactos/lib/freetype/src/type42/t42drivr.c
reactos/lib/freetype/src/type42/t42objs.c
reactos/lib/freetype/src/type42/t42parse.c
reactos/lib/freetype/src/winfonts/Jamfile

index df83950..015faa9 100644 (file)
+2005-06-08  Werner Lemberg  <wl@gnu.org>
+
+
+       * Version 2.1.10 released.
+       ==========================
+
+
+       * src/pcf/readme: Renamed to...
+       * src/pcf/README: This.
+
+2005-06-07  Detlef Würkner  <TetiSoft@apg.lahn.de>
+
+       * builds/amiga/*: Added copyright notes, reworked some comments.
+
+2005-06-05  Werner Lemberg  <wl@gnu.org>
+
+       * Add copyright notices to all files which don't have one.
+
+       * docs/license.txt: Renamed to...
+       * docs/LICENSE.TXT: This.
+       * docs/FTL.txt: Renamed to...
+       * docs/FTL.TXT: This.
+       * docs/GPL.txt: Renamed to...
+       * docs/GPL.TXT: This.
+
+       * docs/PATENTS: Slightly reworded.  Suggested by Sylvain Beucler
+       <beuc@gnu.org>.
+
+2005-06-04  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/ftimage.h (FT_Outline_MoveToFunc,
+       FT_Outline_LineToFunc, FT_Outline_ConicToFunc,
+       FT_Outline_CubicToFunc, FT_Raster_RenderFunc),
+       include/freetype/ftrender.h (FT_Glyph_TransformFunc,
+       FT_Renderer_RenderFunc, FT_Renderer_TransformFunc): Don't use
+       `const' to stay compatible with FreeType 2.1.9.
+
+2005-06-01  Adam D. Moss  <adam@gimp.org>
+
+       * src/base/ftstroke.c (ft_stroker_inside): Revert `sigma' patch from
+       2004-07-11; this gives much better results under normal
+       circumstances.
+
+2005-05-30  Chia I Wu  <b90201047@ntu.edu.tw>
+
+       * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Minor
+       documentation improvements.
+
+       * include/freetype/ftoutln.h (FT_Outline_Embolden): Fix typos.
+
+       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Add support for bitmap
+       of pixel_mode FT_PIXEL_MODE_GRAY2 or FT_PIXEL_MODE_GRAY4.
+       If xstr is larger than 8 and bitmap is of pixel_mode
+       FT_PIXEL_MODE_MONO, set xstr to 8 instead of returning error.
+
+2005-05-29  Chia I Wu  <b90201047@ntu.edu.tw>
+
+       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Fix emboldening bitmap
+       of mode FT_PIXEL_MODE_GRAY.  Also add support for mode
+       FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V.
+       (ft_bitmap_assure_buffer): FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V
+       should have ppb (pixel per byte) 1.
+       Zero the padding when there's no need to allocate memory.
+
+       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle slot->advance
+       too.
+       More suited emboldening strength.
+
+2005-05-28  Chia I Wu  <b90201047@ntu.edu.tw>
+
+       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Handle negative pitch.
+       Handle FT_PIXEL_MODE_GRAY with num_gray != 256.
+       Improve speed for FT_PIXEL_MODE_GRAY.
+       (ft_bitmap_assure_buffer): Accept FT_PIXEL_MODE_LCD and
+       FT_PIXEL_MODE_LCD_V.
+
+2005-05-27  Chia I Wu  <b90201047@ntu.edu.tw>
+
+       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Initialize `error'.
+
+       * src/base/ftobjs.c (ft_cmap_done_internal): New function.
+       (FT_CMap_Done): Remove cmap from cmap list.
+       (destroy_charmaps, FT_CMap_New): Don't call FT_CMap_Done but
+       ft_cmap_done_internal.
+
+2005-05-26  Werner Lemberg  <wl@gnu.org>
+
+       * docs/GPL.txt: Update postal address of FSF.
+
+2005-05-26  Chia I Wu  <b90201047@ntu.edu.tw>
+
+       * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Improve
+       documentation.
+
+       * src/base/ftsynth.c (FT_BOLD_THRESHOLD): Removed.
+       (FT_GlyphSlot_Embolden): Check whether slot is bitmap owner.
+       Always modify the metrics.
+
+2005-05-24  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2005-05-24  Chia I Wu  <b90201047@ntu.edu.tw>
+
+       * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): New declaration.
+
+       * include/freetype/ftoutln.h (FT_Outline_Embolden): New declaration.
+
+       * src/base/ftbitmap.c (ft_bitmap_assure_buffer): New auxiliary
+       function.
+       (FT_Bitmap_Embolden): New function.
+
+       * src/base/ftoutln.c (FT_Outline_Embolden): New function.
+
+       * src/base/ftsynth.c: Don't include FT_INTERNAL_CALC_H and
+       FT_TRIGONOMETRY_H but FT_BITMAP_H.
+       (FT_GlyphSlot_Embolden): Use FT_Outline_Embolden or
+       FT_Bitmap_Embolden.
+
+2005-05-24  Werner Lemberg  <wl@gnu.org>
+
+       * configure: Always remove config.mk, builds/unix/unix-def.mk, and
+       builds/unix/unix-cc.mk.  This fixes repeated calls of the script.
+       Reported by Nelson Beebe and Behdad Esfahbod.
+
+       * README.CVS: Mention file permissions.
+
+2005-05-23  Werner Lemberg  <wl@gnu.org>
+
+       * builds/amiga/makefile.os4 (WARNINGS), builds/compiler/gcc-dev.mk
+       (CFLAGS), builds/compiler/gcc.mk (CFLAGS): Remove
+       -fno-strict-aliasing.
+
+       * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttsbit0.c --
+       it is currently loaded from ttsbit.c.
+
+2005-05-23  Behdad Esfahbod  <behdad@cs.toronto.edu>
+
+       Say you have `(Foo*)x' and want to assign, pass, or return it as
+       `(Bar*)'.  If you simply say `x' or `(Bar*)x', then the C compiler
+       would warn you that type casting incompatible pointer types breaks
+       strict-aliasing.  The solution is to cast to `(void*)' instead which
+       is the generic pointer type, so the compiler knows that it should
+       make no strict-aliasing assumption on `x'.  But the problem with
+       `(void*)x' is that seems like in C++, unlike C, `void*' is not a
+       generic pointer type and assigning `void*' to `Bar*' without a cast
+       causes an error.  The solution is to cast to `Bar*' too, with
+       `(Bar*)(void*)x' as the result -- this is what the patch does.
+
+       * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP),
+       include/freetype/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): Remove
+       cast on lvalue, use a temporary pointer instead.
+       Cast temporarily to (void*) to not break strict aliasing.
+
+       * include/freetype/internal/ftmemory.h (FT_MEM_ALLOC,
+       FT_MEM_REALLOC, FT_MEM_QALLOC, FT_MEM_QREALLOC, FT_MEM_FREE),
+       src/base/ftglyph.c (FT_Glyph_To_Bitmap): Cast temporarily to (void*)
+       to not break strict aliasing.
+
+       * src/base/ftinit.c (FT_USE_MODULE): Fix wrong type information.
+
+       * builds/unix/configure.ac (XX_CFLAGS): Remove -fno-strict-aliasing.
+
+2005-05-23  David Turner  <dturner@freetype.org>
+
+       Fix Savannah bug #12213 (incorrect behaviour of the cache sub-system
+       in low-memory conditions).
+
+       * include/freetype/cache/ftccache.h (FTC_CACHE_TRYLOOP,
+       FTC_CACHE_TRYLOOP_END): New macros.
+
+       * src/cache/ftccache.c (FTC_Cache_NewNode), src/cache/ftcsbits.c
+       (ftc_snode_compare): Use FT_CACHE_TRYLOOP and FTC_CACE_TRYLOOP_END.
+
+2005-05-23  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/rules.mk (BASE_SRC): Don't add ftsynth.c here but...
+       (BASE_EXT_SRC): Here.
+
+2005-05-22  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftrfork.c (raccess_guess_apple_generic): Mark
+       `version_number' and `entry_length' as unused.
+       (raccess_guess_linux_double_from_file_name): Remove `memory'.
+       (raccess_make_file_name): Mark `error' as unused.
+
+       * src/bdf/bdflib.c (_bdf_parse_properties): Remove `memory'.
+
+       * src/cid/cidobjs.c (cid_face_init): Remove `psnames'.
+
+       * src/sfnt/sfobjs.c (sfnt_load_face): Remove `memory'.
+
+       * src/truetype/ttgxvar.c (ft_var_readpackedpoints,
+       ft_var_readpackeddeltas, ft_var_load_avar): Mark `error' as unused.
+
+       * src/base/rules.mk (BASE_SRC): Add ftsynth.c.
+
+2005-05-21  David Turner  <david@freetype.org>
+
+       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Fix a bug that
+       produced unpleasant artefacts when trying to embolden very sharp
+       corners.
+
+2005-05-20  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2005-05-20  Chia I Wu  <b90201047@ntu.edu.tw>
+
+       * src/base/ftbitmap.c: Don't include FT_FREETYPE_H and FT_IMAGE_H
+       but FT_BITMAP_H.
+       (FT_Bitmap_Copy): New function (from ftglyph.c).
+
+       * include/freetype/ftbitmap.h (FT_Bitmap_Copy): New public
+       definition.
+
+       * src/base/ftglyph.c: Include FT_BITMAP_H.
+       (ft_bitmap_copy): Move to ftbitmap.c.
+       (ft_bitmap_glyph_init): Remove `memory' variable.
+       Create new bitmap object if FT_GLYPH_OWN_BITMAP isn't set.
+       (ft_bitmap_glyph_copy): Use FT_Bitmap_Copy.
+       (ft_bitmap_glyph_done): Use FT_Bitmap_Done.
+       (ft_outline_glyph_init): Use FT_Outline_Copy.
+
+       * src/base/ftoutln.c (FT_Outline_Copy): Handle source == target.
+       (FT_Outline_Done_Internal): Check for valid `memory' pointer.
+       (FT_Outline_Translate, FT_Outline_Reverse, FT_Outline_Render,
+       FT_Outline_Transform): Check for valid `outline' pointer.
+
+       * src/base/ftobjs.c (FT_New_GlyphSlot): Prepend glyph slot to
+       face->glyph, otherwise a new second glyph slot cannot be created.
+       (FT_Done_GlyphSlot): Fix memory leak.
+       (FT_Open_Face): Updated -- face->glyph is already managed by
+       FT_New_GlyphSlot.
+
+       * src/type42/t42objs.c (T42_GlyphSlot_Done): Updated.
+
+2005-05-20  Kirill Smelkov  <kirr@mns.spb.ru>
+
+       * include/freetype/ftimage.h (FT_Raster_Params),
+       include/freetype/ftoutln.h (FT_Outline_Translate,
+       FT_Outline_Transform), src/base/ftoutln.c (FT_Outline_Translate,
+       FT_Outline_Transform): Decorate parameters with `const' where
+       appropriate.
+       Update all callers.
+
+       * src/raster/ftraster.c (ft_black_reset), src/smooth/ftgrays.c
+       (gray_raster_reset): Remove `const' from `pool_base' argument.
+
+2005-05-18  Kirill Smelkov  <kirr@mns.spb.ru>
+
+       * src/raster/ftmisc.h: New file.  Only needed if ftraster.c is
+       compiled as stand-alone.
+
+       * src/raster/ftraster.c: Add comment how to compile as stand-alone.
+       s/FT_CONFIG_OPTION_STATIC_RASTER/FT_STATIC_RASTER/.
+       s/TT_STATIC_RASTER/FT_STATIC_RASTER/.
+       [_STANDALONE_]: Include ftimage.h and ftmisc.h.
+       (FT_TRACE1, FT_TRACE6, ft_memset, FT_MEM_ZERO): Define
+       conditionally.
+       (Render_Glyph, Render_Gray_Glyph): Return Raster_Err_None (or
+       Raster_Err_Unsupported).
+       (ft_black_new) [_STANDALONE_]: Fix type of `the_raster'.
+       (ft_black_init, ft_black_reset, ft_black_set_mode, ft_black_render):
+       Use `ras', not `raster'.
+       (ft_black_done): Use FT_UNUSED_RASTER.
+       (Horizontal_Sweep_Init, Horizontal_Sweep_Step,
+       Horizontal_Gray_Sweep_Span): Use FT_UNUSED_RASTER.
+
+2005-05-18  Werner Lemberg  <wl@gnu.org>
+
+       * docs/announce: Start updating.
+
+       * docs/CHANGES: Updated.
+
+2005-05-16  Vitaliy Pasternak  <v_a_pasternak@mail.ru>
+
+       * builds/win32/visualc/freetype.vcproj: Updated.
+       Exclude debug info for `Release' versions to reduce library size.
+
+2005-05-16  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftobjs.c (FT_Open_Face): Make it work as documented, this
+       is, ignore `aface' completely if face_index < 0.  Reported by David
+       Osborn <spam@habitualhiatus.com>.
+
+2005-05-16  Kirill Smelkov  <kirr@mns.spb.ru>
+
+       * include/freetype/ftimage.h (FT_Outline_MoveToFunc,
+       FT_Outline_LineTo_Func, FT_Outline_ConicToFunc,
+       FT_Outline_CubicToFunc), src/smooth/ftgrays.c (gray_render_conic,
+       gray_render_cubic, gray_move_to, gray_line_to, gray_conic_to,
+       gray_cubic_to, gray_render_span, gray_sweep): Decorate parameters
+       with `const' where appropriate.
+
+2005-05-11  Kirill Smelkov  <kirr@mns.spb.ru>
+
+       * include/freetype/ftimage.h (FT_Raster_RenderFunc),
+       include/freetype/ftrender.h (FT_Glyph_TransformFunc,
+       FT_Renderer_Render_Func, FT_Renderer_TransformFunc),
+       src/base/ftglyph.c (ft_outline_glyph_transform),
+       src/raster/ftrend1.c (ft_raster1_transform, ft_raster1_render),
+       src/smooth/ftgrays.c (FT_Outline_Decompose, gray_raster_render),
+       src/smooth/ftsmooth.c (ft_smooth_transform,
+       ft_smooth_render_generic, ft_smooth_render, ft_smooth_render_lcd,
+       ft_smooth_render_lcd_v): Decorate parameters with `const' where
+       appropriate.
+
+       * src/raster/ftraster.c (RASTER_RENDER_POOL): Removed.  Obsolete.
+       (ft_black_render): Decorate parameters with `const' where
+       appropriate.
+
+2005-05-11  Werner Lemberg  <wl@gnu.org>
+
+       * src/sfnt/ttcmap.c (tt_cmap4_set_range): Fix typo (FT_PEEK_SHORT ->
+       FT_PEEK_USHORT) which caused crashes.  Reported by Ismail Donmez
+       <ismail@kde.org.tr>.
+
+2005-05-08  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/internal/ftserv.h (FT_FACE_FIND_GLOBAL_SERVICE)
+       [__cplusplus]: Fix typo.
+
+2005-05-07  Werner Lemberg  <wl@gnu.org>
+
+       Handle unsorted SFNT type 4 cmaps correctly (reported by Dirck
+       Blaskey <listtarget@danbala.com>).
+
+       * src/sfnt/ttcmap.h (TT_CMap): Add member `unsorted'.
+       * src/sfnt/ttcmac.c: Use SFNT_Err_Ok where appropriate.
+
+       (tt_cmap0_validate, tt_cmap2_validate, tt_cmap6_validate,
+       tt_cmap8_validate, tt_cmap10_validate, tt_cmap12_validate): Use
+       `FT_Error' as return type.
+       (tt_cmap4_validate): Use `FT_Error' as return type.
+       Return error code for unsorted cmap.
+       (tt_cmap4_char_index, tt_cmap4_char_next): Use old code for unsorted
+       cmaps.
+       (tt_face_build_cmaps): Set `unsorted' variable in cmap.
+
+2005-05-07  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttpload.c (tt_face_get_location): Fix typo.
+
+2005-05-06  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cffobjs.c (cff_face_init): Set ppem value in top
+       dictionary for SFNT-based CFF.
+
+2005-05-05  Werner Lemberg  <wl@gnu.org>
+
+       Handle malformed `loca' table entries.
+
+       * docs/TODO: Add some bugs which should be fixed.
+
+       * include/freetype/internal/tttypes.h (TT_FaceRec): Add `glyf_len'
+       element.
+
+       * src/truetype/ttpload.c (tt_face_load_loca): Get length of `glyf'
+       table.
+       (tt_face_get_location): Fix computation of `asize' for malformed
+       `loca' entries.
+
+2005-05-01  David Turner  <david@freetype.org>
+
+       * Jamfile: Remove `otvalid' from the list of compiled modules.
+
+       * include/freetype/internal/ftserv.h: Add compiler pragmas to get
+       rid of annoying warnings with Visual C++ compiler in maximum warning
+       mode.
+
+       * src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftstroke.c,
+       src/bdf/bdfdrivr.c, src/cache/ftcbasic.c, src/cache/ftccmap.c,
+       src/cache/ftcmanag.c, src/cff/cffload.c, src/cid/cidload.c,
+       src/lzw/zopen.c, src/otvalid/otvgdef.c, src/pcf/pcfread.c,
+       src/sfnt/sfobjs.c, src/truetype/ttgxvar.c: Remove compiler warnings.
+
+2005-04-28  Werner Lemberg  <wl@gnu.org>
+
+       * docs/TODO: Updated.
+
+2005-04-24  Werner Lemberg  <wl@gnu.org>
+
+       * src/otvalid/otvcommn.c
+       (otv_GSUBGPOS_have_MarkAttachmentType_flag): Handle table == 0.
+
+2005-04-16  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cffobjs.c (cff_face_init): Set default upem value in top
+       font dict also.
+       Handle font matrix settings in subfonts.
+
+       * src/cff/cffgload.c (cff_slot_load): Use the correct font matrix
+       for CID-keyed fonts with subfonts.
+
+       * docs/formats.txt: Updated.
+
+2005-04-14  Kirill Smelkov  <kirr@mns.spb.ru>
+
+       * include/freetype/freetype.h (FT_Vector_Transform),
+       include/freetype/ftimage.h (FT_Raster_Params),
+       include/freetype/ftoutln.h, src/base/ftoutln.c (FT_Outline_Get_CBox,
+       FT_Outline_Copy, FT_Outline_Transform, FT_Vector_Transform,
+       FT_Outline_Get_Bitmap), src/raster/ftraster.c (ft_black_render),
+       src/smooth/ftgrays.c (gray_raster_render): Decorate parameters with
+       `const' where appropriate.
+
+2005-04-14  Werner Lemberg  <wl@gnu.org>
+
+       * src/type1/t1load.c (parse_charstrings): Catch this non-standard
+       beginning of the /CharStrings dictionary:
+
+         /CharStrings 118 dict def
+         Private begin
+         CharStrings begin
+
+       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Fix arguments
+       to call of tt_sbit_decoder_load_bitmap.
+
+2005-04-13  Werner Lemberg  <wl@gnu.org>
+
+       * docs/TODO: Updated.
+
+       * autogen.sh: Use `--force' for all commands.
+
+2005-04-09  Werner Lemberg  <wl@gnu.org>
+
+       * src/pshinter/pshalgo.c (ps_hints_apply): Change scaling values
+       only if `fitted' is not zero.
+
+2005-04-06  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttgload.c (tt_face_get_metrics) [FT_OPTIMIZE_MEMORY]:
+       Fix typo which sometimes causes wrong metrics for the last glyph.
+
+2005-04-04  David Turner  <david@freetype.org>
+
+       * devel/ftoption.h, include/freetype/config/ftoption.h
+       (FT_OPTIMIZE_MEMORY): Comment out this macro for the upcoming 2.1.10
+       release.
+       (*_CHESTER_*): Removed.  No longer used.
+
+       * src/autofit/afhints.c (af_axis_hints_new_segment,
+       af_axis_hints_new_edge): Small tweak to use less heap memory.
+
+2005-04-03  Werner Lemberg  <wl@gnu.org>
+
+       * src/type1/t1parse.c (T1_New_Parser): Relax the check for a valid
+       first line in the font.
+
+2005-04-03  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES, include/freetype/freetype.h: Improve documentation
+       of FT_Set_Pixel_Sizes and FT_Set_Char_Size.
+
+2005-03-26  Detlef Würkner  <TetiSoft@apg.lahn.de>
+
+       * builds/amiga/src/base/ftsystem.c (ft_amiga_stream_io): Fix buffer
+       offsets after a large read.
+
+2005-03-26  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/afglobal.c (af_face_globals_get_metrics):
+       s/index/gidx/.
+
+       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Fix compiler
+       warnings.
+
+       * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttsbit0.c.
+
+       * src/sfnt/ttsbit0.h: Dummy file for build with `make'.
+
+2005-03-26  Detlef Würkner  <TetiSoft@apg.lahn.de>
+
+       Update of the Amiga port.
+
+       * builds/amiga/makefile, builds/amiga/makefile.os4,
+       builds/amiga/smakefile: Included the base extension files
+       (ftbitmap.c, ftotval.c, ftpfr.c, ftstroke.c, ftxf86.c).
+
+2005-03-25  Detlef Würkner  <TetiSoft@apg.lahn.de>
+
+       Update of the Amiga port.
+
+       * builds/amiga/makefile, builds/amiga/smakefile: Handle new modules.
+
+       * builds/amiga/makefile.os4: Makefile for AmigaOS4 SDK.
+
+       * builds/amiga/README: Updated.
+
+       * builds/amiga/include/freetype/config/ftconfig.h: Handle gcc for
+       AmigaOS4.
+
+       * builds/amiga/include/freetype/config/ftmodule.h: Handle new
+       modules.
+
+       * builds/amiga/src/base/ftdebug.c: Updated to current version of
+       default ftdebug.c.
+       Add various include files and macros to have proper support for
+       both AmigaOS4 and older AmigaOS versions.
+       Don't declare KVPrintF explicitly.
+       Replace getenv with GetVar.
+       Actually enable debugging code.
+
+       * builds/amiga/src/base/ftsystem.c: Major rewrite.
+
+2005-03-23  Werner Lemberg  <wl@gnu.org>
+
+       * tests/*: Removed.
+
+2005-03-23  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES, docs/INSTALL.ANY: Updated.
+
+       * include/freetype/ftmoderr.h: Replace `Autohint' with `Autofit'.
+       Add `OTvalid'.
+
+       * src/autofit/aferrors.h: New file.
+
+       * src/autofit/afglobal.c, src/autofit/afhints.c,
+       src/autofit/aflatin.c, src/autofit/afloader.c: s/FT_Err_/AF_Err_/.
+       Include aferrors.h.
+
+       * src/autofit/rules.mk (AUTOF_DRV_H): Include aferrors.h.
+
+       * src/otvalid/otverror.h: s/FT_Mod_Err_OTV/FT_Mod_Err_OTvalid/.
+
+2005-03-22  David Turner  <david@freetype.org>
+
+       * src/autohint/*: Removed.
+       * Jamfile: Updated.
+
+2005-03-15  David Turner  <david@freetype.org>
+
+       * src/bdf/bdflib.c: Remove compiler warnings.
+       (hash_rehash, hash_init): Don't call FT_MEM_ZERO.
+       (_bdf_list_t): Add `memory' field.
+       (_bdf_list_init, _bdf_list_done, _bdf_list_ensure): New functions.
+       (_bdf_shift, _bdf_join): Rename to...
+       (_bdf_list_shift, _bdf_list_join): This.
+       (_bdf_split): Renamed to...
+       (_bdf_list_split): This.  Use new functions.
+       (bdf_internal_readstream): Removed.
+       (NO_SKIP): New macro.
+       (_bdf_readstream): Rewritten.
+       (bdf_create_property, _bdf_add_comment): Improve allocation.
+       (_bdf_set_default_spacing, _bdf_parse_glyphs): Updated.  Improve
+       allocation.
+       (_bdf_parse_properties, _bdf_parse_start): Updated.
+       (bdf_load_font): Updated to use new functions.
+
+       * src/type1/t1parse.c (check_type1_format): New function.
+       (T1_New_Parser): Use it to check font header before allocating
+       anything on the heap.
+
+       * src/type42/t42parse.c (t42_parser_init): Modify functions to check
+       the font header before allocating anything on the heap.
+
+       * include/freetype/internal/ftmemory.h (FT_ARRAY_MAX,
+       FT_ARRAY_CHECK): New macros.
+
+       * src/base/ftstream.c (FT_Stream_TryRead): New function.
+       * include/freetype/internal/ftstream.h: Updated.
+
+       * src/pcf/pcfread.c (pcf_read_TOC), src/pcf/pcfutil.c
+       (BitOrderInvert, TwoByteSwap, FourByteSwap): Minor fixes and
+       simplifications.  Try to protect the PCF driver from doing stupid
+       things with broken fonts.
+
+       * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Check the LZW header before
+       doing anything else.  This avoids unnecessary heap allocations
+       (400KByte of heap memory for the LZW decoder).
+
+       * src/gzip/ftgzip.c (FT_Stream_OpenGZip): Ditto for the gzip
+       decoder, although the code savings are smaller.
+
+       * docs/CHANGES: Updated.
+
+2005-03-10  David Turner  <david@freetype.org>
+
+       * src/tools/glnames.py: Add comment to explain the compression
+       being used for the Adobe Glyph List.
+
+2005-03-10  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttpload.c (tt_face_load_cvt, tt_face_load_fpgm):
+       Fix serious typo which prevented correct TT rendering.
+
+       * include/freetype/internal/ftmemory.h: Undo change from 2005-03-03.
+       To suppress warnings it is sufficient to use `-fno-strict-aliasing'.
+
+2005-03-10  Werner Lemberg  <wl@gnu.org>
+
+       * src/tools/glnames.py: Formatted.
+       Format output to be in sync with other FreeType code.
+       Import `re' and `os.path'.
+       (StringTable) <__init__>: Add parameter to initialize master table
+       name.
+       (StringTable) <dump>: Don't pass master table name.
+       (StringTable) <dump_sublist>: Emit explanatory comment.
+       Simplify and make output more human readable.
+       (t1_bias, glyph_list, adobe_glyph_names): Removed.  Unused.
+       (main): Use `basename' for file name in header.
+
+       * src/psnames/pstables.h: Regenerated.
+
+2005-03-09  David Turner  <david@freetype.org>
+
+       * src/tools/glnames.py: Rewrite the generator for the `pstables.h'
+       header file which contains various constant tables related to glyph
+       names.  It now uses a different, more compact storage scheme that
+       saves about 20KB.  This also closes Savannah bug #12262.
+
+       * src/psnames/pstables.h: Regenerated.
+
+       * src/psnames/psmodule.c (ps_unicode_value): Use
+       `ft_get_adobe_glyph_index', a new function defined in `pstables.h'.
+       (ps_get_macintosh_name, ps_get_standard_strings): Updated.
+
+       * src/base/ftobjs.c (FT_Set_Char_Sizes): Handle fractional sizes
+       more carefully.  This fixes Savannah bug #12263.
+
+2005-03-06  David Turner  <david@freetype.org>
+
+       * src/otvalid/otvgsub.c, src/otvalid/otvgpos.c: Make static tables
+       constant.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init): Fix Savannah bug
+       #12212 (auto-hinter refuses to work if no Unicode charmap in font).
+
+2005-03-05  Werner Lemberg  <wl@gnu.org>
+
+       * autogen.sh: New script for bootstrapping.
+
+       * README.CVS: New file which documents bootstrapping.
+
+       * builds/unix/aclocal.m4, builds/unix/config.guess,
+       builds/unix/config.sub, builds/unix/configure,
+       builds/unix/ltmain.sh: Removed.
+
+2005-03-04  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftutil.c: Include FT_INTERNAL_OBJECTS_H.
+
+2005-03-03  Werner Lemberg  <wl@gnu.org>
+
+       Various fixes for C and C++ compiling.
+
+       * src/autofit/*: Add copyright messages.
+
+       * src/autofit/afhints.c (af_glyph_hints_done): Don't use
+       `AF_Dimension' but `int' for loop counter.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Don't use
+       `AF_Dimension' but `int' for loop counter.
+       Use proper enumeration value for `render_mode'.
+       (af_latin_metrics_scale_dim): Don't shadow variables.
+       (af_latin_hints_compute_segments): Use proper cast for `major_dir'
+       and `segment_dir'.
+       (af_latin_align_linked_edge, af_latin_hint_edges): Fix arguments of call to
+       `af_latin_compute_stem_width'.
+       (af_latin_hints_apply): Don't use `AF_Dimension' but `int' for loop
+       counter.
+
+       * src/base/ftdbgmem.c (ft_mem_table_get_source, FT_DumpMemory): Use
+       proper cast for memory allocation.
+
+       * src/cff/cffdrivr.c (cff_get_kerning): Use proper cast for
+       initialization of `sfnt'.
+
+       * src/sfnt/sfdriver.c: Include `ttkern.h'.
+
+       * src/sfnt/ttkern.c (tt_face_get_kerning): Don't shadow variables.
+
+       * src/truetype/ttgload.c: Include `ttpload.h'.
+
+2005-03-03  David Turner  <david@freetype.org>
+
+       * include/freetype/internal/ftmemory.h (FT_ALLOC, FT_REALLOC,
+       FT_QALLOC, FT_QREALLOC) [gcc >= 3.3]: Provide macro versions which
+       avoid compiler warnings.
+       (FT_NEW, FT_NEW_ARRAY, FT_RENEW_ARRAY, FT_QNEW, FT_QNEW_ARRAY,
+       FT_QRENEW_ARRAY, FT_ALLOC_ARRAY, FT_REALLOC_ARRAY): Updated.
+
+       * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
+       FT_FACE_FIND_GLOBAL_SERVICE, FT_FACE_LOOKUP_SERVICE) [__cpluscplus]:
+       Provide macro versions which avoid compiler warnings.
+
+       * src/base/ftutil.c (ft_highpow2): New utility function.
+
+       * include/freetype/internal/ftobjs.h: Updated.
+
+       * src/pfr/pfrload.c (pfr_get_gindex, pfr_compare_kern_pairs,
+       pfr_sort_kerning_pairs): Don't define if FT_OPTIMIZE_MEMORY is set.
+       (pfr_phy_font_done): Don't handle `kern_pairs' if FT_OPTIMIZE_MEMORY
+       is set.
+       (pfr_phy_font_load): Don't call `pfr_sort_kerning_pairs' if
+       FT_OPTIMIZE_MEMORY is set.
+
+       * src/pfr/pfrobjs.c (pfr_slot_load): Comment out some code which
+       doesn't work with broken fonts.
+       (pfr_face_get_kerning) [FT_OPTIMIZE_MEMORY]: Implement.
+
+       * src/pfr/pfrtypes.h (PFR_KernItemRec): Optimize member types.
+       (PFR_NEXT_KPAIR): New macro.
+       (PFR_PhyFontRec): Don't define `kern_pairs' if FT_OPTIMIZE_MEMORY is
+       set.
+
+       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Introduce
+       temporary variable to avoid gcc warning.
+       (tt_face_load_sbit_image): Mark unused variables with FT_UNUSED.
+
+       * src/truetype/ttpload.c (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]:
+       Remove redundant variable.
+
+       * include/freetype/config/ftmodule.h: Moving the order of drivers to
+       speed up font loading.  The PCF and BDF loaders are still slow and
+       consume far too much memory.
+
+2005-03-03  Werner Lemberg  <wl@gnu.org>
+
+       * devel/ftoption.h: Updated to recent changes.
+
+2005-03-02  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/afdummy.c, src/autofit/afdummy.h
+       (af_dummy_script_class): Fix type.
+
+       * src/autofit/aflatin.c, src/autofit/aflatin.h
+       (af_latin_script_class): Fix type.
+
+       * src/autofit/rules.mk (AUTOF_DRV_SRC): Fix typo.
+
+2005-03-01  David Turner  <david@freetype.org>
+
+       * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning),
+       src/sfnt/ttsbit0.c (tt_face_load_sbit_strikes,
+       tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_compound,
+       tt_sbit_decoder_load_image), src/sfnt/ttload.c
+       (tt_face_load_metrics): Remove compiler warnings
+       -- redundant variables, missing initializations, etc.
+
+       * src/sfnt/ttsbit.h: Handle FT_OPTIMIZE_MEMORY.
+
+       * src/autofit/rules.mk, src/autofit/module.mk,
+       src/autofit/afangles.h: New files.
+
+       * src/autofit/afhints.c (af_axis_hints_new_segment,
+       af_axis_hints_new_edge): New functions.
+       (af_glyph_hints_done): Do proper deallocation.
+       (af_glyph_hints_reload): Only reallocate points array.  This
+       drastically reduces heap usage.
+
+       * src/autofit/afhints.h (AF_PointRec, AF_SegmentRec): Optimize
+       member types and positions.
+       (AF_AxisHintsRec): Add `max_segments' and `max_edges'.
+       (af_axis_hints_new_segment, af_axis_hints_new_edge): New prototypes.
+
+       * src/autofit/aflatin.c (af_latin_metricsc_scale): Don't call
+       AF_SCALER_EQUAL_SCALES.
+       (af_latin_hints_compute_segments): Change return type to FT_Error.
+       Update all callers.
+       Improve segment allocation.
+       (af_latin_hints_compute_edges): Change return type to FT_Error.
+       Update all callers.
+       Improve edge allocation and link handling.
+       (af_latin_hints_detect_features): Change return type to FT_Error.
+       Update all callers.
+
+       * src/autofit/aflatin.h: Updated.
+
+       * src/autofit/afloader.c (af_loader_load_g)
+       <FT_GLYPH_FORMAT_OUTLINE>: Assure axis->num_edges > 1.  This fixes
+       a bug with certain fonts.
+
+       * include/freetype/config/ftmodule.h: The auto-fitter is now the
+       only supported auto-hinting module.
+
+       * include/freetype/config/ftstdlib.h (FT_INT_MAX): New macro.
+
+2005-02-28  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttpload.c (tt_face_load_loca): Fix typo.
+
+       * src/sfnt/ttkern.c: Include `ttkern.h'.
+       (FT_COMPONENT): Updated.
+
+       * include/freetype/internal/fttrace.h: Add entry for `ttkern'.
+
+       * src/sfnt/ttsbit0.c: s/FT_Err_/SFNT_Err_/.
+       Decorate constants with `U' and `L' where necessary.
+
+       * src/sfnt/ttcmap.c (tt_cmap4_next): Remove unused variable.
+
+2005-02-28  David Turner  <david@freetype.org>
+
+       * src/base/ftdbgmem.c (FT_DumpMemory): Added sorting of memory
+       sources according to decreasing maximum cumulative allocations.
+       (ft_mem_source_compare): New auxiliary function.
+
+       * src/sfnt/ttsbit0.c: New file, implementing a heap-optimized
+       embedded bitmap loader.
+
+       * src/sfnt/ttsbit.c: Include `ft2build.h', FT_INTERNAL_DEBUG_H,
+       FT_INTERNAL_STREAM_H, FT_TRUETYPE_TAGS_H.
+       Load `ttsbit0.c' if FT_OPTIMIZE_MEMORY is set, otherwise use
+       file contents.
+       (tt_face_load_sbit_strikes): Set up root fields to indicate the
+       strikes.  This fixes Savannah bug #12107.
+       Use `static' keyword for `sbit_line_metrics_field',
+       `strike_start_fields', `strike_end_fields'.
+
+       * include/freetype/internal/tttypes.h (TT_FaceRec): Define
+       `sbit_table', `sbit_table_size', `sbit_num_strikes' if
+       FT_OPTIMIZE_MEMORY is set.
+       Don't define `num_sbit_strikes' and `sbit_strikes' if
+       FT_OPTIMIZE_MEMORY is set.
+
+       * src/cff/cffobjs.c (sbit_size_reset): Handle FT_OPTIMIZE_MEMORY.
+
+       * src/sfnt/sfobjs.c (sfnt_load_face): Fixed bug that prevented
+       loading SFNT fonts without a `kern' table.
+       Properly pass root->face_flags.
+       Remove code for TT_CONFIG_OPTION_EMBEDDED_BITMAPS.
+
+       * src/sfnt/sfdriver.c (sfnt_interface)
+       [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Don't use `tt_find_sbit_image'
+       and `tt_load_sbit_metrics'.
+
+       * src/sfnt/ttcmap.c: Optimize linear charmap scanning for Format 4.
+       (OPT_CMAP4): New macro.
+       (TT_CMap4Rec) [OPT_CMAP4]: New structure.
+       (tt_cmap4_init, tt_cmap4_set_range, tt_cmap4_next, tt_cmap4_reset)
+       [OPT_CMAP4]: New functions.
+       (tt_cmap4_char_next) [OPT_CMAP4]: Use `tt_cmap4_next' and
+       `tt_cmap4_reset'.
+       (tt_cmap4_class_rec) [OPT_CMAP4]: Use `TT_CMap4Rec' and
+       `tt_cmap4_init'.
+
+       * src/truetype/ttobjs.c (Reset_SBit_Size): Handle
+       FT_OPTIMIZE_MEMORY.
+
+       * src/autofit/afhints.h (AF_PointRec, AF_SegmentRec, AF_EdgeRec):
+       Optimize member types.
+
+       * src/autofit/afloader.c (af_loader_done): Call
+       `af_glyph_hints_done'.
+
+2005-02-27  David Turner  <david@freetype.org>
+
+       * src/sfnt/ttkern.c (tt_face_load_kern): Fix a small bug which
+       caused invalid (random) return values for the horizontal kerning.
+
+2005-02-25  David Turner  <david@freetype.org>
+
+       Implement several memory optimizations to drastically reduce the
+       heap usage of FreeType, especially in the case of memory-mapped
+       files.  The idea is to avoid loading and decoding tables in the
+       heap, and instead access the raw data whenever possible (i.e., when
+       it doesn't compromise performance).
+
+       This has several benefits: For example, opening vera.ttf now uses
+       just a small amount of memory (even when the FT_Library footprint is
+       accounted for), until you start loading glyphs.  Even then, you save
+       at least 20KB compared to the non-optimized case.  Performance of
+       various operations, including open and close, has also been
+       dramatically improved.
+
+       More optimizations to come, especially for the auto-hinter.
+
+       * include/freetype/internal/sfnt.h (TT_Face_GetKerningFunc): New
+       function type.
+       (SFNT_Interface): Add it.
+
+       * include/freetype/internal/tttypes.h (TT_HdmxEntryRec, TT_HdmxRec,
+       TT_Kern0_PairRec): Don't define if FT_OPTIMIZE_MEMORY is set.
+       (TT_FaceRec): Define `horz_metrics', `horz_metrics_size',
+       `vert_metrics', `vert_metrics_size', `hdmx_table',
+       `hdmx_table_size', `hdmx_record_count', `hdmx_record_size',
+       `hdmx_record_sizes', `kern_table', `kern_table_size,
+       `num_kern_tables', `kern_avail_bits', `kern_order_bits' if
+       FT_OPTIMIZE_MEMORY is set.
+       Don't define `hdmx', `num_kern_pairs', `kern_table_index',
+       `kern_pairs' if FT_OPTIMIZE_MEMORY is set.
+
+       * src/base/ftdbgmem.c (ft_mem_table_set): Don't shadow variable.
+       Fix compiler warning.
+
+       * src/cff/cffdrivr.c (Get_Kerning): Renamed to...
+       (cff_get_kerning): This.  Simplify.
+       (cff_driver_class): Updated.
+
+       * src/sfnt/Jamfile (_sources): Add `ttkern'.
+       * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttkern.c'.
+
+       * src/sfnt/sfdriver.c (sfnt_interface): Add `tt_face_get_kerning'.
+
+       * src/sfnt/sfnt.c: Include `ttkern.c'.
+
+       * src/sfnt/sfobjs.c: Include `ttkern.h'.
+       (sfnt_load_face): Consider the `kern' and `gasp' table as optional.
+       (sfnt_done_face): Call `tt_face_done_kern'.
+       Handle horizontal metrics for FT_OPTIMIZE_MEMORY.
+
+       * src/sfnt/ttkern.c, src/sfnt/ttkern.h: New files.  Code has been
+       taken from `ttload.c' and `ttload.h'.
+       Provide special versions of `tt_face_load_kern',
+       `tt_face_get_kerning', and `tt_face_done_kern' for
+       FT_OPTIMIZE_MEMORY.
+
+       * src/sfnt/ttload.c (tt_face_load_metrics, tt_face_load_hdmx,
+       tt_face_free_hdmx): Provide version for FT_OPTIMIZE_MEMORY.
+       (tt_face_load_kern, tt_kern_pair_compare, TT_KERN_INDEX): Moved to
+       `ttkern.c'.
+
+       * src/sfnt/ttload.h: Updated.
+
+       * src/sfnt/ttsbit.c (sbit_metrics_field): Add `static' keyword.
+
+       * src/truetype/ttdriver.c (Get_Kerning): Renamed to...
+       (tt_get_kerning): This.  Simplify.
+       (tt_driver_class): Updated.
+
+       * src/truetype/ttgload.c (TT_Get_Metrics): Renamed to...
+       (tt_face_get_metrics): This. Provide version for FT_OPTIMIZE_MEMORY.
+       Update all callers.
+       (Get_Advance_Widths): Replaced with...
+       (Get_Advance_WidthPtr): This.  Provide version for
+       FT_OPTIMIZE_MEMORY.
+       Update all callers.
+
+       * src/truetype/ttgload.h: Updated.
+
+2005-02-22  David Turner  <david@freetype.org>
+
+       * src/base/ftdbgmem.c: Partly rewritten.  Added the ability to list
+       all allocation sites in the memory debugger.  Also a new function
+       FT_DumpMemory() was added.  It is only available in builds with
+       FT_DEBUG_MEMORY defined, and you must declare it in your own code to
+       use it, i.e., with something like:
+
+         extern void FT_DumpMemory( FT_Memory );
+
+         ...
+
+         FT_DumpMemory( memory );
+
+       * include/freetype/config/ftoption.h
+       (TT_CONFIG_OPTION_BYTECODE_INTERPRETER): Comment out definition --
+       again.
+       (FT_OPTIMIZE_MEMORY): New configuration macro to control various
+       optimizations for reducing the heap footprint of memory-mapped
+       TrueType files.
+
+       * include/freetype/internal/ftmemory.h (FT_ARRAY_ZERO): New
+       convenience macro.
+
+       * include/freetype/internal/tttypes.h (TT_FaceRec)
+       [FT_OPTIMIZE_MEMORY]: Use optimized types for `num_locations' and
+       `glyph_locations'.
+
+       * src/truetype/ttgload.c (load_truetype_glyph): Call
+       `tt_face_get_location'.
+
+       * src/truetype/ttobjs.c (tt_face_init)
+       [FT_CONFIG_OPTION_INCREMENTAL]: Improve error handling.
+       (tt_face_done): Call `tt_face_done_loca'.
+
+       * src/truetype/ttpload.c (tt_face_get_location, tt_face_done_loca):
+       New functions.  If FT_OPTIMIZE_MEMORY is set, the locations table is
+       read directly from memory-mapped streams, instead of being decoded
+       into the heap.
+       (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]: New implementation.
+       (tt_face_load_cvt, tt_face_load_fpgm): Only load table if the
+       bytecode interpreter is compiled in.
+
+       * src/truetype/ttpload.h: Updated.
+
+       * src/autohint/ahglyph.c (ah_outline_load): Improve allocation
+       logic.
+
+2005-02-20  Werner Lemberg  <wl@gnu.org>
+
+       * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
+       --copy' from libtool 1.5.14.
+       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
+       automake 1.9.4.
+
+       * builds/unix/config.guess, builds/unix/config.sub: Updated from
+       `config' CVS module at subversions.gnu.org.
+
+       * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
+       `texinfo' CVS module at subversions.gnu.org.
+
+2005-02-14  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cffcmap.c (cff_cmap_unicode_init): Don't try to build
+       a cmap for a CID-keyed font which doesn't have SIDs.
+
+2005-02-13  Werner Lemberg  <wl@gnu.org>
+
+       * src/type1/t1load.c (read_binary_data): Return more meaningful
+       value.
+       (parse_encoding, parse_subrs, parse_charstrings, parse_dict): Check
+       parser error value after call to T1_Skip_PS_Token (where necessary).
+
+       * src/type1/t1parse.c (T1_Get_Private_Dict): Check parser error
+       value after call to T1_Skip_PS_Token.
+
+       * src/cid/cidparse.c (cid_parser_new): Check parser error value
+       after call to cid_parser_skip_PS_token.
+
+       * src/type42/t42parse.c (t42_parse_encoding, t42_parse_sfnts,
+       t42_parse_charstrings, t42_parse_dict): Check parser error value
+       after call to T1_Skip_PS_Token (where necessary).
+
+       * src/psaux/psobjc.c (skip_string, ps_parser_skip_PS_token,
+       ps_tobytes): Add error messages.
+
+2005-02-12  Werner Lemberg  <wl@gnu.org>
+
+       * configure: Output more variables to the created Makefile so that
+       it can be used for ft2demos also (if the FT2DEMOS variable is
+       defined).
+
+2005-02-10  David Turner  <david@freetype.org>
+
+       * src/pfr/pfrgload.c (pfr_glyph_load): Fix an unbounded growing
+       dynamic array when loading a glyph from a PFR font (Savannah bug
+       #11921).
+
+       * src/base/ftbitmap.c (FT_Bitmap_Convert): Small improvements to the
+       conversion function (mainly stupid optimization).
+
+       * src/base/Jamfile: Adding ftbitmap.c to the list of compiled files.
+
+2005-02-10  Werner Lemberg  <wl@gnu.org>
+
+       * builds/unix/freetype-config.in: Add new flag `--ftversion' to
+       return the FreeType version.  Suggested by George Williams
+       <gww@silcom.com>.
+
+       * docs/CHANGES: Updated.
+
+2005-02-09  Werner Lemberg  <wl@gnu.org>
+
+       * src/otvalid/otvmod.c (otv_validate): Deallocate arrays in case
+       of error.  Reported by YAMANO-UCHI Hidetoshi <mer@din.or.jp>.
+
+2005-02-08  Werner Lemberg  <wl@gnu.org>
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+       <op_closepath>: Accept `T1_Parse_Have_Moveto' state also which can
+       happen in empty glyphs.  Reported by Ian Brown
+       <ian.brown@printsoft.de> (Savannah bug #11856).
+
+2005-02-04  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/*: Removed.  Obsolete.
+
+2004-12-28  Werner Lemberg  <wl@gnu.org>
+
+       * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
+       --copy' from libtool 1.5.10.
+       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
+       automake 1.9.4.
+       * builds/unix/configure: Regenerated with autoconf 2.59b.
+
+       * builds/unix/config.guess, builds/unix/config.sub: Updated from
+       `config' CVS module at subversions.gnu.org.
+
+       * builds/unix/install-sh: Updated from
+       `texinfo' CVS module at subversions.gnu.org.
+
+       * builds/unix/ftsystem.c (FT_Stream_Open): Add proper cast for
+       ft_alloc.
+       Fix compiler warning.
+
+2004-12-27  Dirck Blaskey  <listtarget@danbala.com>
+
+       * src/cff/cffobjs.c (cff_face_init): Improve computation of
+       FT_STYLE_BOLD_FLAG.
+
+2004-12-27  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cffobjs.c (cff_face_init): A CFF within an SFNT can have
+       only a single font.  This is undocumented but has been verified on
+       the opentype list.
+
+2004-12-26  Werner Lemberg  <wl@gnu.org>
+
+       * Jamfile (FT2_COMPONENTS): Add `otvalid'.
+
+2004-12-25  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftbitmap.c (FT_Bitmap_Convert): Fix compiler warning.
+
+2004-12-15  Werner Lemberg  <wl@gnu.org>
+
+       * vms_make.com: Add ftbitmap.obj.
+
+2004-12-14  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftbitmap.c, include/freetype/ftbitmap.h: New files for
+       handling various bitmap formats.
+
+       * include/freetype/config/ftheader.h (FT_BITMAP_H): New macro.
+
+       * src/base/rules.mk (BASE_EXT_SRC): Add ftbitmap.c.
+
+       * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Don't convert bitmaps to 8bpp
+       but return them as-is.
+
+       * docs/CHANGES: Mention new bitmap API.
+       * include/freetype/ftchapter.s: Updated.
+
+2004-12-11  Robert Clark  <freetype@ratty.org.uk>
+
+       * src/base/ftobjs.c (FT_Get_Kerning): Make kerning amount
+       dependent on ppem by scaling down for ppem < 25, then do normal
+       rounding.  This gives slightly better results than rounding towards
+       zero.
+
+2004-12-09  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftobjs.c (FT_Get_Kerning): Always round towards zero
+       for FT_KERNING_DEFAULT.  This greatly enhances the kerning for
+       small ppem values.
+
+2004-12-08  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftobjs.c (ft_glyphslot_clear): Reset `lsb_delta' and
+       `rsb_delta'.
+
+2004-12-05  Werner Lemberg  <wl@gnu.org>
+
+       * builds/unix/install.mk (install): Use $(OBJ_BUILD) for ftconfig.h.
+
+2004-12-03  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
+
+       * include/freetype/ttnameid.h: Updated to latest
+       specifications from Microsoft.
+
+2004-11-26  Jouk Jansen  <joukj@hrem.stm.tudelft.nl>
+
+       * vms_make.com: Include ftbbox.c.
+       Fix `ccopt'.
+       Handle `otvalid' module.
+       Update `vmslib.dat' default values.
+       Fixes to `libs.opt'.
+
+2004-11-23  Anders Kaseorg  <anders@kaseorg.com>
+
+       * src/base/ftoutln.c (FT_OrientationExtremumRec,
+       ft_orientation_extremum_compute): Removed.
+       (FT_Outline_Get_Orientation): Rewritten, simplified.
+
+       * src/autohint/ahglyph.c: Include FT_OUTLINE_H.
+       (ah_test_extremum, ah_get_orientation): Removed.
+       (ah_outline_load): Use FT_Outline_Get_Orientation.
+
+       * src/base/ftsynth.c (ft_test_extrama, ft_get_orientation): Removed.
+       (FT_GlyphSlot_Embolden): Use FT_Outline_Get_Orientation.
+
+2004-11-23  Fernando Papa  <fpapa@netgate.com.uy>
+
+       * src/truetype/ttinterp.h: Fix typo.
+
+2004-11-22  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
+
+       * builds/win32/detect.mk: Corrected logic that detects Windows NT to
+       use the previous change even if win32 is forced.  Corrected
+       detection of win32 on Win9X.
+
+       * builds/dos/detect.mk: Added same correction as for win32 about
+       COPY on Windows NT.  Detection of plain DOS 7.x.
+
+2004-11-22  Werner Lemberg  <wl@gnu.org>
+
+       * builds/detect.mk: Undo change from 2004-11-20.
+       * builds/win32/detect.mk: If the `OS' environment variable contains
+       `Windows_NT', use `cmd.exe /c copy' for copying files.
+
+2004-11-20  Werner Lemberg  <wl@gnu.org>
+
+       * builds/detect.mk (dos_setup): Use `cmd.exe' for copying
+       $(CONFIG_MK) to force lowercase file name under Windows.
+
+2004-11-19  Werner Lemberg  <wl@gnu.org>
+
+       Fix a serious bug in the TT hinter.
+
+       * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Don't shift
+       points vertically before hinting.
+
+       * docs/CHANGES: Updated.
+
+       * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily,
+       FTC_GCache_Lookup): A new try to fix comparison with zero.
+
+2004-11-16  Werner Lemberg  <wl@gnu.org>
+
+       * builds/unix/configure.ac: Add `-fno-strict-aliasing' if gcc is
+       used.
+       * builds/unix/configure: Regenerated.
+       * builds/unix/config.guess, builds/unix/config.sub: Updated from
+       `config' CVS module at subversions.gnu.org.
+
+2004-11-16  Dr. Martin P.J. Zinser  <zinser@decus.de>
+
+       * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily,
+       FTC_GCache_Lookup): Fix comparison with zero.
+
+       * docs/INSTALL.VMS: Updated.
+
+       * vms_make.com: Updated.  All `descrip.mms' files are now created
+       automatically.
+
+       * src/*/descrip.mms: Removed.
+
+2004-11-16  Owen Taylor  <otaylor@redhat.com>
+
+       * builds/unix/freetype-config.in: Supress -L$libdir for
+       /usr/lib64 as well as /usr/lib. (Reported by Dan Winship -
+       https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=139199)
+
+2004-11-11  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cffdrivr.c (cff_service_ps_info): Updated.
+       * src/cid/cidriver.c (cid_service_ps_info): Updated.
+       * src/type42/t42drivr.c (t42_ps_get_font_private): New function.
+       (t42_service_ps_info): Updated.
+
+       * src/type42/t42parse.c (t42_parse_dict): Remove compiler warning.
+
+2004-11-11  David Bevan  <dbevan@emtex.com>
+
+       Add new function FT_Get_PS_Font_Private().
+
+       * include/freetype/internal/services/svpsinfo.h
+       (PS_GetFontPrivateFunc): New service function.
+
+       * include/freetype/t1tables.h, src/base/fttype1.c
+       (FT_Get_PS_Font_Private): New function.
+
+       * src/type1/t1driver.c (t1_ps_get_font_private): New function.
+       (t1_service_ps_info): Updated.
+
+2004-10-13  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/config/ftstdlib.h: Include `stddef.h'.
+       (ft_ptrdiff_t): Define.
+
+       * include/freetype/fttypes.h (FT_PtrDist): Use `ft_ptrdiff_t'.
+
+       * src/cid/cidload.c (cid_parse_dict), src/type1/t1load.c
+       (parse_dict): Fix compiler warning.
+
+2004-10-11  Joshua Neal  <jneal@csdaily.com>
+
+       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Check for pointer
+       overflow.
+
+       * src/sfnt/ttload.c (tt_face_load_hdmx): Protect against bad input.
+       Don't use FT_QNEW_ARRAY but FT_NEW_ARRAY to make deallocation work
+       in case of failure.
+
+       * src/sfnt/ttsbit.c (Load_SBit_Range): Check range intervals.
+       (tt_face_load_sbit_strikes): Allocate `strike_sbit_ranges' after
+       frame test.
+
+       * src/truetype/ttgload.c (TTLoad_Simple_Glyph): Add assertion for
+       `flag'.
+
+2004-10-09  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2004-10-09  Boris Letocha  <b.letocha@cz.gmc.net>
+
+       Fix handling of NPUSHW if skipped in data stream.
+
+       * src/truetype/ttinterp.c (opcode_length): Set value for NPUSHW
+       to -2.
+       (SkipCode, TT_RunIns): Use opcode_length value for computation of
+       bytes to be skipped.
+
+2004-09-10  Jouk Jansen  <joukj@hrem.stm.tudelft.nl>
+
+       * vms_make.com: Updated.
+
+2004-09-09  Werner Lemberg  <wl@gnu.org>
+
+       Adding OpenType validation module.  The code is based on the
+       (unfinished) `otlayout' module but has been heavily modified to make
+       it much more compact.
+
+       * src/otvalid/*: New module.
+
+       * include/freetype/ftotval.h, src/base/ftotval.c,
+       include/freetype/internal/services/svotval.h: New files.
+
+       * include/freetype/config/ftmodule.h: Add otv_module_class.
+       * include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
+       macro.
+       * include/freetype/internal/ftserv.h
+       (FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
+       * include/freetype/internal/fttrace.h (otvmodule, otvcommon,
+       otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
+
+       * include/freetype/ftchapters.h: Updated.
+
+       * src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
+       src/base/rules.mk (BASE_EXT_SRC): Updated.
+
+       * docs/CHANGES: Updated.
+
+2004-09-08  Werner Lemberg  <wl@gnu.org>
+
+       * src/tools/docmaker/sources.py (re_source_block_format2) <column>:
+       Use lookahead assertion to not match `*/'.  This removes spurious
+       insertions of `/' in the HTML output.
+
+2004-09-07  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Fix call to
+       FT_NEW_ARRAY.
+
+2004-09-04  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/internal/ftobjs.h: Don't include
+       FT_CONFIG_STANDARD_LIBRARY_H.
+       (FT_Validator, FT_ValidationLevel, FT_ValidatorRec, FT_VALIDATOR,
+       ft_validator_init, ft_validator_run, ft_validator_error, FT_INVALID,
+       FT_INVALID_TOO_SHORT, FT_INVALID_OFFSET, FT_INVALID_FORMAT,
+       FT_INVALID_GLYPH_ID, FT_INVALID_DATA): Move to...
+
+       * include/freetype/internal/ftvalid.h: New file.
+       Make FT_INVALID return module-specific error codes.
+
+       * include/freetype/internal/internal.h (FT_INTERNAL_VALIDATE_H): New
+       macro.
+
+       * include/freetype/fterrors.h: Undefine FT_ERR_PREFIX only if
+       FT_KEEP_ERR_PREFIX isn't defined.
+
+       * src/base/ftobjs.c: Include FT_INTERNAL_VALIDATE_H.
+
+       * src/sfnt/ttcmap.h: Don't include FT_INTERNAL_OBJECTS_H but
+       FT_INTERNAL_VALIDATE_H.
+
+       * src/sfnt/ttcmap.c: Don't include FT_INTERNAL_OBJECTS_H but
+       FT_INTERNAL_VALIDATE_H.
+       Include sferrors.h before FT_INTERNAL_VALIDATE_H.
+       s/FT_Err_Ok/SFNT_Err_Ok/.
+
+       * src/sfnt/sferrors.h: Define FT_KEEP_ERR_PREFIX.
+
+       * src/type1/t1afm.c: Include t1errors.h.
+
+2004-09-03  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftdebug.c (ft_debug_init): Highest debug level is 7,
+       not 6.
+       * docs/DEBUG: Updated.
+
+2004-08-30  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/tttags.h (TTAG_BASE, TTAG_GDEF, TTAG_GPOS,
+       TTAG_JSTF): New tags.
+
+       * include/freetype/fttypes.h (FT_Bytes, FT_Tag): New typedefs.
+       (FT_Int): Add `signed'.
+
+2004-08-29  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/otlgpos.c (otl_gpos_subtable_validate): Add argument
+       to pass number of lookups.
+       Update all callers.
+       Don't call otl_lookup_list_validate but otl_lookup_validate.
+       (otl_gpos_validate): Call otl_lookup_list_validate instead of
+       otl_gpos_subtable_validate.
+
+       * src/otlayout/otlgpos.h: Updated.
+
+       * src/otlayout/otljstf.c (otl_jstf_max_validate): Add argument to
+       pass number of lookups.
+       Update all callers.
+
+
+       * src/cff/cffparse.c (cff_parse_real): s/exp/exponent/ to avoid
+       compiler warning.
+
+
+       * src/sfnt/ttcmap0.c, src/sfnt/ttcmap0.h: Renamed to...
+       * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h: This.
+       * src/sfnt/Jamfile, src/sfnt/rules.mk, src/sfnt/sfdriver.c,
+       src/sfnt/sfnt.c, src/sfnt/sfobjs.c: Updated.
+
+
+       * builds/compiler/gcc-dev.mk (CFLAGS): Don't add `-Wnested-externs'
+       if compiler is g++ (v3.3.3 emits a warning otherwise).
+
+2004-08-28  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/otlgpos.c (otl_value_length): Return number of bytes,
+       not number of 16bit entities.
+       (otl_gpos_lookup2_validate): Check class definition tables for
+       format 2.
+       Fix loop for format 2.
+       (otl_liga_mark2_validate): Fix offset for otl_anchor_validate.
+
+2004-08-27  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftmac.c: Don't include truetype/ttobjs.h.
+       Don't include type1/t1objs.h.
+       (FT_New_Face_From_FSSpec) [!__MWERKS__]: Remove compiler warnings.
+
+2004-08-27  Mathieu Malaterre  <mathieu@malaterre.com>
+
+       * src/base/ftmac.c: Handle OS_INLINE for xlc compiler also.
+
+2004-08-27  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/otlayout.h: Add copyright.
+       (OTL_INVALID_OFFSET): Removed.
+
+       * src/otlayout/otlgdef.h: Include otlayout.h.
+       Comment out inclusion of otltable.h.
+
+       * src/otlayout/otlgpos.c (otl_gpos_lookup4_validate): Fix call
+       to otl_base_array_validate.
+       (otl_liga_mark2_validate): Fix `for' loop.
+
+       * src/otlayout/otlgsub.c (otl_ligature_validate): Check `glyph_id',
+       not components array.
+
+       * src/otlcommn.c (otl_lookup_get_count, otl_feature_get_count):
+       Comment out.
+       (otl_lookup_list_get_count, otl_feature_list_get_count): Activate.
+       (otl_feature_list_validate, otl_gsubgpos_get_lookup_count):
+       s/otl_lookup_get_count/otl_lookup_list_get_count/.
+       (otl_script_list_validate):
+       s/otl_feature_get_count/otl_feature_list_get_count/.
+       (otl_script_validate): Call otl_lang_validate for default language.
+
+       * src/otlayout/otlcommn.h: Updated.
+
+2004-08-16  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/otlgpos.c (otl_gpos_lookup1_validate,
+       otl_gpos_lookup2_validate, otl_gpos_lookup3_validate,
+       otl_gpos_lookup4_validate, otl_gpos_lookup5_validate,
+       otl_gpos_lookup6_validate, otl_gpos_lookup9_validate,
+       otl_gpos_validate): Update
+       function arguments.
+       (otl_gpos_lookup7_validate, otl_gpos_lookup8_validate): Update
+       function arguments.
+       Handle NULL offsets correctly.
+       Check sequence and lookup indices for format 3.
+       (otl_pos_rule_validate, otl_chain_pos_rule_validate): Add argument
+       to pass lookup count.
+       Check sequence and glyph indices.
+       (otl_gpos_subtable_validate): Update function arguments.
+       Update callers.
+
+       * src/otlayout/otlgpos.h: Updated.
+
+       * src/otlayout/otlgsub.c (otl_gsub_lookup1_validate,
+       otl_gsub_lookup3_validate, otl_gsub_lookup8_validate): Update
+       function arguments.
+       Add glyph index checks.
+       (otl_sequence_validate, otl_alternate_set_validate,
+       otl_ligature_validate): Add argument to pass glyph count.
+       Update callers.
+       Add glyph index check.
+       (otl_gsub_lookup2_validate, otl_gsub_lookup4_validate): Update
+       function arguments.
+       (otl_ligature_set_validate): Add argument to pass glyph count.
+       Update caller.
+       (otl_sub_class_rule_validate,
+       otl_sub_class_rule_set_validate): Removed.
+       (otl_sub_rule_validate, otl_chain_sub_rule_validate): Add argument
+       to pass lookup count.
+       Update callers.
+       Add lookup index check.
+       (otl_sub_rule_set_validate, otl_chain_sub_rule_set_validate): Add
+       argument to pass lookup count.
+       Update callers.
+       (otl_gsub_lookup5_validate): Update function arguments.
+       Handle NULL offsets correctly.
+       Don't call otl_sub_class_rule_set_validate but
+       otl_sub_rule_set_validate.
+       Check sequence and lookup indices for format 3.
+       (otl_gsub_lookup6_validate): Update function arguments.
+       Handle NULL offsets correctly.
+       Check sequence and lookup indices for format 3.
+       (otl_gsub_lookup7_validate, otl_gsub_validate): Update function
+       arguments.
+
+       * src/otlayout/otlgsub.h: Updated.
+
+       * src/otlayout/otlbase.c (otl_base_validate): Handle NULL offsets
+       correctly.
+
+       * src/otlayout/otlcommn.c (otl_class_definition_validate): Fix
+       compiler warning.
+       (otl_coverage_get_first, otl_coverage_get_last): New functions.
+       (otl_lookup_validate): Add arguments to pass lookup and glyph
+       counts.
+       Update callers.
+       (otl_lookup_list_validate): Add argument to pass glyph count.
+       Update callers.
+
+       * src/otlayout/otlcommn.h: Updated.
+
+       * src/otlayout/otljstf.c (otl_jstf_extender_validate,
+       otl_jstf_max_validate, otl_jstf_script_validate,
+       otl_jstf_priority_validate, otl_jstf_lang_validate): Add parameter
+       to validate glyph indices.
+       Update callers.
+       (otl_jstf_validate): Add parameter which specifies number of glyphs
+       in font.
+
+       * src/otlayout/otljstf.h: Updated.
+
+2004-08-15  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/otlgpos.c (otl_liga_mark2_validate): Add parameter
+       to handle possible NULL values properly.
+       Update all callers.
+
+2004-08-15  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/gpos.c: Rename counting variables to be more
+       meaningful.
+       Add copyright.
+       (otl_liga_attach_validate): Renamed to...
+       (otl_liga_mark2_validate): This.
+       Update all callers.
+       (otl_mark2_array_validate): Removed.
+       (otl_gpos_lookup6_validate): Call otl_liga_mark2_validate, not
+       otl_mark2_array_validate.
+       (otl_pos_class_set_validate, otl_pos_class_rule_validate): Removed.
+       (otl_gpos_lookup7_validate): Complete code for format 2.
+       (otl_chain_pos_class_rule_validate,
+       otl_chaim_pos_class_set_validate): Removed.
+       (otl_gpos_lookup8_validate): Don't call
+       otl_chain_pos_class_set_validate but
+       otl_chain_pos_rule_set_validate.
+       Simplify some code.
+
+       * src/otlayout/otlgpos.h: Add copyright.
+
+2004-08-14  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/otljstf.c (otl_jstf_gsub_mods_validate): Removed.
+       (otl_jstf_gpos_mods_validate): Renamed to...
+       (otl_jstf_gsubgpos_mods_validate): This.
+       Test whether lookup_count is zero.
+       (otl_jstf_priority_validate): Use otl_jstf_gsubgpos_mods_validate.
+       (otl_jstf_validate): Initialize gsub_lookup_count and
+       gpos_lookup_count if gsub or gpos is zero.
+
+       * src/otlayout/otlgsub.c: Rename counting variables to be more
+       meaningful.
+       Add copyright.
+       (otl_gsub_lookup1_validate): Simplify code.
+       (otl_gsub_lookup2_validate, otl_gsub_lookup3_validate,
+       otl_gsub_lookup4_validate, otl_gsub_lookup7_validate): Remove unused
+       variables.
+       (otl_gsub_lookup5_validate): Remove unused variable.
+       Fix call to otl_sub_rule_set_validate and
+       otl_sub_class_rule_set_validate.
+       (otl_chain_sub_class_rule_validate,
+       otl_chain_sub_class_set_validate): Removed.
+       (otl_gsub_lookup6_validate): Remove unused variable.
+       Fix call to otl_chain_sub_rule_set_validate.
+       (otl_gsub_lookup7_validate): Handle lookup type 8 also.
+       (otl_gsub_lookup8_validate: New function.
+       (otl_gsub_lookup1_apply, otl_gsub_lookup2_apply,
+       otl_gsub_lookup3_apply): Commented out.
+       (otl_gsub_validate_funcs): Add otl_gsub_lookup7_validate and
+       otl_gsub_lookup8_validate.
+       (otl_gsub_validate): Updated.
+
+       * src/otlayout/otlgsub.h: Add copyright.
+
+       * src/otlayout/otlcommn.c, src/otlayout/otlcommn.h
+       (otl_coverage_get_index): Comment out.
+
+2004-08-13  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/otlcommn.c (otl_gsubgpos_get_lookup_count): New
+       function.
+       * src/otlayout/otlcommn.h: Updated.
+
+       * src/otlayout/otlbase.c: Rename counting variables to be more
+       meaningful.
+       Add copyright message.
+       * src/otlayout/otlbase.h: Add copyright message.
+
+       * src/otlayout/otlgdef.c: Rename counting variables to be more
+       meaningful.
+       Add copyright message.
+       Use OTL_CHECK everywhere.
+       (otl_caret_value_validate): Remove unused variable.
+       (otl_gdef_validate): All tables are optional.
+       * src/otlayout/otlgdef.h: Add copyright message.
+
+       * src/otlayout/otljstf.c: Rename counting variables to be more
+       meaningful.
+       Add copyright message.
+       (otl_jstf_gsub_mods_validate, otl_jstf_gpos_mods_validate): Add
+       parameter to pass lookup count.
+       Update all callers.
+       Check lookup array.
+       (otl_jstf_max_validate):
+       s/otl_gpos_subtable_check/otl_gpos_subtable_validate/.
+       (otl_jstf_priority_validate, otl_jstf_lang_validate,
+       otl_jstf_script_validate): Add two parameters to pass lookup counts.
+       Update all callers.
+       (otl_jstf_validate): Add two parameters to pass GPOS and GSUB
+       table offsets; use otl_gsubgpos_get_lookup_count to convert extract
+       lookup counts.
+       Fix typo.
+       * src/otlayout/otljstf.h: Updated.
+       Add copyright message.
+
+       * src/otlayout/otlgpos.c (otl_gpos_subtable_validate): New function.
+       (otl_gpos_validate): Use it.
+       * src/otlayout/otlgpos.h: Updated.
+
+2004-08-13  Werner Lemberg  <wl@gnu.org>
+
+       * src/otlayout/otcommn.c: Use OTL_CHECK everywhere.
+       (otl_coverage_validate): Initialize `p',
+       s/count/num_glyphs/.
+       s/start_cover/start_coverage/.
+       (otl_coverage_get_index): Return OTL_Long, not OTL_Int.
+       Remove unused variables.
+       (otl_class_definition_validate): s/count/num_glyphs/.
+       Remove unused variables.
+       (otl_class_definition_get_value, otl_device_table_get_start,
+       otl_device_table_get_end, otl_device_table_get_delta,
+       otl_lookup_get_table, otl_lookup_list_get_count,
+       otl_lookup_list_get_lookup, otl_lookup_list_get_table,
+       otl_feature_get_lookups, otl_feature_list_get_count,
+       otl_feature_list_get_feature, otl_lang_get_count,
+       otl_lang_get_req_feature, otl_lang_get_features): Commented out
+       temporarily until we really need it.
+       (otl_lookup_validate): Removed.
+       (otl_lookup_table_validate): Renamed to ...
+       (otl_lookup_validate): This.  Update callers.
+       (otl_lookup_list_validate): Remove already commented out definition
+       and move the other definition up.
+       (otl_feature_validate): Add parameter to pass number of lookups.
+       Update callers.
+       Check lookup indices.
+       (otl_feature_list_validate): Add parameter to pass lookup table.
+       Update callers.
+       (otl_lang_validate): Add parameter to pass number of features.
+       Update callers.
+       Handle req_feature and check feature indices.
+       (otl_script_validate): Add parameter to pass number of features.
+       Update callers.
+       (otl_script_list_validate): Add parameter to pass feature table.
+       Update callers.
+
+       * src/otlayout/otcommn.h: s/LOCALDEF/LOCAL/.
+       Comment out the same functions as in otcommn.c.
+       (otl_script_list_get_script): Removed.
+
+       * src/otlayout/otlgsub.c (otl_gsub_lookup1_apply): Change `index' to
+       type OTL_Long.
+       (otl_gsub_lookup2_apply, otl_gsub_lookup3_apply): Change `index' to
+       type OTL_Long.
+       Fix test.
+       (otl_gsub_validate): Fix order of validation.
+
+       * src/otlayout/otlgpos.c (otl_gpos_validate): Fix order of
+       validation.
+
+2004-08-12  Werner Lemberg  <wl@gnu.org>
+
+       Make otlayout module compile (without actually working).
+
+       * src/otlayout/*: s/OTL_Valid/OTL_Validator/.
+       s/NULL/0/.
+
+       * src/otlayout/otlayout.h: Fix various typos.
+       (OTL_Bool): New typedef.
+       (OTL_Int, OTL_Long, OTL_Int16, OTL_Int32): Use `signed' keyword.
+       (OTL_Err_InvalidArgument): Removed.
+       (OTL_Err_InvalidData, OTL_Err_InvalidSize): New enum values.
+       (OTL_MAKE_TAG): Add missing parenthesis.
+       (OTL_INVALID_DATA): Use OTL_Err_InvalidData.
+       (OTL_INVALID_TOO_SHORT): Use OTL_Err_InvalidSize.
+       (OTL_INVALID_FORMAT, OTL_INVALID_OFFSET): New macros.
+
+       * src/otlayout/otlgpos.c: s/FT_/OTL_/.
+       s/OTL_Short/OTL_Int16/.
+       (otl_gpos_pairset_validate): Add return type.
+       (otl_base_array_validate): Fix call to otl_anchor_validate.
+       (otl_liga_array_validate): Fix call to otl_liga_attach_validate.
+       (otl_gpos_lookup5_validate): Fix typos.
+       (otl_gpos_lookup6_validate): Fix call to otl_mark2_array_validate.
+       (otl_gpos_lookup7_validate): Comment out unfinished code.
+       Fix typos.
+
+       * src/otlayout/otlgsub.c: Add forward declaration for
+       otl_gsub_validate_funcs.
+       (otl_gsub_lookup1_apply, otl_gsub_lookup2_apply,
+       otl_gsub_lookup3_apply): Fix call to otl_parser_check_property.
+       s/otl_coverage_lookup/otl_coverage_get_index/.
+       (otl_ligature_validate): Add missing variable declaration.
+       (otl_sub_rule_validate): Fix typo.
+       (otl_sub_class_rule_validate): Add missing variable declaration.
+       Fix typo.
+       (otl_gsub_lookup5_validate): Fix typo.
+       (otl_gsub_lookup6_validate): Fix call to
+       otl_chain_sub_class_set_validate.
+       (otl_gsub_validate_funcs): Don't use `const'.
+
+       * src/otlayout/otlcommn.c (otl_class_definition_get_value,
+       otl_device_table_validate, otl_device_table_get_delta,
+       otl_lookup_validate, otl_script_validate): Add missing
+       variable declarations.
+       (otl_lookup_list_validate): Comment out first definition.
+       (otl_lookup_list_foreach, otl_feature_list_foreach): Comment out.
+       (otl_feature_list_validate):
+       s/otl_feature_table_validate/otl_feature_validate/.
+       (otl_script_list_validate):
+       s/otl_script_table_validate/otl_script_validate/.
+
+       * src/otlayout/otlcommn.h: Comment out first declaration.
+       (otl_lookup_list_foreach, otl_feature_list_foreach): Comment out.
+
+       * src/otlayout/otlbase.c (otl_base_coord_validate): Fix call to
+       otl_device_table_validate.
+       (otl_base_scsript_validate): Add missing variable declarations.
+       (otl_base_script_list_validate): Fix call to
+       otl_base_script_validate.
+       (otl_axis_table_validate): Fix calls to otl_base_tag_list_validate
+       and otl_base_script_list_validate.
+       (otl_base_validate): Fix calls to otl_axis_table_validate.
+
+       * src/otlayout/otlgdef.c (otl_attach_list_validate): Fix call to
+       otl_attach_point_validate.
+       (otl_caret_value_validate): Add missing variable declaration.
+       Fix call to otl_device_table_validate.
+       (otl_ligature_glyph_validate): Fix call to otl_caret_value_validate.
+       (otl_ligature_caret_list_validate): Fix call to
+       otl_ligature_glyph_validate.
+       (otl_gdef_validate): Fix calls to otl_class_definition_validate,
+       otl_attach_list_validate, otl_ligature_caret_list_validate, and
+       otl_class_definition_validate.
+
+       * src/otlayout/otltable.h (otl_table_validate, otl_table_init,
+       otl_table_set_script): Comment out.
+
+       * src/otlayout/otlparse.h (OTL_ParserRec):
+       s/OTL_Alternate/OTL_GSUB_Alternate/.
+       (OTL_ParseError): Add OTL_Err_Parser_Memory and
+       OTL_Err_Parser_Internal.
+       (otl_parser_error): Fix typo.
+       (otl_parser_check_property): Remove third argument.
+
+       * src/otlayout/otlparse.c (otl_string_ensure):
+       s/OTL_Parse_Err_Memory/OTL_Err_Parser_Memory/.
+       (OTL_STRING_ENSURE, otl_parser_error, otl_parser_get_index,
+       otl_parser_replace_1, otl_parser_replace_n): Fix typos.
+       (OTL_PARSER_UNCOVERED): Removed.
+       (otl_parser_check_property): Remove third argument.
+
+       * src/otlayout/otljstf.c (otl_jstf_priority_validate): Add missing
+       variable declaration.
+
+       * src/otlayout/otlutils.h (OTL_MEM_REALLOC): Fix typo.
+
+2004-08-11  Danny  <dannyboynow@yahoo.com>
+
+       * src/base/ftstream.c (FT_Stream_Close): Don't reset stream->close
+       to NULL.  This allows custom close functions to delete the FT_STREAM
+       object.
+
+2004-08-11  Werner Lemberg  <wl@gnu.org>
+
+       Add API to get information about SFNT tables.
+
+       * include/freetype/internal/services/svsfnt.h
+       (FT_SFNT_Table_Info_Func): New typedef.
+       (SFNT_Table): Add it.
+
+       * src/base/ftobjs (FT_Sfnt_Table_Info): New function.
+
+       * include/freetype/tttables.h: Updated.
+
+       * src/sfnt/sfdriver.c (sfnt_table_info): New function.
+       (sfnt_service_sfnt_table): Add it.
+
+       * docs/CHANGES: Updated.
+
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
+
+       * builds/unix/configure.ac (version_info): Set to 9:8:3.
+       * builds/unix/configure: Updated.
+
+       * builds/win32/visualc/index.html,
+       builds/win32/visualc/freetype.dsp,
+       builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.
+
+       * builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
+       s/2.1.9/2.1.10/.
+
+       * docs/CHANGES, docs/VERSION.DLL: Updated.
+
+2004-08-11  Detlef Würkner  <TetiSoft@apg.lahn.de>
+
+       * src/base/ftrfork.c (FT_Raccess_Guess)
+       [!FT_CONFIG_OPTION_GUESSING_EMBEDDED_FORK]: Remove compiler
+       warnings.
+
+2004-08-06  Adam Piotrowski  <st_intel@poczta.onet.pl>
+
+       * src/pfr/pfrload.c (pfr_sort_kerning_pairs): Single-byte
+       adjustments are unsigned, not signed.
+
+2004-08-05  David Turner  <david@freetype.org>
+
+       `Activate' gray-scale specifing hinting within the TrueType
+       bytecode interpreter.  This is an experimental feature which
+       should probably be made optional.
+
+       * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
+       load_truetype_glyph): Move the code to set the pedantic_hinting flag
+       to...
+       (TT_Load_Glyph): Here.
+       Set `grayscale' flag except for `FT_LOAD_TARGET_MONO'.
+
+       * src/truetyep/ttinterp.c (Ins_GETINFO): Return MS rasterizer
+       version 1.7.
+       Return rotation and stretching info only if glyph is rotated or
+       stretched, respectively.
+       Handle grayscale info.
+
+       * src/truetype/ttinterp.h (TT_ExecContextRec): Add `grayscale'
+       member.
+
+2004-08-02  George Williams  <gww@silcom.com>
+
+       * src/base/ftobjs.c (FT_Attach_File): Initialize `open.stream'.
+
+2004-08-01  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2004-08-01  George Williams  <gww@silcom.com>
+
+       FreeType now can read kerning values from PFM files.
+
+       * src/type1/t1afm.c (T1_Done_AFM): Renamed to...
+       (T1_Done_Metrics): This.
+       Update all callers.
+       (T1_Read_AFM): Make it static.
+       Don't enter and leave a frame.
+       (LITTLE_ENDIAN_USHORT, LITTLE_ENDIAN_UINT): New macros.
+       (T1_Read_PFM): New function.
+       (T1_Read_Metrics): New higher-level function to be used instead of
+       T1\1fRead_AFM.
+       Update all callers.
+
+2004-07-31  Werner Lemberg  <wl@gnu.org>
+
+       * src/pcf/pcfread (pcf_load_font), src/bdf/bdfdrivr.c
+       (BDF_Face_Init), src/truetype/ttgxvar (TT_Get_MM_Var,
+       tt_face_vary_cvt): Fix compiler warnings.
+
+2004-07-26  Søren Sandmann  <sandmann@daimi.au.dk>
+
+       * src/pcf/pcfread.c (pcf_interpret_style): Always allocate memory for
+       face->style_name.
+       * src/pcf/pcfdrivr.c (PCF_Face_Done): Free `style_name'.
+
+2004-07-26  Darren J Longhorn  <darren.longhorn@redcom.co.uk>
+
+       * include/freetype/config/ftconfig.h (FT_SIZEOF_LONG): Recognize
+       five-byte `long' (which is avoided then).
+
+2004-07-25  Detlef Würkner  <TetiSoft@apg.lahn.de>
+
+       * src/pcf/pcfdrivr.c (PCF_Set_Pixel_Size): Compare heights, not
+       ppem values.
+       (PCF_Set_Point_Size): Don't call PCF_Set_Pixel_Size but provide own
+       code to compare ppem values.
+       * src/bdf/bdfdrivr.c (BDF_Set_Pixel_Size): Compare heights, not
+       ppem values.
+       (BDF_Set_Point_Size): Don't call BDF_Set_Pixel_Size but provide own
+       code to compare ppem values.
+
+2004-07-25  Kornfeld Eliyahu Peter  <peter@e-kadmon.net>
+
+       * src/sfnt/sfobjs.c (sfnt_load_face): Handle
+       TT_NAME_ID_PREFERRED_FAMILY and TT_NAME_ID_PREFERRED_SUBFAMILY.
+
+2004-07-24  Derek B. Noonburg  <derekn@foolabs.com>
+
+       * src/cff/cffload.c (cff_font_load): Always create inverse mapping.
+       Even if the charstring count is the same as the CID count, it is
+       still possible that the font uses a different CID -> GID mapping.
+
+2004-07-23  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttobjs.c (tt_face_init): Accept 0x00020000 format tag
+       found in some Arphic fonts made for Chinese version of Windows 3.1.
+
+2004-07-17  David Turner  <david@freetype.org>
+
+       Fixed a dangling pointer bug in the cache code that happened in very
+       rare cases, i.e., when a new family object was destroyed by an
+       out-of-memory condition during a glyph node initialization.  The
+       function FTC_Cache_Lookup would flush the cache and restart the
+       lookup with a bad pointer.
+
+       * include/freetype/cache/ftcglyph.h (FTC_FAMILY_TREE): New macro.
+       (FTC_GCACHE_LOOKUP_CMP): Use it.
+       Handle reference count in `num_nodes' correctly.
+
+       * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily): Use
+       FTC_FAMILY_FREE.
+       (FTC_GCache_Lookup): Handle reference count in `num_nodes' correctly.
+
+       * src/cache/ftcmanag.c (FTC_Manager_FlushN): Fixed a cache flushing
+       bug.
+
+       * src/truetype/ttinterp.c (Normalize): Fixed a bug that caused
+       long and unnecessary delays while normalizing huge vectors.
+
+2004-07-15  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+       * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix compiler
+       warning.
+
+2004-07-15  David Turner  <david@freetype.org>
+
+       * src/base/ftstroke.c (FT_Stroker_ParseOutline): Single points
+       are not stroked, preventing a bug with pala.ttf and other
+       fonts.
+
+       * include/freetype/ftstroke.h: Updating documentation comments.
+
+2004-07-13  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftstroke.c (ft_stroke_border_reverse): Removed.  Unused.
+
+2004-07-12  David Turner  <david@freetype.org>
+
+       * src/base/ftstroke.c (ft_stroke_border_close): Add second parameter
+       to indicate reversion of points.
+       Update all callers.
+       (ft_stroke_border_reverse): Fix initialization of `point1' and
+       `tag1'.
+
+       * src/cache/ftcsbits.c (ftc_snode_load): Fixing advance computation
+       for transformed glyphs.
+
+2004-07-11  David Turner  <david@freetype.org>
+
+       Fix bugs that prevented the stroker to correctly generate stroked
+       paths from closed paths, i.e., nearly all glyphs in vectorial fonts.
+
+       The code is still _very_ buggy though; treat with special care.
+
+       * src/base/ftstroke.c (FT_STROKE_TAG_BEGIN_END): New macro.
+       (ft_stroke_border_reverse): New function.
+       (ft_stroker_inside): Remove local variable `sigma'; use different
+       threshold.
+       (ft_stroker_add_reverse_left): Switch begin/end tags if necessary.
+       (FT_Stroker_EndSubPath): Call ft_stroker_inside and
+       ft_stroke_border_reverse.
+
+2004-06-26  Peter Kovar  <peter.kovar@r3.roburnet.sk>
+
+       * src/truetype/ttgload.c (load_truetype_glyph): Fix typo.
+
+2004-06-25  Werner Lemberg  <wl@gnu.org>
+
+       * src/type1/t1afm.c (afm_atoindex): Fix boundary test.  Reported
+       by Dirck Blaskey.
+
+2004-06-24  David Turner  <david@freetype.org>
+
+
+       * Version 2.1.9 released.
+       =========================
+
+
+       * src/truetype/ttgload.c, src/truetype/ttxgvar.c: Removing
+       compiler warnings.
+
 2004-06-23  Werner Lemberg  <wl@gnu.org>
 
        * include/freetype/internal/ftmemory.h [FT_DEBUG_MEMORY]: Declare
        automake 1.8a.
        * builds/unix/configure: Regenerated with autoconf 2.59a.
        * builds/unix/config.guess, builds/unix/config.sub: Updated from
-       `config' CVS module at subversions.gnu.org
+       `config' CVS module at subversions.gnu.org.
        * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
        `texinfo' CVS module at subversions.gnu.org.
        * builds/freetype.mk (refdoc): Updated.
        builds/unix/unixddef.mk, builds/win32/w32-bccd.mk,
        builds/win32/w32-dev.mk (BUILD_DIR): Fix path.
 
-       * builds/unix/configure.ac, builds/unic/configure: Updated.
+       * builds/unix/configure.ac, builds/unix/configure: Updated.
        * builds/unix/unix-def.in (DISTCLEAN): Add `freetype2.pc'.
 
 2003-06-07  Werner Lemberg  <wl@gnu.org>
        the use of system-wide zlib.
 
        Note that this macro, as well as
-       FT_CONFIG_OPTION_BYTECODE_INTERPRETER, is not #undef-ed anymore.
+       TT_CONFIG_OPTION_BYTECODE_INTERPRETER, is not #undef-ed anymore.
        This allows the build system to define them depending on the
        configuration (typically by adding -D flags at compile time).
 
        * Version 2.0 released.
        =======================
 
+----------------------------------------------------------------------------
+
+Copyright 2000, 2001, 2002, 2003, 2004, 2005 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This file is part of the FreeType project, and may only be used, modified,
+and distributed under the terms of the FreeType project license,
+LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+indicate that you have read the license and understand and accept it
+fully.
+
 
 Local Variables:
 version-control: never
index 54fe154..74e9f6c 100644 (file)
@@ -1,5 +1,14 @@
-# FreeType 2 top Jamfile (c) 2001, 2002, 2003, 2004 David Turner
+# FreeType 2 top Jamfile.
 #
+# Copyright 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.
+
 
 # The HDRMACRO is already defined in FTJam and is used to add
 # the content of certain macros to the list of included header
@@ -62,7 +71,6 @@ FT2_BUILD_INCLUDE ?= ;
 #            if you modify this list or provide your own.
 #
 FT2_COMPONENTS ?= autofit    # auto-fitter
-                  autohint   # auto-hinter
                   base       # base component (public APIs)
                   bdf        # BDF font driver
                   cache      # cache sub-system
@@ -70,6 +78,7 @@ FT2_COMPONENTS ?= autofit    # auto-fitter
                   cid        # PostScript CID-keyed font driver
                   gzip       # support for gzip-compressed files
                   lzw        # support for LZW-compressed files
+                  #otvalid    # validation of OpenType tables
                   pcf        # PCF font driver
                   pfr        # PFR/TrueDoc font driver
                   psaux      # common PostScript routines module
@@ -148,7 +157,7 @@ if $(DEBUG_HINTER)
 
 actions RefDoc
 {
-  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.9 --output=$(DOC_DIR)  $(FT2_INCLUDE)/freetype/*.h  $(FT2_INCLUDE)/freetype/config/*.h  $(FT2_INCLUDE)/freetype/cache/*.h
+  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.10 --output=$(DOC_DIR)  $(FT2_INCLUDE)/freetype/*.h  $(FT2_INCLUDE)/freetype/config/*.h  $(FT2_INCLUDE)/freetype/cache/*.h
 }
 
 RefDoc  refdoc ;
index 0b68597..d8d1c7e 100644 (file)
@@ -1,5 +1,15 @@
-# FreeType 2 JamRules (c) 2001, 2002, 2003 David Turner
+# FreeType 2 JamRules.
 #
+# Copyright 2001, 2002, 2003 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
 # This file contains the Jam rules needed to build the FreeType 2 library.
 # It is shared by all Jamfiles and is included only once in the build
 # process.
index e1fbdf2..8caf1f0 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000 by
+# Copyright 1996-2000, 2002 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
index 354d67d..57f6ed6 100644 (file)
@@ -9,8 +9,8 @@
   is called `libttf'.  They are *not* compatible!
 
 
-  FreeType 2.1.9
-  ==============
+  FreeType 2.1.10
+  ===============
 
   Please read the docs/CHANGES file, it contains IMPORTANT INFORMATION.
 
@@ -19,9 +19,9 @@
   Note  that  the FreeType  2  documentation  is  now available  as  a
   separate package from our sites.  See:
 
-    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.9.tar.bz2
-    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.9.tar.gz
-    ftp://ftp.freetype.org/freetype/freetype2/ftdoc219.zip
+    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.10.tar.bz2
+    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.10.tar.gz
+    ftp://ftp.freetype.org/freetype/freetype2/ftdoc2110.zip
 
 
   Bugs
 
 
     The FreeType Team
+
+----------------------------------------------------------------------
+
+Copyright 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.
+
+
+--- end of README ---
diff --git a/reactos/lib/freetype/README.CVS b/reactos/lib/freetype/README.CVS
new file mode 100644 (file)
index 0000000..aecdc65
--- /dev/null
@@ -0,0 +1,25 @@
+The CVS archive doesn't contain pre-built configuration scripts for\r
+UNIXish platforms.  To generate them say\r
+\r
+  sh autogen.sh\r
+\r
+which in turn depends on the following packages:\r
+\r
+  automake (1.9.4)\r
+  libtool (1.5.16)\r
+  autoconf (2.59b)\r
+\r
+The versions given in parentheses are known to work.  Note that autogen.sh\r
+also sets up proper file permissions for the configure and auxiliary\r
+scripts.\r
+\r
+For static builds which don't use platform specific optimizations no\r
+configure script is necessary at all; saying\r
+\r
+  make setup ansi\r
+  make\r
+\r
+should work on all platforms which have GNU make (or makepp).\r
+\r
+\r
+--- end of README.CVS ---\r
diff --git a/reactos/lib/freetype/autogen.sh b/reactos/lib/freetype/autogen.sh
new file mode 100644 (file)
index 0000000..34a4183
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh\r
+\r
+# Copyright 2005 by\r
+# David Turner, Robert Wilhelm, and Werner Lemberg.\r
+#\r
+# This file is part of the FreeType project, and may only be used, modified,\r
+# and distributed under the terms of the FreeType project license,\r
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\r
+# indicate that you have read the license and understand and accept it\r
+# fully.\r
+\r
+run ()\r
+{\r
+  echo "running \`$*'"\r
+  eval $*\r
+\r
+  if test $? != 0 ; then\r
+    echo "error while running \`$*'"\r
+    exit 1\r
+  fi\r
+}\r
+\r
+if test ! -f ./builds/unix/configure.ac; then\r
+  echo "You must be in the same directory as \`autogen.sh'."\r
+  echo "Bootstrapping doesn't work if srcdir != builddir."\r
+  exit 1\r
+fi\r
+\r
+cd builds/unix\r
+\r
+run aclocal -I . --force\r
+run libtoolize --force --copy\r
+run autoconf --force\r
+\r
+chmod +x mkinstalldirs\r
+chmod +x install-sh\r
+\r
+cd ../..\r
+\r
+chmod +x ./configure\r
+\r
+# EOF\r
index 1611666..bef27a8 100644 (file)
-The makefile is  for ppc-morphos-gcc-2.95.3-bin.tgz (gcc 2.95.3 hosted
-on       68k-Amiga      producing       MorphOS-PPC-binaries      from
-http://www.morphos.de).  To  use it, type "make  assign", then "make";
-it produces a link library libft2_ppc.a.
+
+README for the builds/amiga subdirectory.
+
+Copyright 2005 by
+Werner Lemberg and Detlef Würkner.
+
+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 makefile.os4 is for the AmigaOS4 SDK.  To use it, type
+"make -f makefile.os4", it produces a link library libft2_ppc.a.
+
+The makefile is for ppc-morphos-gcc-2.95.3-bin.tgz (gcc 2.95.3 hosted on
+68k-Amiga producing MorphOS-PPC-binaries from http://www.morphos.de).
+To use it, type "make assign", then "make"; it produces a link library
+libft2_ppc.a.
 
 The smakefile is a makefile for Amiga SAS/C 6.58 (no longer available,
-latest sold version was 6.50, updates  can be found in Aminet).  It is
-based on the version found  in the sourcecode of ttf.library 0.83b for
-FreeType   1.3.1    from   Richard   Griffith   (ragriffi@sprynet.com,
+latest sold version was 6.50, updates can be found in Aminet).  It is
+based on the version found in the sourcecode of ttf.library 0.83b for
+FreeType 1.3.1 from Richard Griffith (ragriffi@sprynet.com,
 http://ragriffi.home.sprynet.com).
 
-You will  also need  the latest include  files and amiga.lib  from the
-Amiga  web   site  (http://www.amiga.com/3.9/download/NDK3.9.lha)  for
+You will also need the latest include files and amiga.lib from the
+Amiga web site (http://www.amiga.com/3.9/download/NDK3.9.lha) for
 AmigaOS 3.9; the generated code should work under AmigaOS 2.04 and up.
 
-To use it, call "smake  assign" and then "smake" from the builds/amiga
+To use it, call "smake assign" and then "smake" from the builds/amiga
 directory.  The results are:
 
-- A link  library "ft2_680x0.lib" (where  x depends on the  setting of
-  the  CPU entry  in  the smakefile)  containing  all FreeType2  parts
-  except of  the init code,  debugging code, and the  system interface
+- A link library "ft2_680x0.lib" (where x depends on the setting of
+  the CPU entry in the smakefile) containing all FreeType2 parts
+  except of the init code, debugging code, and the system interface
   code.
 
-- ftsystem.o, an object module  containing the standard version of the
-  system interface  code which  uses fopen() fclose()  fread() fseek()
+- ftsystem.o, an object module containing the standard version of the
+  system interface code which uses fopen() fclose() fread() fseek()
   ftell() malloc() realloc() and free() from lib:sc.lib (not pure).
 
-- ftsystempure.o, an object module  containing the pure version of the
-  system  interface  code  which  uses Open()  Close()  Read()  Seek()
-  ExamineFH() AsmAllocPooled() AsmFreePooled()  etc.  This version can
-  be used in both normal  programs and in Amiga run-time shared system
-  librarys (can be  linked with lib:libinit.o, no copying  of DATA and
-  BSS  hunks for  each OpenLibrary()  necessary).  Source  code  is in
+- ftsystempure.o, an object module containing the pure version of the
+  system interface code which uses Open() Close() Read() Seek()
+  ExamineFH() AsmAllocPooled() AsmFreePooled() etc.  This version can
+  be used in both normal programs and in Amiga run-time shared system
+  librarys (can be linked with lib:libinit.o, no copying of DATA and
+  BSS hunks for each OpenLibrary() necessary).  Source code is in
   src/base/ftsystem.c.
 
-- 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
+- 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().
 
-- ftdebugpure.o, an  object module containing the pure  version of the
-  debugging  code  which uses  KVPrintf()  from  lib:debug.lib and  no
-  exit().  For  debugging of  Amiga run-time shared  system libraries.
+- ftdebugpure.o, an object module containing the pure version of the
+  debugging code which uses KVPrintf() from lib:debug.lib and no
+  exit().  For debugging of Amiga run-time shared system libraries. 
   Source code is in src/base/ftdebug.c.
 
-- NO ftinit.o.   Since linking  with a link  library should  result in
-  linking  only  the  needed   object  modules  in  it,  but  standard
-  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
+- NO ftinit.o.  Because linking with a link library should result in
+  linking only the needed object modules in it, but standard
+  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.
 
 
 To use in your own programs:
 
-- Insert   the   #define  and   #include   statements   from  top   of
+- 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.
 
-- You  can  use  either  PARAMETERS=REGISTER or  PARAMETERS=STACK  for
-  calling  the FreeType2  functions, since  the link  library  and the
+- You can use either PARAMETERS=REGISTER or PARAMETERS=STACK for
+  calling the FreeType2 functions, because the link library and the
   object files are compiled with PARAMETERS=BOTH.
 
 - "smake assign" (assign "FT:" to the FreeType2 main directory).
 
 - Compile your program.
 
-- Link with either ftsystem.o  or ftsystempure.o, if debugging enabled
+- Link with either ftsystem.o or ftsystempure.o, if debugging enabled
   with either ftdebug.o or (ftdebugpure.o and lib:debug.lib), and with
   ft2_680x0.lib as link library.
 
 
 To adapt to other compilers:
 
-- The standard ANSI  C maximum length of 31  significant characters in
+- The standard ANSI C maximum length of 31 significant characters in
   identifiers is not enough for FreeType2.  Check if your compiler has
-  a minimum length of 40  significant characters or can be switched to
-  it.   "idlen=40"   is  the   option  for  SAS/C.    Setting  #define
+  a minimum length of 40 significant characters or can be switched to
+  it.  "idlen=40" is the option for SAS/C.  Setting #define
   HAVE_LIMIT_ON_IDENTS in an include file may also work (not tested).
 
-- Make  sure that the  include directory  in builds/amiga  is searched
-  before the  normal FreeType2 include  directory, so you are  able to
+- Make sure that the include directory in builds/amiga is searched
+  before the normal FreeType2 include directory, so you are able to
   replace problematic include files with your own version (same may be
   useful for the src directory).
 
-- An example  of how to replace/workaround a  problematic include file
-  is  include/config/ftconfig.h;  it  changes  a  #define  that  would
-  prevent SAS/C  from generating  XDEF's where it  should do  that and
+- An example of how to replace/workaround a problematic include file
+  is include/config/ftconfig.h; it changes a #define that would
+  prevent SAS/C from generating XDEF's where it should do that and
   then includes the standard FreeType2 include file.
+
+Local Variables:
+coding: latin-1
+End:
index 9c6ff45..23d2eda 100644 (file)
@@ -1,20 +1,59 @@
-// TetiSoft: We must change FT_BASE_DEF and FT_EXPORT_DEF
+/***************************************************************************/
+/*                                                                         */
+/*  ftconfig.h                                                             */
+/*                                                                         */
+/*    Amiga-specific configuration file (specification only).              */
+/*                                                                         */
+/*  Copyright 2005 by                                                      */
+/*  Werner Lemberg and Detlef Würkner.                                     */
+/*                                                                         */
+/*  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 an example how to override the default FreeType2 header files
+ * with Amiga-specific changes. When the compiler searches this directory
+ * before the default directory, we can do some modifications.
+ *
+ * Here we must change FT_BASE_DEF and FT_EXPORT_DEF so that SAS/C does
+ * generate the needed XDEFs.
+ */
+
+#if 0
+#define FT_BASE_DEF( x )  extern  x
+#define FT_EXPORT_DEF( x )  extern  x
+#endif
 
-//#define FT_BASE_DEF( x )  extern  x   // SAS/C wouldn't generate an XDEF
-//#define FT_EXPORT_DEF( x )  extern  x // SAS/C wouldn't generate an XDEF
 #undef FT_BASE_DEF
 #define FT_BASE_DEF( x )  x
+
 #undef FT_EXPORT_DEF
 #define FT_EXPORT_DEF( x )  x
 
-// TetiSoft: now include original file
+/* Now include the original file */
 #ifndef __MORPHOS__
+#ifdef __SASC
 #include "FT:include/freetype/config/ftconfig.h"
 #else
-// We must define that, it seems that
-// lib/gcc-lib/ppc-morphos/2.95.3/include/syslimits.h is missing in 
-// ppc-morphos-gcc-2.95.3-bin.tgz (gcc for 68k producing MorphOS PPC elf
-// binaries from http://www.morphos.de)
+#include "/FT/include/freetype/config/ftconfig.h"
+#endif
+#else
+/* We must define that, it seems that
+ * lib/gcc-lib/ppc-morphos/2.95.3/include/syslimits.h is missing in 
+ * ppc-morphos-gcc-2.95.3-bin.tgz (gcc for 68k producing MorphOS PPC elf
+ * binaries from http://www.morphos.de)
+ */
 #define _LIBC_LIMITS_H_
 #include "/FT/include/freetype/config/ftconfig.h"
 #endif
+
+/*
+Local Variables:
+coding: latin-1
+End:
+*/
index d7bc9cb..59a188a 100644 (file)
@@ -1,24 +1,46 @@
-// TetiSoft: To specify which modules you need,
-// insert the following in your source file and uncomment as needed:
+/***************************************************************************/
+/*                                                                         */
+/*  ftmodule.h                                                             */
+/*                                                                         */
+/*    Amiga-specific FreeType module selection.                            */
+/*                                                                         */
+/*  Copyright 2005 by                                                      */
+/*  Werner Lemberg and Detlef Würkner.                                     */
+/*                                                                         */
+/*  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.                                        */
+/*                                                                         */
+/***************************************************************************/
 
 /*
-//#define FT_USE_AUTOHINT       // autohinter
-//#define FT_USE_RASTER         // monochrome rasterizer
-//#define FT_USE_SMOOTH         // anti-aliasing rasterizer
-//#define FT_USE_TT             // truetype font driver
-//#define FT_USE_T1             // type1 font driver
-//#define FT_USE_T42            // type42 font driver
-//#define FT_USE_T1CID          // cid-keyed type1 font driver  // no cmap support
-//#define FT_USE_CFF            // opentype font driver
-//#define FT_USE_BDF            // bdf bitmap font driver
-//#define FT_USE_PCF            // pcf bitmap font driver
-//#define FT_USE_PFR            // pfr font driver
-//#define FT_USE_WINFNT         // windows .fnt|.fon bitmap font driver
+ * To avoid that all your programs include all FreeType modules,
+ * you copy the following piece of source code into your own
+ * source file and specify which modules you really need in your
+ * application by uncommenting the appropriate lines.
+ */
+/*
+//#define FT_USE_AUTOFIT // autofitter
+//#define FT_USE_RASTER  // monochrome rasterizer
+//#define FT_USE_SMOOTH  // anti-aliasing rasterizer
+//#define FT_USE_TT      // truetype font driver
+//#define FT_USE_T1      // type1 font driver
+//#define FT_USE_T42     // type42 font driver
+//#define FT_USE_T1CID   // cid-keyed type1 font driver  // no cmap support
+//#define FT_USE_CFF     // opentype font driver
+//#define FT_USE_BDF     // bdf bitmap font driver
+//#define FT_USE_PCF     // pcf bitmap font driver
+//#define FT_USE_PFR     // pfr font driver
+//#define FT_USE_WINFNT  // windows .fnt|.fon bitmap font driver
+//#define FT_USE_OTV     // opentype validator
 #include "FT:src/base/ftinit.c"
 */
 
-// TetiSoft: make sure that needed support modules are built in.
-// Dependencies can be found by searching for FT_Get_Module.
+/* Make sure that the needed support modules are built in.
+ * Dependencies can be found by searching for FT_Get_Module.
+ */
 
 #ifdef FT_USE_T42
 #define FT_USE_TT
 #define FT_USE_PSNAMES
 #endif
 
-// TetiSoft: Now include the modules
+/* Now include the modules */
 
-#ifdef FT_USE_AUTOHINT
-FT_USE_MODULE(autohint_module_class)
+#ifdef FT_USE_AUTOFIT
+FT_USE_MODULE(autofit_module_class)
 #endif
 
-#ifdef FT_USE_PSHINT
-FT_USE_MODULE(pshinter_module_class)
+#ifdef FT_USE_TT
+FT_USE_MODULE(tt_driver_class)
+#endif
+
+#ifdef FT_USE_T1
+FT_USE_MODULE(t1_driver_class)
 #endif
 
 #ifdef FT_USE_CFF
@@ -72,16 +98,20 @@ FT_USE_MODULE(cff_driver_class)
 FT_USE_MODULE(t1cid_driver_class)
 #endif
 
-#ifdef FT_USE_BDF
-FT_USE_MODULE(bdf_driver_class)
+#ifdef FT_USE_PFR
+FT_USE_MODULE(pfr_driver_class)
 #endif
 
-#ifdef FT_USE_PCF
-FT_USE_MODULE(pcf_driver_class)
+#ifdef FT_USE_T42
+FT_USE_MODULE(t42_driver_class)
 #endif
 
-#ifdef FT_USE_PFR
-FT_USE_MODULE(pfr_driver_class)
+#ifdef FT_USE_WINFNT
+FT_USE_MODULE(winfnt_driver_class)
+#endif
+
+#ifdef FT_USE_PCF
+FT_USE_MODULE(pcf_driver_class)
 #endif
 
 #ifdef FT_USE_PSAUX
@@ -92,6 +122,10 @@ FT_USE_MODULE(psaux_module_class)
 FT_USE_MODULE(psnames_module_class)
 #endif
 
+#ifdef FT_USE_PSHINT
+FT_USE_MODULE(pshinter_module_class)
+#endif
+
 #ifdef FT_USE_RASTER
 FT_USE_MODULE(ft_raster1_renderer_class)
 #endif
@@ -106,18 +140,16 @@ FT_USE_MODULE(ft_smooth_lcd_renderer_class)
 FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
 #endif
 
-#ifdef FT_USE_TT
-FT_USE_MODULE(tt_driver_class)
-#endif
-
-#ifdef FT_USE_T1
-FT_USE_MODULE(t1_driver_class)
+#ifdef FT_USE_OTV
+FT_USE_MODULE(otv_module_class)
 #endif
 
-#ifdef FT_USE_T42
-FT_USE_MODULE(t42_driver_class)
+#ifdef FT_USE_BDF
+FT_USE_MODULE(bdf_driver_class)
 #endif
 
-#ifdef FT_USE_WINFNT
-FT_USE_MODULE(winfnt_driver_class)
-#endif
+/*
+Local Variables:
+coding: latin-1
+End:
+*/
diff --git a/reactos/lib/freetype/builds/amiga/makefile b/reactos/lib/freetype/builds/amiga/makefile
new file mode 100644 (file)
index 0000000..adb2878
--- /dev/null
@@ -0,0 +1,265 @@
+#\r
+# Makefile for FreeType2 link library using ppc-morphos-gcc-2.95.3-bin.tgz\r
+# (gcc 2.95.3 hosted on 68k-Amiga producing MorphOS-PPC-binaries from\r
+# http://www.morphos.de)\r
+#\r
+\r
+\r
+# Copyright 2005 by\r
+# Werner Lemberg and Detlef Würkner.\r
+#\r
+# This file is part of the FreeType project, and may only be used, modified,\r
+# and distributed under the terms of the FreeType project license,\r
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\r
+# indicate that you have read the license and understand and accept it\r
+# fully.\r
+\r
+\r
+#\r
+# to build from the builds/amiga directory call\r
+#\r
+#  make assign\r
+#  make\r
+#\r
+# Your programs source code should start with this\r
+# (uncomment the parts you do not need to keep the program small):\r
+# ---8<---\r
+#define FT_USE_AUTOFIT // autofitter\r
+#define FT_USE_RASTER  // monochrome rasterizer\r
+#define FT_USE_SMOOTH  // anti-aliasing rasterizer\r
+#define FT_USE_TT      // truetype font driver\r
+#define FT_USE_T1      // type1 font driver\r
+#define FT_USE_T42     // type42 font driver\r
+#define FT_USE_T1CID   // cid-keyed type1 font driver\r
+#define FT_USE_CFF     // opentype font driver\r
+#define FT_USE_BDF     // bdf bitmap font driver\r
+#define FT_USE_PCF     // pcf bitmap font driver\r
+#define FT_USE_PFR     // pfr font driver\r
+#define FT_USE_WINFNT  // windows .fnt|.fon bitmap font driver\r
+#define FT_USE_OTV     // opentype validator\r
+#include "FT:src/base/ftinit.c"\r
+# ---8<---\r
+#\r
+# link your programs with libft2_ppc.a and either ftsystem.ppc.o or ftsystempure.ppc.o\r
+# (and either ftdebug.ppc.o or ftdebugpure.ppc.o if you enabled FT_DEBUG_LEVEL_ERROR or\r
+# FT_DEBUG_LEVEL_TRACE in include/freetype/config/ftoption.h).\r
+\r
+all:   libft2_ppc.a ftsystem.ppc.o ftsystempure.ppc.o\r
+\r
+assign:\r
+       assign FT: //\r
+\r
+FTSRC = /FT/src\r
+\r
+CC =     ppc-morphos-gcc\r
+AR =     ppc-morphos-ar rc\r
+RANLIB = ppc-morphos-ranlib\r
+LD =     ppc-morphos-ld\r
+CFLAGS = -O2 -I/emu/emulinclude/includegcc -I/emu/include -Iinclude -I$(FTSRC) -I/FT/include\r
+\r
+#\r
+# FreeType2 library base\r
+#\r
+ftbase.ppc.o: $(FTSRC)/base/ftbase.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftinit.ppc.o: $(FTSRC)/base/ftinit.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftsystem.ppc.o: $(FTSRC)/base/ftsystem.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+# pure version for use in run-time library etc\r
+ftsystempure.ppc.o: src/base/ftsystem.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftdebug.ppc.o: $(FTSRC)/base/ftdebug.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+# pure version for use in run-time library etc\r
+ftdebugpure.ppc.o: src/base/ftdebug.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library base extensions\r
+#\r
+ftbbox.ppc.o: $(FTSRC)/base/ftbbox.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftbdf.ppc.o: $(FTSRC)/base/ftbdf.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftbitmap.ppc.o: $(FTSRC)/base/ftbitmap.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftglyph.ppc.o: $(FTSRC)/base/ftglyph.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftmm.ppc.o: $(FTSRC)/base/ftmm.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftotval.ppc.o: $(FTSRC)/base/ftotval.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftpfr.ppc.o: $(FTSRC)/base/ftpfr.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftstroke.ppc.o: $(FTSRC)/base/ftstroke.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftsynth.ppc.o: $(FTSRC)/base/ftsynth.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+fttype1.ppc.o: $(FTSRC)/base/fttype1.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftwinfnt.ppc.o: $(FTSRC)/base/ftwinfnt.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+ftxf86.ppc.o: $(FTSRC)/base/ftxf86.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library autofitting module\r
+#\r
+autofit.ppc.o: $(FTSRC)/autofit/autofit.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library postscript hinting module\r
+#\r
+pshinter.ppc.o: $(FTSRC)/pshinter/pshinter.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library PS support module\r
+#\r
+psaux.ppc.o: $(FTSRC)/psaux/psaux.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library PS glyph names module\r
+#\r
+psnames.ppc.o: $(FTSRC)/psnames/psnames.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library monochrome raster module\r
+#\r
+raster.ppc.o: $(FTSRC)/raster/raster.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library anti-aliasing raster module\r
+#\r
+smooth.ppc.o: $(FTSRC)/smooth/smooth.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library 'sfnt' module\r
+#\r
+sfnt.ppc.o: $(FTSRC)/sfnt/sfnt.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library glyph and image caching system\r
+#\r
+ftcache.ppc.o: $(FTSRC)/cache/ftcache.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library OpenType font driver\r
+#\r
+cff.ppc.o: $(FTSRC)/cff/cff.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library TrueType font driver\r
+#\r
+truetype.ppc.o: $(FTSRC)/truetype/truetype.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library Type1 font driver\r
+#\r
+type1.ppc.o: $(FTSRC)/type1/type1.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library Type42 font driver\r
+#\r
+type42.ppc.o: $(FTSRC)/type42/type42.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library CID-keyed Type1 font driver\r
+#\r
+type1cid.ppc.o: $(FTSRC)/cid/type1cid.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library BDF bitmap font driver\r
+#\r
+bdf.ppc.o: $(FTSRC)/bdf/bdf.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library PCF bitmap font driver\r
+#\r
+pcf.ppc.o: $(FTSRC)/pcf/pcf.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library gzip support for compressed PCF bitmap fonts\r
+#\r
+gzip.ppc.o: $(FTSRC)/gzip/ftgzip.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library compress support for compressed PCF bitmap fonts\r
+#\r
+lzw.ppc.o: $(FTSRC)/lzw/ftlzw.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library PFR font driver\r
+#\r
+pfr.ppc.o: $(FTSRC)/pfr/pfr.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library Windows FNT/FON bitmap font driver\r
+#\r
+winfnt.ppc.o: $(FTSRC)/winfonts/winfnt.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+#\r
+# FreeType2 library OpenType validator\r
+#\r
+otvalid.ppc.o: $(FTSRC)/otvalid/otvalid.c\r
+       $(CC) -c $(CFLAGS) -o $@ $<\r
+\r
+BASEPPC = ftbase.ppc.o ftbbox.ppc.o ftbdf.ppc.o ftbitmap.ppc.o ftglyph.ppc.o \\r
+         ftmm.ppc.o ftotval.ppc.o ftpfr.ppc.o ftstroke.ppc.o ftsynth.ppc.o \\r
+         fttype1.ppc.o ftwinfnt.ppc.o ftxf86.ppc.o\r
+\r
+DEBUGPPC = ftdebug.ppc.o ftdebugpure.ppc.o\r
+\r
+AFITPPC = autofit.ppc.o\r
+\r
+OTVPPC = otvalid.ppc.o\r
+\r
+PSPPC = psaux.ppc.o psnames.ppc.o pshinter.ppc.o\r
+\r
+RASTERPPC = raster.ppc.o smooth.ppc.o\r
+\r
+FONTDPPC = cff.ppc.o type1.ppc.o type42.ppc.o type1cid.ppc.o truetype.ppc.o\\r
+          bdf.ppc.o pcf.ppc.o pfr.ppc.o winfnt.ppc.o\r
+\r
+libft2_ppc.a:    $(BASEPPC) $(AFITPPC) $(OTVPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) gzip.ppc.o lzw.ppc.o\r
+       $(AR) $@ $(BASEPPC) $(AFITPPC) $(OTVPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) gzip.ppc.o lzw.ppc.o\r
+       -@ ($(RANLIB) $@ || true) >/dev/null 2>&1\r
+\r
+#Local Variables:\r
+#coding: latin-1\r
+#End:\r
diff --git a/reactos/lib/freetype/builds/amiga/makefile.os4 b/reactos/lib/freetype/builds/amiga/makefile.os4
new file mode 100644 (file)
index 0000000..9cb388f
--- /dev/null
@@ -0,0 +1,270 @@
+#\r
+# Makefile for FreeType2 link library using gcc 3.4.3 from the\r
+# AmigaOS4 SDK\r
+#\r
+\r
+\r
+# Copyright 2005 by\r
+# Werner Lemberg and Detlef Würkner.\r
+#\r
+# This file is part of the FreeType project, and may only be used, modified,\r
+# and distributed under the terms of the FreeType project license,\r
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\r
+# indicate that you have read the license and understand and accept it\r
+# fully.\r
+\r
+\r
+# to build from the builds/amiga directory call\r
+#\r
+#  make\r
+#\r
+# Your programs source code should start with this\r
+# (uncomment the parts you do not need to keep the program small):\r
+# ---8<---\r
+#define FT_USE_AUTOFIT // autofitter\r
+#define FT_USE_RASTER  // monochrome rasterizer\r
+#define FT_USE_SMOOTH  // anti-aliasing rasterizer\r
+#define FT_USE_TT      // truetype font driver\r
+#define FT_USE_T1      // type1 font driver\r
+#define FT_USE_T42     // type42 font driver\r
+#define FT_USE_T1CID   // cid-keyed type1 font driver\r
+#define FT_USE_CFF     // opentype font driver\r
+#define FT_USE_BDF     // bdf bitmap font driver\r
+#define FT_USE_PCF     // pcf bitmap font driver\r
+#define FT_USE_PFR     // pfr font driver\r
+#define FT_USE_WINFNT  // windows .fnt|.fon bitmap font driver\r
+#define FT_USE_OTV     // opentype validator\r
+#include "FT:src/base/ftinit.c"\r
+# ---8<---\r
+#\r
+# link your programs with libft2_ppc.a and either ftsystem.ppc.o or ftsystempure.ppc.o\r
+# (and either ftdebug.ppc.o or ftdebugpure.ppc.o if you enabled FT_DEBUG_LEVEL_ERROR or\r
+# FT_DEBUG_LEVEL_TRACE in include/freetype/config/ftoption.h).\r
+\r
+all:   assign libft2_ppc.a ftsystem.ppc.o ftsystempure.ppc.o\r
+\r
+assign:\r
+       assign FT: //\r
+\r
+CC =     ppc-amigaos-gcc\r
+AR =     ppc-amigaos-ar\r
+RANLIB = ppc-amigaos-ranlib\r
+\r
+DIRFLAGS  = -Iinclude -I/FT/src -I/FT/include -I/SDK/include\r
+\r
+WARNINGS = -Wall -W -Wundef -Wpointer-arith -Wbad-function-cast \\r
+          -Waggregate-return -Wshadow\r
+\r
+CPU      = -mcpu=604e\r
+\r
+OPTIONS  = -DNDEBUG -fno-builtin\r
+OPTIMIZE = -O2 -fomit-frame-pointer -fstrength-reduce -finline-functions\r
+\r
+CFLAGS   = $(DIRFLAGS) $(WARNINGS) $(FT2FLAGS) $(CPU) $(OPTIONS) $(OPTIMIZE)\r
+\r
+#\r
+# FreeType2 library base\r
+#\r
+ftbase.ppc.o: FT:src/base/ftbase.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftbase.c\r
+\r
+ftinit.ppc.o: FT:src/base/ftinit.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftinit.c\r
+\r
+ftsystem.ppc.o: FT:src/base/ftsystem.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftsystem.c\r
+\r
+# pure version for use in run-time library etc\r
+ftsystempure.ppc.o: src/base/ftsystem.c\r
+       $(CC) -c $(CFLAGS) -o $@ src/base/ftsystem.c\r
+\r
+#\r
+# FreeType2 library base extensions\r
+#\r
+ftbbox.ppc.o: FT:src/base/ftbbox.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftbbox.c\r
+\r
+ftbdf.ppc.o: FT:src/base/ftbdf.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftbdf.c\r
+\r
+ftbitmap.ppc.o: FT:src/base/ftbitmap.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftbitmap.c\r
+\r
+ftdebug.ppc.o: FT:src/base/ftdebug.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftdebug.c\r
+\r
+# pure version for use in run-time library etc\r
+ftdebugpure.ppc.o: src/base/ftdebug.c\r
+       $(CC) -c $(CFLAGS) -o $@ src/base/ftdebug.c\r
+\r
+ftglyph.ppc.o: FT:src/base/ftglyph.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftglyph.c\r
+\r
+ftmm.ppc.o: FT:src/base/ftmm.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftmm.c\r
+\r
+ftotval.ppc.o: FT:src/base/ftotval.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftotval.c\r
+\r
+ftpfr.ppc.o: FT:src/base/ftpfr.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftpfr.c\r
+\r
+ftstroke.ppc.o: FT:src/base/ftstroke.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftstroke.c\r
+\r
+ftsynth.ppc.o: FT:src/base/ftsynth.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftsynth.c\r
+\r
+fttype1.ppc.o: FT:src/base/fttype1.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/fttype1.c\r
+\r
+ftwinfnt.ppc.o: FT:src/base/ftwinfnt.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftwinfnt.c\r
+\r
+ftxf86.ppc.o: FT:src/base/ftxf86.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftxf86.c\r
+\r
+#\r
+# FreeType2 library autofitting module\r
+#\r
+autofit.ppc.o: FT:src/autofit/autofit.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/autofit/autofit.c\r
+\r
+#\r
+# FreeType2 library postscript hinting module\r
+#\r
+pshinter.ppc.o: FT:src/pshinter/pshinter.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/pshinter/pshinter.c\r
+\r
+#\r
+# FreeType2 library PS support module\r
+#\r
+psaux.ppc.o: FT:src/psaux/psaux.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/psaux/psaux.c\r
+\r
+#\r
+# FreeType2 library PS glyph names module\r
+#\r
+psnames.ppc.o: FT:src/psnames/psnames.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/psnames/psnames.c\r
+\r
+#\r
+# FreeType2 library monochrome raster module\r
+#\r
+raster.ppc.o: FT:src/raster/raster.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/raster/raster.c\r
+\r
+#\r
+# FreeType2 library anti-aliasing raster module\r
+#\r
+smooth.ppc.o: FT:src/smooth/smooth.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/smooth/smooth.c\r
+\r
+#\r
+# FreeType2 library 'sfnt' module\r
+#\r
+sfnt.ppc.o: FT:src/sfnt/sfnt.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/sfnt/sfnt.c\r
+\r
+#\r
+# FreeType2 library glyph and image caching system\r
+#\r
+ftcache.ppc.o: FT:src/cache/ftcache.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/cache/ftcache.c\r
+\r
+#\r
+# FreeType2 library OpenType font driver\r
+#\r
+cff.ppc.o: FT:src/cff/cff.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/cff/cff.c\r
+\r
+#\r
+# FreeType2 library TrueType font driver\r
+#\r
+truetype.ppc.o: FT:src/truetype/truetype.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/truetype/truetype.c\r
+\r
+#\r
+# FreeType2 library Type1 font driver\r
+#\r
+type1.ppc.o: FT:src/type1/type1.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/type1/type1.c\r
+\r
+#\r
+# FreeType2 library Type42 font driver\r
+#\r
+type42.ppc.o: FT:src/type42/type42.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/type42/type42.c\r
+\r
+#\r
+# FreeType2 library CID-keyed Type1 font driver\r
+#\r
+type1cid.ppc.o: FT:src/cid/type1cid.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/cid/type1cid.c\r
+\r
+#\r
+# FreeType2 library BDF bitmap font driver\r
+#\r
+bdf.ppc.o: FT:src/bdf/bdf.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/bdf/bdf.c\r
+\r
+#\r
+# FreeType2 library PCF bitmap font driver\r
+#\r
+pcf.ppc.o: FT:src/pcf/pcf.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/pcf/pcf.c\r
+\r
+#\r
+# FreeType2 library gzip support for compressed PCF bitmap fonts\r
+#\r
+gzip.ppc.o: FT:src/gzip/ftgzip.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/gzip/ftgzip.c\r
+\r
+#\r
+# FreeType2 library compress support for compressed PCF bitmap fonts\r
+#\r
+lzw.ppc.o: FT:src/lzw/ftlzw.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/lzw/ftlzw.c\r
+\r
+#\r
+# FreeType2 library PFR font driver\r
+#\r
+pfr.ppc.o: FT:src/pfr/pfr.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/pfr/pfr.c\r
+\r
+#\r
+# FreeType2 library Windows FNT/FON bitmap font driver\r
+#\r
+winfnt.ppc.o: FT:src/winfonts/winfnt.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/winfonts/winfnt.c\r
+\r
+#\r
+# FreeType2 library OpenType validator\r
+#\r
+otvalid.ppc.o: FT:src/otvalid/otvalid.c\r
+       $(CC) -c $(CFLAGS) -o $@ /FT/src/otvalid/otvalid.c\r
+\r
+BASE =  ftbase.ppc.o ftbbox.ppc.o ftbdf.ppc.o ftbitmap.ppc.o ftglyph.ppc.o \\r
+       ftmm.ppc.o ftotval.ppc.o ftpfr.ppc.o ftstroke.ppc.o ftsynth.ppc.o \\r
+       fttype1.ppc.o ftwinfnt.ppc.o ftxf86.ppc.o\r
+\r
+DEBUG = ftdebug.ppc.o ftdebugpure.ppc.o\r
+\r
+AFIT = autofit.ppc.o\r
+\r
+OTV = otvalid.ppc.o\r
+\r
+PS = psaux.ppc.o psnames.ppc.o pshinter.ppc.o\r
+\r
+RASTER = raster.ppc.o smooth.ppc.o\r
+\r
+FONTD = cff.ppc.o type1.ppc.o type42.ppc.o type1cid.ppc.o truetype.ppc.o\\r
+       bdf.ppc.o pcf.ppc.o pfr.ppc.o winfnt.ppc.o\r
+\r
+libft2_ppc.a:      $(BASE) $(AFIT) $(OTV) $(PS) $(RASTER) sfnt.ppc.o ftcache.ppc.o $(FONTD) gzip.ppc.o lzw.ppc.o\r
+       $(AR) r $@ $(BASE) $(AFIT) $(OTV) $(PS) $(RASTER) sfnt.ppc.o ftcache.ppc.o $(FONTD) gzip.ppc.o lzw.ppc.o\r
+       $(RANLIB) $@\r
+\r
+#Local Variables:\r
+#coding: latin-1\r
+#End:\r
index c8b3e6c..1d7a2d7 100644 (file)
@@ -1,6 +1,18 @@
 #
 # Makefile for FreeType2 link library using Amiga SAS/C 6.58
 #
+
+
+# Copyright 2005 by
+# Werner Lemberg and Detlef Würkner.
+#
+# 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.
+
+
 # to build from the builds/amiga directory call
 #
 #  smake assign
 # Your programs source code should start with this
 # (uncomment the parts you do not need to keep the program small):
 # ---8<---
-#define FT_USE_AUTOHINT // autohinter
-#define FT_USE_RASTER   // monochrome rasterizer
-#define FT_USE_SMOOTH   // anti-aliasing rasterizer
-#define FT_USE_TT       // truetype font driver
-#define FT_USE_T1       // type1 font driver
-#define FT_USE_T42      // type42 font driver
-#define FT_USE_T1CID    // cid-keyed type1 font driver
-#define FT_USE_CFF      // opentype font driver
-#define FT_USE_BDF      // bdf bitmap font driver
-#define FT_USE_PCF      // pcf bitmap font driver
-#define FT_USE_PFR      // pfr font driver
-#define FT_USE_WINFNT   // windows .fnt|.fon bitmap font driver
+#define FT_USE_AUTOFIT // autofitter
+#define FT_USE_RASTER  // monochrome rasterizer
+#define FT_USE_SMOOTH  // anti-aliasing rasterizer
+#define FT_USE_TT      // truetype font driver
+#define FT_USE_T1      // type1 font driver
+#define FT_USE_T42     // type42 font driver
+#define FT_USE_T1CID   // cid-keyed type1 font driver
+#define FT_USE_CFF     // opentype font driver
+#define FT_USE_BDF     // bdf bitmap font driver
+#define FT_USE_PCF     // pcf bitmap font driver
+#define FT_USE_PFR     // pfr font driver
+#define FT_USE_WINFNT  // windows .fnt|.fon bitmap font driver
+#define FT_USE_OTV     // opentype validator
 #include "FT:src/base/ftinit.c"
 # ---8<---
 #
 # (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).
 
-OBJBASE = ftbase.o ftglyph.o ftbbox.o ftmm.o ftsynth.o
+OBJBASE = ftbase.o ftbbox.o ftbdf.o ftbitmap.o ftglyph.o ftmm.o ftotval.o \
+         ftpfr.o ftstroke.o ftsynth.o fttype1.o ftwinfnt.o ftxf86.o
 
 OBJSYSTEM = ftsystem.o ftsystempure.o
 
 OBJDEBUG = ftdebug.o ftdebugpure.o
 
-OBJAHINT = autohint.o ahoptim.o
+OBJAFIT = autofit.o
 
-OBJPSHINT = pshinter.o
+OBJOTV = otvalid.o
 
-OBJPSAUX = psaux.o
+OBJPS = psaux.o psnames.o pshinter.o
 
-OBJPSNAM = psnames.o
-
-OBJRAST = raster.o
-
-OBJSMOOTH = smooth.o
+OBJRASTER = raster.o smooth.o
 
 OBJSFNT = sfnt.o
 
 OBJCACHE = ftcache.o
 
-OBJPS = $(OBJPSAUX) $(OBJPSNAM) $(OBJPSHINT)
-
-OBJRASTER = $(OBJRAST) $(OBJSMOOTH)
-
 OBJFONTD = cff.o type1.o type42.o type1cid.o\
           truetype.o winfnt.o bdf.o pcf.o pfr.o
 
@@ -88,8 +94,8 @@ assign:
 
 # uses separate object modules in lib to make for easier debugging
 # also, can make smaller programs if entire engine is not used
-ft2_$(CPU).lib:  $(OBJBASE) $(OBJAHINT) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD)
-       oml $@ r $(OBJBASE) $(OBJAHINT) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD)
+ft2_$(CPU).lib:  $(OBJBASE) $(OBJAFIT) $(OBJOTV) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) lzw.o # gzip.o
+       oml $@ r $(OBJBASE) $(OBJAFIT) $(OBJOTV) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) lzw.o
 
 clean:
        -delete \#?.o
@@ -115,24 +121,35 @@ ftdebugpure.o: src/base/ftdebug.c ## pure version for use in run-time library et
 #
 # freetype library base extensions
 #
-ftglyph.o: $(CORE)base/ftglyph.c
-       sc $(SCFLAGS) objname=$@ $<
 ftbbox.o: $(CORE)base/ftbbox.c
        sc $(SCFLAGS) objname=$@ $<
+ftbdf.o: $(CORE)base/ftbdf.c
+       sc $(SCFLAGS) objname=$@ $<
+ftbitmap.o: $(CORE)base/ftbitmap.c
+       sc $(SCFLAGS) objname=$@ $<
+ftglyph.o: $(CORE)base/ftglyph.c
+       sc $(SCFLAGS) objname=$@ $<
 ftmm.o: $(CORE)base/ftmm.c
        sc $(SCFLAGS) objname=$@ $<
+ftotval.o: $(CORE)base/ftotval.c
+       sc $(SCFLAGS) objname=$@ $<
+ftpfr.o: $(CORE)base/ftpfr.c
+       sc $(SCFLAGS) objname=$@ $<
+ftstroke.o: $(CORE)base/ftstroke.c
+       sc $(SCFLAGS) objname=$@ $<
 ftsynth.o: $(CORE)base/ftsynth.c
        sc $(SCFLAGS) objname=$@ $<
-
-#
-# freetype library autohinting module
-#
-autohint.o: $(CORE)autohint/autohint.c
+fttype1.o: $(CORE)base/fttype1.c
+       sc $(SCFLAGS) objname=$@ $<
+ftwinfnt.o: $(CORE)base/ftwinfnt.c
        sc $(SCFLAGS) objname=$@ $<
+ftxf86.o: $(CORE)base/ftxf86.c
+       sc $(SCFLAGS) objname=$@ $<
+
 #
-# freetype library autohinting module extensions
+# freetype library autofitter module
 #
-ahoptim.o: $(CORE)autohint/ahoptim.c
+autofit.o: $(CORE)autofit/autofit.c
        sc $(SCFLAGS) objname=$@ $<
 
 #
@@ -223,6 +240,18 @@ bdf.o: $(CORE)bdf/bdf.c
 pcf.o: $(CORE)pcf/pcf.c
        sc $(SCFLAGS) objname=$@ $<
 
+#
+# freetype library gzip support for compressed PCF bitmap fonts
+#
+gzip.o: $(CORE)gzip/ftgzip.c
+       sc $(SCFLAGS) objname=$@ $<
+
+#
+# freetype library compress support for compressed PCF bitmap fonts
+#
+lzw.o: $(CORE)lzw/ftlzw.c
+       sc $(SCFLAGS) objname=$@ $<
+
 #
 # freetype library PFR font driver
 #
@@ -234,3 +263,13 @@ pfr.o: $(CORE)pfr/pfr.c
 #
 winfnt.o: $(CORE)winfonts/winfnt.c
        sc $(SCFLAGS) objname=$@ $<
+
+#
+# freetype library OpenType validator
+#
+otvalid.o: $(CORE)otvalid/otvalid.c
+       sc $(SCFLAGS) objname=$@ $<
+
+#Local Variables:
+#coding: latin-1
+#End:
index a618687..75cc66d 100644 (file)
@@ -1,14 +1,11 @@
-// TetiSoft: replaced vprintf() with KVPrintF() and commented out exit()
-extern void __stdargs KVPrintF( const char *formatString, const void *values );
-
 /***************************************************************************/
 /*                                                                         */
 /*  ftdebug.c                                                              */
 /*                                                                         */
 /*    Debugging and logging component (body).                              */
 /*                                                                         */
-/*  Copyright 1996-2001 by                                                 */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
+/*  David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner.       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -44,21 +41,38 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
   /*************************************************************************/
 
 
-#include <ft2build.h>
-#include FT_INTERNAL_DEBUG_H
-
-
-#ifdef FT_DEBUG_LEVEL_TRACE
-  char  ft_trace_levels[trace_max];
+/*
+ * 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>
+#include <dos/exall.h>
+#include <dos/var.h>
+#define __NOLIBBASE__
+#define __NOLOBALIFACE__
+#define __USE_INLINE__
+#include <proto/dos.h>
+#include <clib/debug_protos.h>
+
+#ifndef __amigaos4__
+extern struct Library *DOSBase;
+#else
+extern struct DOSIFace *IDOS;
 #endif
 
 
-#if defined( FT_DEBUG_LEVEL_ERROR ) || defined( FT_DEBUG_LEVEL_TRACE )
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_INTERNAL_DEBUG_H
 
 
-#include <stdarg.h>
-#include <stdlib.h>
+#if defined( FT_DEBUG_LEVEL_ERROR )
 
+  /* documentation is in ftdebug.h */
 
   FT_EXPORT_DEF( void )
   FT_Message( const char*  fmt, ... )
@@ -67,12 +81,14 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
 
 
     va_start( ap, fmt );
-//  vprintf( fmt, ap );
+/*  vprintf( fmt, ap ); */
     KVPrintF( fmt, ap );
     va_end( ap );
   }
 
 
+  /* documentation is in ftdebug.h */
+
   FT_EXPORT_DEF( void )
   FT_Panic( const char*  fmt, ... )
   {
@@ -80,29 +96,87 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
 
 
     va_start( ap, fmt );
-//  vprintf( fmt, ap );
+/*  vprintf( fmt, ap ); */
     KVPrintF( fmt, ap );
     va_end( ap );
 
-//  exit( EXIT_FAILURE );
+/*  exit( EXIT_FAILURE ); */
+  }
+
+#endif /* FT_DEBUG_LEVEL_ERROR */
+
+
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+  /* array of trace levels, initialized to 0 */
+  int  ft_trace_levels[trace_count];
+
+
+  /* define array of trace toggle names */
+#define FT_TRACE_DEF( x )  #x ,
+
+  static const char*  ft_trace_toggles[trace_count + 1] =
+  {
+#include FT_INTERNAL_TRACE_H
+    NULL
+  };
+
+#undef FT_TRACE_DEF
+
+
+  /* documentation is in ftdebug.h */
+
+  FT_EXPORT_DEF( FT_Int )
+  FT_Trace_Get_Count( void )
+  {
+    return trace_count;
   }
 
 
+  /* documentation is in ftdebug.h */
+
+  FT_EXPORT_DEF( const char * )
+  FT_Trace_Get_Name( FT_Int  idx )
+  {
+    int  max = FT_Trace_Get_Count();
+
 
-  /* since I don't know wether "getenv" is available on the Amiga */
-  /* I prefer to simply disable this code for now in all builds   */
-  /*                                                              */
+    if ( idx < max )
+      return ft_trace_toggles[idx];
+    else
+      return NULL;
+  }
 
-/* #ifdef FT_DEBUG_LEVEL_TRACE */
-#if 0
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* Initialize the tracing sub-system.  This is done by retrieving the    */
+  /* value of the `FT2_DEBUG' environment variable.  It must be a list of  */
+  /* toggles, separated by spaces, `;', or `,'.  Example:                  */
+  /*                                                                       */
+  /*    export FT2_DEBUG="any:3 memory:7 stream:5"                         */
+  /*                                                                       */
+  /* This requests that all levels be set to 3, except the trace level for */
+  /* 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 */
+  /* available toggle names.                                               */
+  /*                                                                       */
+  /* The level must be between 0 and 7; 0 means quiet (except for serious  */
+  /* runtime errors), and 7 means _very_ verbose.                          */
+  /*                                                                       */
   FT_BASE_DEF( void )
   ft_debug_init( void )
   {
-    const char*  ft2_debug = getenv( "FT2_DEBUG" );
+/*  const char*  ft2_debug = getenv( "FT2_DEBUG" ); */
+    char         buf[256];
+    const char*  ft2_debug = &buf[0];
 
 
-    if ( ft2_debug )
+/*  if ( ft2_debug ) */
+    if ( GetVar( "FT2_DEBUG", (STRPTR)ft2_debug, 256, LV_VAR ) > 0 )
     {
       const char*  p = ft2_debug;
       const char*  q;
@@ -114,15 +188,15 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
         if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' )
           continue;
 
-        /* read toggle name, followed by '=' */
+        /* read toggle name, followed by ':' */
         q = p;
         while ( *p && *p != ':' )
           p++;
 
         if ( *p == ':' && p > q )
         {
-          int  n, i, len = p - q;
-          int  level = -1, found = -1;
+          FT_Int  n, i, len = (FT_Int)( p - q );
+          FT_Int  level = -1, found = -1;
 
 
           for ( n = 0; n < trace_count; n++ )
@@ -148,7 +222,7 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
           if ( *p )
           {
             level = *p++ - '0';
-            if ( level < 0 || level > 6 )
+            if ( level < 0 || level > 7 )
               level = -1;
           }
 
@@ -156,7 +230,7 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
           {
             if ( found == trace_any )
             {
-              /* special case for "any" */
+              /* special case for `any' */
               for ( n = 0; n < trace_count; n++ )
                 ft_trace_levels[n] = level;
             }
@@ -179,7 +253,27 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
   }
 
 
-#endif /* !FT_DEBUG_LEVEL_TRACE */
+  FT_EXPORT_DEF( FT_Int )
+  FT_Trace_Get_Count( void )
+  {
+    return 0;
+  }
+
 
+  FT_EXPORT_DEF( const char * )
+  FT_Trace_Get_Name( FT_Int  idx )
+  {
+    FT_UNUSED( idx );
+
+    return NULL;
+  }
+
+
+#endif /* !FT_DEBUG_LEVEL_TRACE */
 
+/*
+Local Variables:
+coding: latin-1
+End:
+*/
 /* END */
index e76d416..00ee3d5 100644 (file)
@@ -4,8 +4,8 @@
 /*                                                                         */
 /*    Amiga-specific FreeType low-level system interface (body).           */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*  Copyright 1996-2001, 2002, 2005 by                                     */
+/*  David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner.       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
   /*************************************************************************/
 
 
-// Maintained by Detlef Würkner <TetiSoft@apg.lahn.de>
-
-// TetiSoft: Modified to avoid fopen() fclose() fread() fseek() ftell()
-// malloc() realloc() and free() which can't be used in an amiga
-// shared run-time library linked with libinit.o
-
-#include <exec/memory.h>
-
-#ifdef __GNUC__
-// Avoid warnings "struct X declared inside parameter list"
-#include <exec/devices.h>
-#include <exec/io.h>
-#include <exec/semaphores.h>
-#include <dos/exall.h>
-#endif
-
-// Necessary with OS3.9 includes
-#define __USE_SYSBASE
+  /*************************************************************************/
+  /*                                                                       */
+  /* Maintained by Detlef Würkner <TetiSoft@apg.lahn.de>                   */
+  /*                                                                       */
+  /* Based on the original ftsystem.c,                                     */
+  /* modified to avoid fopen(), fclose(), fread(), fseek(), ftell(),       */
+  /* malloc(), realloc(), and free().                                      */
+  /*                                                                       */
+  /* Those C library functions are often not thread-safe or cant be        */
+  /* used in a shared Amiga library. If thats not a problem for you,       */
+  /* you can of course use the default ftsystem.c with C library calls     */
+  /* instead.                                                              */
+  /*                                                                       */
+  /* This implementation needs exec V39+ because it uses AllocPooled() etc */
+  /*                                                                       */
+  /*************************************************************************/
 
+#define __NOLIBBASE__
+#define __NOGLOBALIFACE__
+#define __USE_INLINE__
 #include <proto/exec.h>
+#include <dos/stdio.h>
 #include <proto/dos.h>
-
-#ifndef __GNUC__
-/* TetiSoft: Missing in alib_protos.h, see amiga.lib autodoc
- * (These amiga.lib functions work under AmigaOS V33 and up)
- */
-extern APTR __asm
-AsmCreatePool( register __d0 ULONG             memFlags,
-               register __d1 ULONG             puddleSize,
-               register __d2 ULONG             threshSize,
-               register __a6 struct ExecBase*  SysBase );
-
-extern VOID __asm
-AsmDeletePool( register __a0 APTR              poolHeader,
-               register __a6 struct ExecBase*  SysBase );
-
-extern APTR __asm
-AsmAllocPooled( register __a0 APTR              poolHeader,
-                register __d0 ULONG             memSize,
-                register __a6 struct ExecBase*  SysBase );
-
-extern VOID __asm
-AsmFreePooled( register __a0 APTR              poolHeader,
-               register __a1 APTR              memory,
-               register __d0 ULONG             memSize,
-               register __a6 struct ExecBase*  SysBase);
+#ifdef __amigaos4__
+extern struct ExecIFace *IExec;
+extern struct DOSIFace  *IDOS;
+#else
+extern struct Library   *SysBase;
+extern struct Library   *DOSBase;
 #endif
 
+#define IOBUF_SIZE 512
 
-// TetiSoft: C implementation of AllocVecPooled (see autodoc exec/AllocPooled)
+/* structure that helps us to avoid
+ * useless calls of Seek() and Read()
+ */
+struct SysFile
+{
+  BPTR  file;
+  ULONG iobuf_start;
+  ULONG iobuf_end;
+  UBYTE iobuf[IOBUF_SIZE];
+};
+
+#ifndef __amigaos4__
+/* C implementation of AllocVecPooled (see autodoc exec/AllocPooled) */
 APTR
-AllocVecPooled( APTR   poolHeader,
-                ULONG  memSize )
+Alloc_VecPooled( APTR   poolHeader,
+                 ULONG  memSize )
 {
   ULONG  newSize = memSize + sizeof ( ULONG );
-#ifdef __GNUC__
   ULONG  *mem = AllocPooled( poolHeader, newSize );
-#else
-  ULONG  *mem = AsmAllocPooled( poolHeader, newSize, SysBase );
-#endif
 
   if ( !mem )
     return NULL;
@@ -91,21 +83,16 @@ AllocVecPooled( APTR   poolHeader,
   return mem + 1;
 }
 
-
-// TetiSoft: C implementation of FreeVecPooled (see autodoc exec/AllocPooled)
+/* C implementation of FreeVecPooled (see autodoc exec/AllocPooled) */
 void
-FreeVecPooled( APTR  poolHeader,
-               APTR  memory )
+Free_VecPooled( APTR  poolHeader,
+                APTR  memory )
 {
   ULONG  *realmem = (ULONG *)memory - 1;
 
-#ifdef __GNUC__
   FreePooled( poolHeader, realmem, *realmem );
-#else
- AsmFreePooled( poolHeader, realmem, *realmem, SysBase );
-#endif
 }
-
+#endif
 
 #include <ft2build.h>
 #include FT_CONFIG_CONFIG_H
@@ -154,10 +141,11 @@ FreeVecPooled( APTR  poolHeader,
   ft_alloc( FT_Memory  memory,
             long       size )
   {
-//  FT_UNUSED( memory );
-
-//  return malloc( size );
+#ifdef __amigaos4__
     return AllocVecPooled( memory->user, size );
+#else
+    return Alloc_VecPooled( memory->user, size );
+#endif
   }
 
 
@@ -187,19 +175,22 @@ FreeVecPooled( APTR  poolHeader,
               long       new_size,
               void*      block )
   {
-//  FT_UNUSED( memory );
-//  FT_UNUSED( cur_size );
-
-//  return realloc( block, new_size );
-
     void* new_block;
 
+#ifdef __amigaos4__
     new_block = AllocVecPooled ( memory->user, new_size );
+#else
+    new_block = Alloc_VecPooled ( memory->user, new_size );
+#endif
     if ( new_block != NULL )
     {
       CopyMem ( block, new_block,
                 ( new_size > cur_size ) ? cur_size : new_size );
+#ifdef __amigaos4__
       FreeVecPooled ( memory->user, block );
+#else
+      Free_VecPooled ( memory->user, block );
+#endif
     }
     return new_block;
   }
@@ -214,19 +205,19 @@ FreeVecPooled( APTR  poolHeader,
   /*    The memory release function.                                       */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    memory :: A pointer to the memory object.                          */
+  /*    memory  :: A pointer to the memory object.                         */
   /*                                                                       */
-  /*    block  :: The address of block in memory to be freed.              */
+  /*    block   :: The address of block in memory to be freed.             */
   /*                                                                       */
   FT_CALLBACK_DEF( void )
   ft_free( FT_Memory  memory,
            void*      block )
   {
-//  FT_UNUSED( memory );
-
-//  free( block );
-
+#ifdef __amigaos4__
     FreeVecPooled( memory->user, block );
+#else
+    Free_VecPooled( memory->user, block );
+#endif
   }
 
 
@@ -248,14 +239,13 @@ FreeVecPooled( APTR  poolHeader,
 
   /* We use the macro STREAM_FILE for convenience to extract the       */
   /* system-specific stream handle from a given FreeType stream object */
-// #define STREAM_FILE( stream )  ( (FILE*)stream->descriptor.pointer )
-#define STREAM_FILE( stream )  ( (BPTR)stream->descriptor.pointer )     // TetiSoft
+#define STREAM_FILE( stream )  ( (struct SysFile *)stream->descriptor.pointer )
 
 
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    ft_close_stream                                                    */
+  /*    ft_amiga_stream_close                                              */
   /*                                                                       */
   /* <Description>                                                         */
   /*    The function to close a stream.                                    */
@@ -264,10 +254,13 @@ FreeVecPooled( APTR  poolHeader,
   /*    stream :: A pointer to the stream object.                          */
   /*                                                                       */
   FT_CALLBACK_DEF( void )
-  ft_close_stream( FT_Stream  stream )
+  ft_amiga_stream_close( FT_Stream  stream )
   {
-//  fclose( STREAM_FILE( stream ) );
-    Close( STREAM_FILE( stream ) );     // TetiSoft
+    struct SysFile* sysfile;
+
+    sysfile = STREAM_FILE( stream );
+    Close ( sysfile->file );
+    FreeMem ( sysfile, sizeof ( struct SysFile ));
 
     stream->descriptor.pointer = NULL;
     stream->size               = 0;
@@ -278,7 +271,7 @@ FreeVecPooled( APTR  poolHeader,
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    ft_io_stream                                                       */
+  /*    ft_amiga_stream_io                                                 */
   /*                                                                       */
   /* <Description>                                                         */
   /*    The function to open a stream.                                     */
@@ -296,22 +289,89 @@ FreeVecPooled( APTR  poolHeader,
   /*    The number of bytes actually read.                                 */
   /*                                                                       */
   FT_CALLBACK_DEF( unsigned long )
-  ft_io_stream( FT_Stream       stream,
-                unsigned long   offset,
-                unsigned char*  buffer,
-                unsigned long   count )
+  ft_amiga_stream_io( FT_Stream       stream,
+                      unsigned long   offset,
+                      unsigned char*  buffer,
+                      unsigned long   count )
   {
-//  FILE*  file;
-    BPTR   file;        // TetiSoft
+    struct SysFile* sysfile;
+    unsigned long   read_bytes;
 
+    if ( count != 0 )
+    {
+      sysfile = STREAM_FILE( stream );
 
-    file = STREAM_FILE( stream );
+      /* handle the seek */
+      if ( (offset < sysfile->iobuf_start) || (offset + count > sysfile->iobuf_end) )
+      {
+        /* requested offset implies we need a buffer refill */
+        if ( !sysfile->iobuf_end || offset != (sysfile->iobuf_end + 1) )
+        {
+          /* a physical seek is necessary */
+          Seek( sysfile->file, offset, OFFSET_BEGINNING );
+        }
+        sysfile->iobuf_start = offset;
+        sysfile->iobuf_end = 0; /* trigger a buffer refill */
+      }
 
-//  fseek( file, offset, SEEK_SET );
-    Seek( file, offset, OFFSET_BEGINNING );     // TetiSoft
+      /* handle the read */
+      if ( offset + count <= sysfile->iobuf_end )
+      {
+        /* we have buffer and requested bytes are all inside our buffer */
+        CopyMem( &sysfile->iobuf[offset - sysfile->iobuf_start], buffer, count );
+        read_bytes = count;
+      }
+      else
+      {
+        /* (re)fill buffer */
+        if ( count <= IOBUF_SIZE )
+        {
+          /* requested bytes is a subset of the buffer */
+          read_bytes = Read( sysfile->file, sysfile->iobuf, IOBUF_SIZE );
+          if ( read_bytes == -1UL )
+          {
+            /* error */
+            read_bytes = 0;
+          }
+          else
+          {
+            sysfile->iobuf_end = offset + read_bytes;
+            CopyMem( sysfile->iobuf, buffer, count );
+            if ( read_bytes > count )
+            {
+              read_bytes = count;
+            }
+          }
+        }
+        else
+        {
+          /* we actually need more than our buffer can hold, so we decide
+          ** to do a single big read, and then copy the last IOBUF_SIZE
+          ** bytes of that to our internal buffer for later use */
+          read_bytes = Read( sysfile->file, buffer, count );
+          if ( read_bytes == -1UL )
+          {
+            /* error */
+            read_bytes = 0;
+          }
+          else
+          {
+            ULONG bufsize;
+
+            bufsize = ( read_bytes > IOBUF_SIZE ) ? IOBUF_SIZE : read_bytes;
+            sysfile->iobuf_end = offset + read_bytes;
+            sysfile->iobuf_start = sysfile->iobuf_end - bufsize;
+            CopyMem( &buffer[read_bytes - bufsize] , sysfile->iobuf, bufsize );
+          }
+        }
+      }
+    }
+    else
+    {
+      read_bytes = 0;
+    }
 
-//  return (unsigned long)fread( buffer, 1, count, file );
-    return (unsigned long)FRead( file, buffer, 1, count);
+    return read_bytes;
   }
 
 
@@ -321,40 +381,50 @@ FreeVecPooled( APTR  poolHeader,
   FT_Stream_Open( FT_Stream    stream,
                   const char*  filepathname )
   {
-//  FILE*                  file;
-    BPTR                   file; // TetiSoft
-    struct FileInfoBlock*  fib;  // TetiSoft
+    struct FileInfoBlock*  fib;
+    struct SysFile*        sysfile;
 
 
     if ( !stream )
       return FT_Err_Invalid_Stream_Handle;
 
-//  file = fopen( filepathname, "rb" );
-    file = Open( filepathname, MODE_OLDFILE );  // TetiSoft
-    if ( !file )
+#ifdef __amigaos4__
+    sysfile = AllocMem ( sizeof (struct SysFile ), MEMF_SHARED );
+#else
+    sysfile = AllocMem ( sizeof (struct SysFile ), MEMF_PUBLIC );
+#endif
+    if ( !sysfile )
+    {
+      FT_ERROR(( "FT_Stream_Open:" ));
+      FT_ERROR(( " could not open `%s'\n", filepathname ));
+
+      return FT_Err_Cannot_Open_Resource;
+    }
+    sysfile->file = Open( (STRPTR)filepathname, MODE_OLDFILE );
+    if ( !sysfile->file )
     {
+      FreeMem ( sysfile, sizeof ( struct SysFile ));
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
 
       return FT_Err_Cannot_Open_Resource;
     }
 
-//  fseek( file, 0, SEEK_END );
-//  astream->size = ftell( file );
-//  fseek( file, 0, SEEK_SET );
     fib = AllocDosObject( DOS_FIB, NULL );
     if ( !fib )
     {
-      Close ( file );
+      Close ( sysfile->file );
+      FreeMem ( sysfile, sizeof ( struct SysFile ));
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
 
       return FT_Err_Cannot_Open_Resource;
     }
-    if ( !( ExamineFH( file, fib ) ) )
+    if ( !( ExamineFH( sysfile->file, fib ) ) )
     {
       FreeDosObject( DOS_FIB, fib );
-      Close ( file );
+      Close ( sysfile->file );
+      FreeMem ( sysfile, sizeof ( struct SysFile ));
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
 
@@ -363,17 +433,17 @@ FreeVecPooled( APTR  poolHeader,
     stream->size = fib->fib_Size;
     FreeDosObject( DOS_FIB, fib );
 
-//  stream->descriptor.pointer = file;
-    stream->descriptor.pointer = (void *)file;
-
+    stream->descriptor.pointer = (void *)sysfile;
     stream->pathname.pointer   = (char*)filepathname;
+    sysfile->iobuf_start       = 0;
+    sysfile->iobuf_end         = 0;
     stream->pos                = 0;
 
-    stream->read  = ft_io_stream;
-    stream->close = ft_close_stream;
+    stream->read  = ft_amiga_stream_io;
+    stream->close = ft_amiga_stream_close;
 
     FT_TRACE1(( "FT_Stream_Open:" ));
-    FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
+    FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
                 filepathname, stream->size ));
 
     return FT_Err_Ok;
@@ -387,7 +457,7 @@ FreeVecPooled( APTR  poolHeader,
 
   extern void
   ft_mem_debug_done( FT_Memory  memory );
-
+  
 #endif
 
 
@@ -399,15 +469,17 @@ FreeVecPooled( APTR  poolHeader,
     FT_Memory  memory;
 
 
-//  memory = (FT_Memory)malloc( sizeof ( *memory ) );
+#ifdef __amigaos4__
+    memory = (FT_Memory)AllocVec( sizeof ( *memory ), MEMF_SHARED );
+#else
     memory = (FT_Memory)AllocVec( sizeof ( *memory ), MEMF_PUBLIC );
+#endif
     if ( memory )
     {
-//    memory->user = 0;
-#ifdef __GNUC__
-      memory->user = CreatePool( MEMF_PUBLIC, 2048, 2048 );
+#ifdef __amigaos4__
+      memory->user = CreatePool( MEMF_SHARED, 16384, 16384 );
 #else
-      memory->user = AsmCreatePool( MEMF_PUBLIC, 2048, 2048, SysBase );
+      memory->user = CreatePool( MEMF_PUBLIC, 16384, 16384 );
 #endif
       if ( memory->user == NULL )
       {
@@ -421,7 +493,7 @@ FreeVecPooled( APTR  poolHeader,
         memory->free    = ft_free;
 #ifdef FT_DEBUG_MEMORY
         ft_mem_debug_init( memory );
-#endif
+#endif    
       }
     }
 
@@ -436,15 +508,15 @@ FreeVecPooled( APTR  poolHeader,
   {
 #ifdef FT_DEBUG_MEMORY
     ft_mem_debug_done( memory );
-#endif
+#endif  
 
-#ifdef __GNUC__
     DeletePool( memory->user );
-#else
-    AsmDeletePool( memory->user, SysBase );
-#endif
     FreeVec( memory );
   }
 
-
+/*
+Local Variables:
+coding: latin-1
+End:
+*/
 /* END */
index 4e99965..e1282fe 100644 (file)
@@ -1,16 +1,32 @@
 #ifndef ATARI_H
+
 #define ATARI_H
 
+
+
 #pragma warn -stu
 
+
+
 /* PureC doesn't like 32bit enumerations */
 
+
+
 #ifndef FT_IMAGE_TAG
+
 #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value 
+
 #endif /* FT_IMAGE_TAG */ 
 
+
+
 #ifndef FT_ENC_TAG
+
 #define FT_ENC_TAG( value, a, b, c, d ) value
+
 #endif /* FT_ENC_TAG */
 
+
+
 #endif /* ATARI_H */
+
index f365717..bc607b3 100644 (file)
@@ -1,37 +1,74 @@
 /* the following changes file names for PureC projects */
 
+
+
 if (argc > 0)
+
 {
+
        ordner = argv[0];
+
        if (basename(ordner) == "") /* ist Ordner */
+
        {
+
                ChangeFilenames(ordner);
+
        }
+
 }
 
+
+
 proc ChangeFilenames(folder)
+
 local i,entries,directory,file;
+
 {
+
        entries = filelist(directory,folder);
+
        for (i = 0; i < entries; ++i)
+
        {
+
                file = directory[i,0];
+
                if ((directory[i,3]&16) > 0) /* subdirectory */
+
                {
+
                        ChangeFilenames(folder+file+"\\");
+
                }
+
                else
+
                {
+
                        if ((stricmp(suffix(file),".h")==0)|(stricmp(suffix(file),".c")==0))
+
                        ChangeFilename(folder,file);
+
                }
+
        }
+
 }
 
+
+
 proc ChangeFilename(path,datei)
+
 local newfile,err;
+
 {
+
        newfile=datei;
+
        newfile[0]=(newfile[0] | 32) ^ 32;
+
        err=files.rename("-q",path+datei,newfile);
+
 }
+
index 4e3e689..61aa81b 100644 (file)
@@ -1,33 +1,66 @@
 ;FreeType project file
 
+
+
 FREETYPE.LIB
 
+
+
 .C [-K -P -R -A]
+
 .L [-J -V]
+
 .S
 
+
+
 =
 
+
+
 ..\..\src\base\ftsystem.c
+
 ..\..\src\base\ftdebug.c
 
+
+
 ..\..\src\base\ftinit.c
+
 ..\..\src\base\ftglyph.c
+
 ..\..\src\base\ftmm
+
 ..\..\src\base\ftbbox
 
+
+
 ..\..\src\base\ftbase.c
+
 ..\..\src\autohint\autohint.c
+
 ;..\..\src\cache\ftcache.c
+
 ..\..\src\cff\cff.c
+
 ..\..\src\cid\type1cid.c
+
 ..\..\src\psaux\psaux.c
+
 ..\..\src\pshinter\pshinter.c
+
 ..\..\src\psnames\psnames.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
 
+
+
index 04eec63..90ad889 100644 (file)
 Compiling FreeType 2 with PureC compiler
+
 ========================================
 
+
+
 [See below for a German version.]
 
+
+
 To compile FreeType 2 as a library the following changes must be applied:
 
+
+
 - All *.c files must start with an uppercase letter.
+
   (In case GEMSCRIPT is available:
+
   Simply drag the whole FreeType 2 directory to the file `FNames.SIC'.)
 
+
+
 - You have to change the INCLUDE directory in PureC's compiler options
+
   to contain both the `INCLUDE' and `freetype2\include' directory.
+
   Example:
 
+
+
     INCLUDE;E:\freetype2\include
 
+
+
 - The file `freetype2/include/Ft2build.h' must be patched as follows to
+
   include ATARI.H:
 
+
+
     #ifndef __FT2_BUILD_GENERIC_H__
+
     #define __FT2_BUILD_GENERIC_H__
 
+
+
     #include "ATARI.H"
 
 
 
+
+
+
+
 Compilieren von FreeType 2 mit PureC
+
 ====================================
 
+
+
 Um FreeType 2 als eine Bibliothek (library) zu compilieren, muss folgendes
+
 ge\84ndert werden:
 
+
+
 - Alle *.c-files m\81ssen mit einem GROSSBUCHSTABEN beginnen.
+
   (Falls GEMSCRIPT zur Verf\81gung steht:
+
   Den kompletten Ordner freetype2 auf die Datei `FNames.SIC' draggen.)
 
+
+
 - In den Compiler-Optionen von PureC muss das INCLUDE directory auf INCLUDE
+
   und freetype2\include verweisen. Z.B.:
 
+
+
     INCLUDE;E:\freetype2\include
 
+
+
 - In der Datei freetype2/include/Ft2build.h muss zu Beginn
+
   ein #include "ATARI.H" wie folgt eingef\81gt werden:
 
+
+
     #ifndef __FT2_BUILD_GENERIC_H__
+
     #define __FT2_BUILD_GENERIC_H__
 
+
+
     #include "ATARI.H"
 
+
+
 --- end of README.TXT ---
+
index 15879f8..c70f117 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2004, 2005 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -63,8 +63,11 @@ T := -o$(space)
 #   ANSI compliance.
 #
 ifndef CFLAGS
+  ifeq ($(findstring g++,$(CC)),)
+    nested_externs := -Wnested-externs
+  endif
+
   CFLAGS := -c -g -O0 \
-            -fno-strict-aliasing \
             -Wall \
             -W \
             -Wundef \
@@ -73,8 +76,8 @@ ifndef CFLAGS
             -Wwrite-strings \
             -Wstrict-prototypes \
             -Wredundant-decls \
-            -Wnested-externs \
-            -Wno-long-long
+            -Wno-long-long \
+            $(nested_externs)
 endif
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
index d51f642..f4c5f96 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2005 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -62,7 +62,7 @@ T := -o$(space)
 #   ANSI compliance.
 #
 ifndef CFLAGS
-  CFLAGS := -c -g -O6 -Wall -fno-strict-aliasing
+  CFLAGS := -c -g -O6 -Wall
 endif
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
index b80686c..43c48d0 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2004 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -43,6 +43,21 @@ ifeq ($(PLATFORM),ansi)
       ifeq ($(is_dos),)
         is_dos := $(findstring MDOS\COMMAND,$(COMSPEC))
       endif
+
+      # We also try to recognize Dos 7.x without Windows 9X launched.
+      # See builds/win32/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.
+          ifndef windir
+            is_dos := $(findstring Windows,$(strip $(shell ver)))
+          endif
+#endif
+        endif
+      endif
+
     endif # test COMSPEC
 
     ifneq ($(is_dos),)
@@ -107,7 +122,17 @@ ifeq ($(PLATFORM),dos)
   else
     SEP    := $(BACKSLASH)
     DELETE := del
-    COPY   := copy
+
+    # Setting COPY is a bit trickier.  We can be running DJGPP on some
+    # Windows NT derivatives, like XP.  See builds/win32/detect.mk for
+    # explanations why we need hacking here.
+    #
+    ifeq ($(OS),Windows_NT)
+      COPY := cmd.exe /c copy
+    else
+      COPY := copy
+    endif  # test NT
+
     setup: dos_setup
   endif
 
index 0c39e49..c763b16 100644 (file)
@@ -3,6 +3,9 @@
 #
 
 
+# Copyright 2003 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
 # This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
index 00325d6..ff1b19e 100644 (file)
@@ -254,7 +254,7 @@ library: $(PROJECT_LIBRARY)
 refdoc:
        python $(SRC_DIR)/tools/docmaker/docmaker.py \
                --prefix=ft2                          \
-               --title=FreeType-2.1.               \
+               --title=FreeType-2.1.10               \
                --output=$(DOC_DIR)                   \
                $(PUBLIC_DIR)/*.h                     \
                $(PUBLIC_DIR)/config/*.h              \
index ceda545..cbf449f 100644 (file)
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.8a -*- Autoconf -*-
+# generated automatically by aclocal 1.9.4 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
 # Free Software Foundation, Inc.
@@ -123,7 +123,7 @@ esac
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
+Xsed='sed -e 1s/^X//'
 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
 
 # Same as above, but do not quote variable references.
@@ -191,6 +191,8 @@ if test -n "$RANLIB"; then
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
+_LT_CC_BASENAME([$compiler])
+
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
 file_magic*)
@@ -236,6 +238,48 @@ compiler=$CC
 ])# _LT_AC_SYS_COMPILER
 
 
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
 # _LT_AC_SYS_LIBPATH_AIX
 # ----------------------
 # Links a minimal program and checks the executable
@@ -308,7 +352,7 @@ fi
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 if test -z "$ECHO"; then
 if test "X${echo_test_string+set}" != Xset; then
@@ -577,8 +621,10 @@ AC_CACHE_CHECK([$1], [$2],
    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
    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
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
        $2=yes
      fi
    fi
@@ -609,6 +655,11 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
      else
        $2=yes
      fi
@@ -667,11 +718,38 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     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 *BSD
+    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`
+    ;;
+  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
+    ;;
+  *)
     # 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"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
               = "XX$teststring") >/dev/null 2>&1 &&
            new_result=`expr "X$teststring" : ".*" 2>&1` &&
            lt_cv_sys_max_cmd_len=$new_result &&
@@ -937,7 +1015,9 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
      fi
    fi
@@ -1005,8 +1085,8 @@ AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
 [AC_MSG_CHECKING([how to hardcode library paths into programs])
 _LT_AC_TAGVAR(hardcode_action, $1)=
 if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
-   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
-   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
@@ -1173,7 +1253,7 @@ beos*)
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[[45]]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -1231,7 +1311,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -1289,7 +1369,9 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
@@ -1308,7 +1390,7 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -1434,7 +1516,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -1497,7 +1579,11 @@ nto-qnx*)
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  need_version=yes
+  # 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
@@ -1663,7 +1749,9 @@ if test -f "$ltmain" && test -n "$tagnames"; then
 
       case $tagname in
       CXX)
-       if test -n "$CXX" && test "X$CXX" != "Xno"; then
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
          AC_LIBTOOL_LANG_CXX_CONFIG
        else
          tagname=""
@@ -2068,6 +2156,15 @@ case $reload_flag in
 *) reload_flag=" $reload_flag" ;;
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
 ])# AC_PROG_LD_RELOAD_FLAG
 
 
@@ -2101,7 +2198,7 @@ beos*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-bsdi4*)
+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
@@ -2124,13 +2221,13 @@ darwin* | rhapsody*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-freebsd* | kfreebsd*-gnu)
+freebsd* | kfreebsd*-gnu | 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)/i[[3-9]]86 (compact )?demand paged shared library'
+      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.*`
       ;;
@@ -2174,15 +2271,6 @@ irix5* | irix6* | nonstopux*)
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -2205,12 +2293,10 @@ nto-qnx*)
   ;;
 
 openbsd*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   fi
   ;;
 
@@ -2400,10 +2486,21 @@ AC_DEFUN([AC_LIBTOOL_CXX],
 # ---------------
 AC_DEFUN([_LT_AC_LANG_CXX],
 [AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
 ])# _LT_AC_LANG_CXX
 
+# _LT_AC_PROG_CXXCPP
+# ---------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
 
 # AC_LIBTOOL_F77
 # --------------
@@ -2476,6 +2573,10 @@ lt_simple_link_test_code='int main(){return(0);}\n'
 
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 #
 # Check for any special shared library compilation flags.
 #
@@ -2538,43 +2639,6 @@ aix3*)
 aix4* | aix5*)
   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
     test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-  darwin* | rhapsody*)
-  if test "$GCC" = yes; then
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case "$host_os" in
-    rhapsody* | darwin1.[[012]])
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[[012]])
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-      ;;
-    esac
-    output_verbose_link_cmd='echo'
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
-    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=no
-    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-  else
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
   fi
     ;;
 esac
@@ -2601,7 +2665,7 @@ AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
 AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
 [AC_LANG_PUSH(C++)
 AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
 
 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
@@ -2645,6 +2709,10 @@ lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC=$CC
 lt_save_LD=$LD
@@ -2666,7 +2734,7 @@ test -z "${LDCXX+set}" || LD=$LDCXX
 CC=${CXX-"c++"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+_LT_CC_BASENAME([$compiler])
 
 # We don't want -fno-exception wen compiling C++ code, so set the
 # no_builtin_flag separately
@@ -2773,7 +2841,7 @@ case $host_os in
     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
     if test "$GXX" = yes; then
-      case $host_os in aix4.[012]|aix4.[012].*)
+      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`
@@ -2794,6 +2862,9 @@ case $host_os in
        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
@@ -2853,6 +2924,7 @@ case $host_os in
     esac
     ;;
 
+
   cygwin* | mingw* | pw32*)
     # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
     # as there is no search path for DLLs.
@@ -2876,65 +2948,76 @@ case $host_os in
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
     fi
   ;;
+      darwin* | rhapsody*)
+        case "$host_os" in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
-  darwin* | rhapsody*)
-  if test "$GXX" = yes; then
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case "$host_os" in
-    rhapsody* | darwin1.[[012]])
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[[012]])
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
-            ;;
-        esac
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
       fi
-      ;;
-    esac
-    lt_int_apple_cc_single_mod=no
-    output_verbose_link_cmd='echo'
-    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-      lt_int_apple_cc_single_mod=yes
-    fi
-    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    else
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    fi
-    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-
-    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=no
-    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-  else
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-  fi
-    ;;
+        ;;
 
   dgux*)
     case $cc_basename in
-      ec++)
+      ec++*)
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
        ;;
-      ghcx)
+      ghcx*)
        # Green Hills C++ Compiler
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -2945,14 +3028,14 @@ case $host_os in
        ;;
     esac
     ;;
-  freebsd[12]*)
+  freebsd[[12]]*)
     # C++ shared libraries reported to be fairly broken before switch to ELF
     _LT_AC_TAGVAR(ld_shlibs, $1)=no
     ;;
   freebsd-elf*)
     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
     ;;
-  freebsd* | kfreebsd*-gnu)
+  freebsd* | kfreebsd*-gnu | dragonfly*)
     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
     # conventions
     _LT_AC_TAGVAR(ld_shlibs, $1)=yes
@@ -2969,11 +3052,11 @@ case $host_os in
                                # location of the library.
 
     case $cc_basename in
-    CC)
+    CC*)
       # FIXME: insert proper C++ library support
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
       ;;
-    aCC)
+    aCC*)
       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
@@ -2983,7 +3066,7 @@ case $host_os in
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -3034,11 +3117,11 @@ case $host_os in
     esac
 
     case $cc_basename in
-      CC)
+      CC*)
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
        ;;
-      aCC)
+      aCC*)
        case "$host_cpu" in
        hppa*64*|ia64*)
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
@@ -3078,9 +3161,9 @@ case $host_os in
     ;;
   irix5* | irix6*)
     case $cc_basename in
-      CC)
+      CC*)
        # SGI C++
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
        # Archives containing C++ object files must be created using
        # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -3091,7 +3174,7 @@ case $host_os in
       *)
        if test "$GXX" = yes; then
          if test "$with_gnu_ld" = no; then
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
          else
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
          fi
@@ -3104,7 +3187,7 @@ case $host_os in
     ;;
   linux*)
     case $cc_basename in
-      KCC)
+      KCC*)
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
        # KCC will only create a shared library if the output file
@@ -3129,17 +3212,41 @@ case $host_os in
        # "CC -Bstatic", where "CC" is the KAI C++ compiler.
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
        ;;
-      icpc)
+      icpc*)
        # Intel C++
        with_gnu_ld=yes
+       # version 8.0 and above of icpc choke on multiply defined symbols
+       # if we add $predep_objects and $postdep_objects, however 7.1 and
+       # earlier do not add the objects themselves.
+       case `$CC -V 2>&1` in
+       *"Version 7."*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       *)  # Version 8.0 or newer
+         tmp_idyn=
+         case $host_cpu in
+           ia64*) tmp_idyn=' -i_dynamic';;
+         esac
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       esac
        _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
        ;;
-      cxx)
+      pgCC*)
+        # Portland Group C++ compiler
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
        # Compaq C++
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
@@ -3170,7 +3277,7 @@ case $host_os in
     ;;
   mvs*)
     case $cc_basename in
-      cxx)
+      cxx*)
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
        ;;
@@ -3191,9 +3298,25 @@ case $host_os in
     # Workaround some broken pre-1.5 toolchains
     output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
     ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
   osf3*)
     case $cc_basename in
-      KCC)
+      KCC*)
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
        # KCC will only create a shared library if the output file
@@ -3209,14 +3332,14 @@ case $host_os in
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 
        ;;
-      RCC)
+      RCC*)
        # Rational C++ 2.4.1
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
        ;;
-      cxx)
+      cxx*)
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -3234,7 +3357,7 @@ case $host_os in
       *)
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
          _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -3253,7 +3376,7 @@ case $host_os in
     ;;
   osf4* | osf5*)
     case $cc_basename in
-      KCC)
+      KCC*)
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
        # KCC will only create a shared library if the output file
@@ -3268,17 +3391,17 @@ case $host_os in
        # the KAI C++ compiler.
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
        ;;
-      RCC)
+      RCC*)
        # Rational C++ 2.4.1
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
        ;;
-      cxx)
+      cxx*)
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
          echo "-hidden">> $lib.exp~
-         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
          $rm $lib.exp'
 
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -3297,7 +3420,7 @@ case $host_os in
       *)
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
          _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -3321,7 +3444,7 @@ case $host_os in
   sco*)
     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
     case $cc_basename in
-      CC)
+      CC*)
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
        ;;
@@ -3333,12 +3456,12 @@ case $host_os in
     ;;
   sunos4*)
     case $cc_basename in
-      CC)
+      CC*)
        # Sun C++ 4.x
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
        ;;
-      lcc)
+      lcc*)
        # Lucid
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -3351,7 +3474,7 @@ case $host_os in
     ;;
   solaris*)
     case $cc_basename in
-      CC)
+      CC*)
        # Sun C++ 4.2, 5.x and Centerline C++
        _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
@@ -3361,13 +3484,17 @@ case $host_os in
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
        case $host_os in
-         solaris2.[0-5] | solaris2.[0-5].*) ;;
+         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
          *)
            # The C++ compiler is used as linker so we must use $wl
            # flag to pass the commands to the underlying system
-           # linker.
+           # linker. We must also pass each convience library through
+           # to the system linker between allextract/defaultextract.
+           # The C++ compiler will combine linker options so we
+           # cannot just pass the convience library names through
+           # without $wl.
            # Supported since Solaris 2.6 (maybe 2.5.1?)
-           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
            ;;
        esac
        _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
@@ -3388,7 +3515,7 @@ case $host_os in
        # in the archive.
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
        ;;
-      gcx)
+      gcx*)
        # Green Hills C++ Compiler
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
@@ -3431,7 +3558,7 @@ case $host_os in
     ;;
   tandem*)
     case $cc_basename in
-      NCC)
+      NCC*)
        # NonStop-UX NCC 3.20
        # FIXME: insert proper C++ library support
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -3663,12 +3790,16 @@ lt_simple_link_test_code="      program t\n      end\n"
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${F77-"f77"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+_LT_CC_BASENAME([$compiler])
 
 AC_MSG_CHECKING([if libtool supports shared libraries])
 AC_MSG_RESULT([$can_build_shared])
@@ -3687,7 +3818,9 @@ aix3*)
   fi
   ;;
 aix4* | aix5*)
-  test "$enable_shared" = yes && enable_static=no
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
   ;;
 esac
 AC_MSG_RESULT([$enable_shared])
@@ -3738,20 +3871,27 @@ _LT_AC_TAGVAR(objext, $1)=$objext
 lt_simple_compile_test_code="class foo {}\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${GCJ-"gcj"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
 AC_LIBTOOL_PROG_COMPILER_PIC($1)
 AC_LIBTOOL_PROG_CC_C_O($1)
@@ -3794,11 +3934,16 @@ lt_simple_link_test_code="$lt_simple_compile_test_code"
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${RC-"windres"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
 AC_LIBTOOL_CONFIG($1)
@@ -3934,7 +4079,7 @@ ifelse([$1], [],
 #
 # 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.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -3945,11 +4090,11 @@ ifelse([$1], [],
 SED=$lt_SED
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e s/^X//"
+Xsed="$SED -e 1s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 # The names of the tagged configurations supported by this script.
 available_tags=
@@ -3980,6 +4125,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -4056,7 +4207,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -4330,9 +4481,6 @@ symcode='[[BCDEGRST]]'
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
 
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
 # Transform an extracted symbol line into a proper C declaration
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
@@ -4354,6 +4502,13 @@ hpux*) # Its linker distinguishes data from code symbols
   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
   lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
   ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
 irix* | nonstopux*)
   symcode='[[BCDEGRST]]'
   ;;
@@ -4385,8 +4540,11 @@ esac
 # Try without a prefix undercore, 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.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -4575,18 +4733,28 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       chorus*)
        case $cc_basename in
-       cxch68)
+       cxch68*)
          # Green Hills C++ Compiler
          # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
          ;;
        esac
        ;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           ;;
+         esac
+       ;;
       dgux*)
        case $cc_basename in
-         ec++)
+         ec++*)
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
            ;;
-         ghcx)
+         ghcx*)
            # Green Hills C++ Compiler
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
            ;;
@@ -4594,19 +4762,19 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
            ;;
        esac
        ;;
-      freebsd* | kfreebsd*-gnu)
+      freebsd* | kfreebsd*-gnu | dragonfly*)
        # FreeBSD uses GNU C++
        ;;
       hpux9* | hpux10* | hpux11*)
        case $cc_basename in
-         CC)
+         CC*)
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
            if test "$host_cpu" != ia64; then
              _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
            fi
            ;;
-         aCC)
+         aCC*)
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
            case "$host_cpu" in
@@ -4624,7 +4792,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       irix5* | irix6* | nonstopux*)
        case $cc_basename in
-         CC)
+         CC*)
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
            # CC pic flag -KPIC is the default.
@@ -4635,18 +4803,24 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       linux*)
        case $cc_basename in
-         KCC)
+         KCC*)
            # KAI C++ Compiler
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
            ;;
-         icpc)
+         icpc* | ecpc*)
            # Intel C++
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
            ;;
-         cxx)
+         pgCC*)
+           # Portland Group C++ compiler.
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         cxx*)
            # Compaq C++
            # Make sure the PIC flag is empty.  It appears that all Alpha
            # Linux and Compaq Tru64 Unix objects are PIC.
@@ -4663,7 +4837,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       mvs*)
        case $cc_basename in
-         cxx)
+         cxx*)
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
            ;;
          *)
@@ -4674,14 +4848,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       osf3* | osf4* | osf5*)
        case $cc_basename in
-         KCC)
+         KCC*)
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
            ;;
-         RCC)
+         RCC*)
            # Rational C++ 2.4.1
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
            ;;
-         cxx)
+         cxx*)
            # Digital/Compaq C++
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
            # Make sure the PIC flag is empty.  It appears that all Alpha
@@ -4697,7 +4871,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       sco*)
        case $cc_basename in
-         CC)
+         CC*)
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
            ;;
          *)
@@ -4706,13 +4880,13 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       solaris*)
        case $cc_basename in
-         CC)
+         CC*)
            # Sun C++ 4.2, 5.x and Centerline C++
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
            ;;
-         gcx)
+         gcx*)
            # Green Hills C++ Compiler
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
            ;;
@@ -4722,12 +4896,12 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       sunos4*)
        case $cc_basename in
-         CC)
+         CC*)
            # Sun C++ 4.x
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
            ;;
-         lcc)
+         lcc*)
            # Lucid
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
            ;;
@@ -4737,7 +4911,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
       tandem*)
        case $cc_basename in
-         NCC)
+         NCC*)
            # NonStop-UX NCC 3.20
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
            ;;
@@ -4834,6 +5008,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
 
     mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
@@ -4869,12 +5053,19 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       ;;
 
     linux*)
-      case $CC in
+      case $cc_basename in
       icc* | ecc*)
        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
         ;;
+      pgcc* | pgf77* | pgf90*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
       ccc*)
         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         # All Alpha code is PIC.
@@ -4895,9 +5086,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       ;;
 
     solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -4919,6 +5115,11 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       fi
       ;;
 
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
     uts4*)
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -4979,7 +5180,7 @@ ifelse([$1],[CXX],[
     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   *)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
@@ -5022,7 +5223,8 @@ ifelse([$1],[CXX],[
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
-
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
   case $host_os in
   cygwin* | mingw* | pw32*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
@@ -5041,7 +5243,28 @@ ifelse([$1],[CXX],[
   if test "$with_gnu_ld" = 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
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [[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
     aix3* | aix4* | aix5*)
@@ -5092,7 +5315,7 @@ EOF
       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_AC_TAGVAR(always_export_symbols, $1)=no
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
@@ -5106,7 +5329,38 @@ EOF
        fi~
        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
       else
-       ld_shlibs=no
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* )                       # Portland Group f77 and f90 compilers
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
+       esac
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
@@ -5148,31 +5402,6 @@ EOF
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ [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
-      if test $supports_anon_versioning = yes; then
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
-      fi
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -5183,16 +5412,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
     esac
 
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
-      runpath_var=LD_RUN_PATH
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-      fi
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -5256,7 +5480,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
       if test "$GCC" = yes; then
-       case $host_os in aix4.[012]|aix4.[012].*)
+       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`
@@ -5277,6 +5501,9 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
          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
@@ -5335,7 +5562,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
       ;;
 
-    bsdi4*)
+    bsdi[[45]]*)
       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
       ;;
 
@@ -5356,57 +5583,57 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
       # FIXME: Should let the user specify the lib program.
       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
 
     darwin* | rhapsody*)
-    if test "$GXX" = yes ; then
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
       case "$host_os" in
-      rhapsody* | darwin1.[[012]])
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
-       ;;
-      *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[[012]])
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-       ;;
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
       esac
-       lt_int_apple_cc_single_mod=no
-       output_verbose_link_cmd='echo'
-       if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-         lt_int_apple_cc_single_mod=yes
-       fi
-       if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-       else
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      fi
-      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        else
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        fi
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
     fi
       ;;
 
@@ -5440,7 +5667,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -5551,6 +5778,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       else
@@ -5596,7 +5824,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5615,10 +5843,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
     solaris*)
       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
       if test "$GCC" = yes; then
+       wlarc='${wl}'
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
          $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+       wlarc=''
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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'
@@ -5627,8 +5857,18 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       case $host_os in
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+       *)
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
       esac
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
       ;;
@@ -5889,7 +6129,7 @@ lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && break
+  test ! -f $lt_ac_sed && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -5914,9 +6154,9 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
     fi
   done
 done
-SED=$lt_cv_path_SED
 ])
+SED=$lt_cv_path_SED
 AC_MSG_RESULT([$SED])
 ])
 
-m4_include([./ft-munmap.m4])
+m4_include([ft-munmap.m4])
index 51fab47..21a7ad8 100644 (file)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2004-03-12'
+timestamp='2005-05-15'
 
 # 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
@@ -17,13 +17,15 @@ timestamp='2004-03-12'
 #
 # 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, 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.
 
+
 # Originally written by Per Bothner <per@bothner.com>.
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
@@ -53,7 +55,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -66,11 +68,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -196,64 +198,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
-       exit ;;
+       exit ;;
     amd64:OpenBSD:*:*)
        echo x86_64-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     amiga:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    arc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
     cats:OpenBSD:*:*)
        echo arm-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     hp300:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
+    luna88k:OpenBSD:*:*)
+       echo m88k-unknown-openbsd${UNAME_RELEASE}
+       exit ;;
     mac68k:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     macppc:OpenBSD:*:*)
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mvme68k:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mvme88k:OpenBSD:*:*)
        echo m88k-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mvmeppc:OpenBSD:*:*)
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    pegasos:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    pmax:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
     sgi:OpenBSD:*:*)
-       echo mipseb-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       echo mips64-unknown-openbsd${UNAME_RELEASE}
+       exit ;;
     sun3:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
     *:OpenBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:ekkoBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     macppc:MirBSD:*:*)
        echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:MirBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -306,40 +299,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit 0 ;;
-    Alpha*:OpenVMS:*:*)
-       echo alpha-hp-vms
-       exit 0 ;;
+       exit ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
        # of the specific Alpha model?
        echo alpha-pc-interix
-       exit ;;
+       exit ;;
     21064:Windows_NT:50:3)
        echo alpha-dec-winnt3.5
-       exit ;;
+       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
-       exit 0;;
+       exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-amigaos
-       exit ;;
+       exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-morphos
-       exit ;;
+       exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
-       exit 0 ;;
+       exit ;;
+    *:z/VM:*:*)
+       echo s390-ibm-zvmoe
+       exit ;;
     *:OS400:*:*)
         echo powerpc-ibm-os400
-       exit ;;
+       exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
-       exit 0;;
+       exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
-       exit 0;;
+       exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -347,32 +343,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        else
                echo pyramid-pyramid-bsd
        fi
-       exit ;;
+       exit ;;
     NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
-       exit ;;
+       exit ;;
     DRS?6000:unix:4.0:6*)
        echo sparc-icl-nx6
-       exit ;;
-    DRS?6000:UNIX_SV:4.2*:7*)
+       exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
        case `/usr/bin/uname -p` in
-           sparc) echo sparc-icl-nx7 && exit 0 ;;
+           sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     i86pc:SunOS:5.*:*)
        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
            Series*|S4*)
@@ -381,10 +377,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit ;;
+       exit ;;
     sun3*:SunOS:*:*)
        echo m68k-sun-sunos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     sun*:*:4.2BSD:*)
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -396,10 +392,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                echo sparc-sun-sunos${UNAME_RELEASE}
                ;;
        esac
-       exit ;;
+       exit ;;
     aushp:SunOS:*:*)
        echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -410,40 +406,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     m68k:machten:*:*)
        echo m68k-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
-       exit ;;
+       exit ;;
     RISC*:ULTRIX:*:*)
        echo mips-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     VAX*:ULTRIX*:*:*)
        echo vax-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
        echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -467,32 +463,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c \
-         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && exit 0
+       $CC_FOR_BUILD -o $dummy $dummy.c &&
+         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`$dummy $dummyarg` &&
+           { echo "$SYSTEM_NAME"; exit; }
        echo mips-mips-riscos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
-       exit ;;
+       exit ;;
     Motorola:*:4.3:PL8-*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit ;;
     Night_Hawk:Power_UNIX:*:*)
        echo powerpc-harris-powerunix
-       exit ;;
+       exit ;;
     m88k:CX/UX:7*:*)
        echo m88k-harris-cxux7
-       exit ;;
+       exit ;;
     m88k:*:4*:R4*)
        echo m88k-motorola-sysv4
-       exit ;;
+       exit ;;
     m88k:*:3*:R3*)
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -508,29 +505,29 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
-       exit ;;
+       exit ;;
     M88*:*:R3*:*)
        # Delta 88k system running SVR3
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
        echo m88k-tektronix-sysv3
-       exit ;;
+       exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
        echo m68k-tektronix-bsd
-       exit ;;
+       exit ;;
     *:IRIX*:*:*)
        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit ;;
+       exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
        echo i386-ibm-aix
-       exit ;;
+       exit ;;
     ia64:AIX:*:*)
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
@@ -538,7 +535,7 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
                eval $set_cc_for_build
@@ -553,14 +550,18 @@ EOF
                        exit(0);
                        }
 EOF
-               $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-               echo rs6000-ibm-aix3.2.5
+               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               then
+                       echo "$SYSTEM_NAME"
+               else
+                       echo rs6000-ibm-aix3.2.5
+               fi
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
        else
                echo rs6000-ibm-aix3.2
        fi
-       exit ;;
+       exit ;;
     *:AIX:*:[45])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -574,28 +575,28 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
-       exit ;;
+       exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
        echo romp-ibm-bsd4.4
-       exit ;;
+       exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit 0 ;;                           # report: romp-ibm BSD 4.3
+       exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
-       exit ;;
+       exit ;;
     DPX/2?00:B.O.S.:*:*)
        echo m68k-bull-sysv3
-       exit ;;
+       exit ;;
     9000/[34]??:4.3bsd:1.*:*)
        echo m68k-hp-bsd
-       exit ;;
+       exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
        echo m68k-hp-bsd4.4
-       exit ;;
+       exit ;;
     9000/[34678]??:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        case "${UNAME_MACHINE}" in
@@ -659,7 +660,18 @@ EOF
        then
            # avoid double evaluation of $set_cc_for_build
            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
-           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+
+           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+           # generating 64-bit code.  GNU and HP use different nomenclature:
+           #
+           # $ CC_FOR_BUILD=cc ./config.guess
+           # => hppa2.0w-hp-hpux11.23
+           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+           # => hppa64-hp-hpux11.23
+
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+               grep __LP64__ >/dev/null
            then
                HP_ARCH="hppa2.0w"
            else
@@ -667,11 +679,11 @@ EOF
            fi
        fi
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     ia64:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        echo ia64-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     3050*:HI-UX:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -699,166 +711,162 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
-       exit ;;
+       exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
        echo hppa1.1-hp-bsd
-       exit ;;
+       exit ;;
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
-       exit ;;
+       exit ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
-       exit ;;
+       exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
        echo hppa1.1-hp-osf
-       exit ;;
+       exit ;;
     hp8??:OSF1:*:*)
        echo hppa1.0-hp-osf
-       exit ;;
+       exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
            echo ${UNAME_MACHINE}-unknown-osf1mk
        else
            echo ${UNAME_MACHINE}-unknown-osf1
        fi
-       exit ;;
+       exit ;;
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
-       exit ;;
+       exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*[A-Z]90:*:*:*)
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*T3E:*:*:*)
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*SV1:*:*:*)
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     *:UNICOS/mp:*:*)
-       echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+        exit ;;
     5000:UNIX_System_V:4.*:*)
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-       exit ;;
+       exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     sparc*:BSD/OS:*:*)
        echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:BSD/OS:*:*)
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:FreeBSD:*:*)
-       # Determine whether the default compiler uses glibc.
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <features.h>
-       #if __GLIBC__ >= 2
-       LIBC=gnu
-       #else
-       LIBC=
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
-       # FreeBSD's kernel, but not the complete OS.
-       case ${LIBC} in gnu) kernel_only='k' ;; esac
-       echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
-       exit 0 ;;
+       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
-       exit ;;
-    i*:MINGW*:*)
+       exit ;;
+    i*:MINGW*:* | i*:windows32*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
-       exit ;;
+       exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
-       exit ;;
+       exit ;;
     x86:Interix*:[34]*)
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-       exit ;;
+       exit ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
+       exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
        # UNAME_MACHINE based on the output of uname instead of i386?
        echo i586-pc-interix
-       exit ;;
+       exit ;;
     i*:UWIN*:*)
        echo ${UNAME_MACHINE}-pc-uwin
-       exit 0 ;;
+       exit ;;
+    amd64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin
-       exit ;;
+       exit ;;
     prep*:SunOS:5.*:*)
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     *:GNU:*:*)
        # the GNU system
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit ;;
+       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
-       exit ;;
+       exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
-       exit ;;
+       exit ;;
     arm*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     cris:Linux:*:*)
        echo cris-axis-linux-gnu
-       exit 0 ;;
+       exit ;;
+    crisv32:Linux:*:*)
+       echo crisv32-axis-linux-gnu
+       exit ;;
+    frv:Linux:*:*)
+       echo frv-unknown-linux-gnu
+       exit ;;
     ia64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     m32r*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     m68*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     mips:Linux:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -876,7 +884,7 @@ 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 0
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
     mips64:Linux:*:*)
        eval $set_cc_for_build
@@ -895,14 +903,14 @@ 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 0
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
     ppc:Linux:*:*)
        echo powerpc-unknown-linux-gnu
-       exit ;;
+       exit ;;
     ppc64:Linux:*:*)
        echo powerpc64-unknown-linux-gnu
-       exit ;;
+       exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -916,7 +924,7 @@ EOF
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-       exit ;;
+       exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -924,25 +932,25 @@ EOF
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
          *)    echo hppa-unknown-linux-gnu ;;
        esac
-       exit ;;
+       exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
        echo hppa64-unknown-linux-gnu
-       exit ;;
+       exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
-       exit ;;
+       exit ;;
     sh64*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     sh*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     x86_64:Linux:*:*)
        echo x86_64-unknown-linux-gnu
-       exit ;;
+       exit ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
@@ -960,15 +968,15 @@ EOF
                ;;
          a.out-i386-linux)
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit ;;
+               exit ;;
          coff-i386)
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
+               exit ;;
          "")
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
                # one that does not give us useful --help.
                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit ;;
+               exit ;;
        esac
        # Determine whether the default compiler is a.out or elf
        eval $set_cc_for_build
@@ -996,15 +1004,18 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
-       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+       test x"${LIBC}" != x && {
+               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+               exit
+       }
+       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
        ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
        # earlier versions are messed up and put the nodename in both
        # sysname and nodename.
        echo i386-sequent-sysv4
-       exit ;;
+       exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -1012,27 +1023,27 @@ EOF
        # I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit ;;
+       exit ;;
     i*86:OS/2:*:*)
        # If we were able to find `uname', then EMX Unix compatibility
        # is probably installed.
        echo ${UNAME_MACHINE}-pc-os2-emx
-       exit ;;
+       exit ;;
     i*86:XTS-300:*:STOP)
        echo ${UNAME_MACHINE}-unknown-stop
-       exit ;;
+       exit ;;
     i*86:atheos:*:*)
        echo ${UNAME_MACHINE}-unknown-atheos
-       exit ;;
-       i*86:syllable:*:*)
+       exit ;;
+    i*86:syllable:*:*)
        echo ${UNAME_MACHINE}-pc-syllable
-       exit ;;
+       exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     i*86:*DOS:*:*)
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit ;;
+       exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1040,15 +1051,16 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
        fi
-       exit 0 ;;
-    i*86:*:5:[78]*)
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
        case `/bin/uname -X | grep "^Machine"` in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-       exit ;;
+       exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1066,73 +1078,73 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv32
        fi
-       exit ;;
+       exit ;;
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
        echo i386-pc-msdosdjgpp
-        exit ;;
+        exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
-       exit ;;
+       exit ;;
     paragon:*:*:*)
        echo i860-intel-osf1
-       exit ;;
+       exit ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
        fi
-       exit ;;
+       exit ;;
     mini*:CTIX:SYS*5:*)
        # "miniframe"
        echo m68010-convergent-sysv
-       exit ;;
+       exit ;;
     mc68k:UNIX:SYSTEM5:3.51m)
        echo m68k-convergent-sysv
-       exit ;;
+       exit ;;
     M680?0:D-NIX:5.3:*)
        echo m68k-diab-dnix
-       exit ;;
-    M68*:*:R3V[567]*:*)
-       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+       exit ;;
+    M68*:*:R3V[5678]*:*)
+       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
+          && { echo i486-ncr-sysv4; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
-       exit ;;
+       exit ;;
     TSUNAMI:LynxOS:2.*:*)
        echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     RM*:SINIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1140,68 +1152,73 @@ EOF
        else
                echo ns32k-sni-sysv
        fi
-       exit ;;
+       exit ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
        echo hppa1.1-stratus-sysv4
-       exit ;;
+       exit ;;
     *:*:*:FTX*)
        # From seanf@swdc.stratus.com.
        echo i860-stratus-sysv4
-       exit 0 ;;
+       exit ;;
+    i*86:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo ${UNAME_MACHINE}-stratus-vos
+       exit ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
-       exit ;;
+       exit ;;
     mc68*:A/UX:*:*)
        echo m68k-apple-aux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
-       exit ;;
+       exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
                echo mips-nec-sysv${UNAME_RELEASE}
        else
                echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+        exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
-       exit ;;
+       exit ;;
     BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
        echo powerpc-apple-beos
-       exit ;;
+       exit ;;
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
-       exit ;;
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-5:SUPER-UX:*:*)
        echo sx5-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-6:SUPER-UX:*:*)
        echo sx6-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Rhapsody:*:*)
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Darwin:*:*)
-       case `uname -p` in
+       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+       case $UNAME_PROCESSOR in
            *86) UNAME_PROCESSOR=i686 ;;
-           powerpc) UNAME_PROCESSOR=powerpc ;;
+           unknown) UNAME_PROCESSOR=powerpc ;;
        esac
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
        if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1209,22 +1226,25 @@ EOF
                UNAME_MACHINE=pc
        fi
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
-       exit 0 ;;
+       exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk${UNAME_RELEASE}
+       exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
-       exit ;;
+       exit ;;
     BS2000:POSIX*:*:*)
        echo bs2000-siemens-sysv
-       exit ;;
+       exit ;;
     DS/*:UNIX_System_V:*:*)
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
@@ -1235,31 +1255,44 @@ EOF
            UNAME_MACHINE="$cputype"
        fi
        echo ${UNAME_MACHINE}-unknown-plan9
-       exit ;;
+       exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
-       exit ;;
+       exit ;;
     *:TENEX:*:*)
        echo pdp10-unknown-tenex
-       exit ;;
+       exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
        echo pdp10-dec-tops20
-       exit ;;
+       exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
        echo pdp10-xkl-tops20
-       exit ;;
+       exit ;;
     *:TOPS-20:*:*)
        echo pdp10-unknown-tops20
-       exit ;;
+       exit ;;
     *:ITS:*:*)
        echo pdp10-unknown-its
-       exit ;;
+       exit ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:DragonFly:*:*)
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit 0 ;;
+       exit ;;
+    *:*VMS:*:*)
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       case "${UNAME_MACHINE}" in
+           A*) echo alpha-dec-vms ; exit ;;
+           I*) echo ia64-dec-vms ; exit ;;
+           V*) echo vax-dec-vms ; exit ;;
+       esac ;;
+    *:XENIX:*:SysV)
+       echo i386-pc-xenix
+       exit ;;
+    i*86:skyos:*:*)
+       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1291,7 +1324,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1380,11 +1413,12 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+       { echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1393,22 +1427,22 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
        echo c1-convex-bsd
-       exit ;;
+       exit ;;
     c2*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-       exit ;;
+       exit ;;
     c34*)
        echo c34-convex-bsd
-       exit ;;
+       exit ;;
     c38*)
        echo c38-convex-bsd
-       exit ;;
+       exit ;;
     c4*)
        echo c4-convex-bsd
-       exit ;;
+       exit ;;
     esac
 fi
 
@@ -1419,7 +1453,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-    ftp://ftp.gnu.org/pub/gnu/config/
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
index ba33103..519f2cd 100644 (file)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2004-03-12'
+timestamp='2005-05-12'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +21,15 @@ timestamp='2004-03-12'
 #
 # 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.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, 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.
 
+
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
 #
@@ -70,7 +71,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
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -83,11 +84,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -99,7 +100,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
        break ;;
@@ -145,7 +146,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)
+       -apple | -axis | -knuth | -cray)
                os=
                basic_machine=$1
                ;;
@@ -231,13 +232,14 @@ case $basic_machine in
        | 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 \
+       | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
        | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
-       | m32r | m32rle | m68000 | m68k | m88k | mcore \
+       | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
@@ -262,12 +264,13 @@ case $basic_machine in
        | pyramid \
        | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
-       | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+       | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b \
        | strongarm \
        | tahoe | thumb | tic4x | tic80 | tron \
        | v850 | v850e \
        | we32k \
-       | x86 | xscale | xstormy16 | xtensa \
+       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
        | z8k)
                basic_machine=$basic_machine-unknown
                ;;
@@ -298,9 +301,9 @@ case $basic_machine in
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* \
-       | bs2000-* \
+       | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-       | clipper-* | cydra-* \
+       | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
        | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
@@ -310,7 +313,7 @@ case $basic_machine in
        | ip2k-* | iq2000-* \
        | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | mcore-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
@@ -326,8 +329,9 @@ case $basic_machine in
        | mipsisa64sb1-* | mipsisa64sb1el-* \
        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
        | mipstx39-* | mipstx39el-* \
+       | mmix-* \
        | msp430-* \
-       | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
@@ -335,15 +339,16 @@ case $basic_machine in
        | romp-* | rs6000-* \
        | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
        | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
        | tron-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
-       | xtensa-* \
+       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa-* \
        | ymp-* \
        | z8k-*)
                ;;
@@ -445,6 +450,10 @@ case $basic_machine in
                basic_machine=j90-cray
                os=-unicos
                ;;
+       craynv)
+               basic_machine=craynv-cray
+               os=-unicosmp
+               ;;
        cr16c)
                basic_machine=cr16c-unknown
                os=-elf
@@ -452,6 +461,9 @@ case $basic_machine in
        crds | unos)
                basic_machine=m68k-crds
                ;;
+       crisv32 | crisv32-* | etraxfs*)
+               basic_machine=crisv32-axis
+               ;;
        cris | cris-* | etrax*)
                basic_machine=cris-axis
                ;;
@@ -481,6 +493,10 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       djgpp)
+               basic_machine=i586-pc
+               os=-msdosdjgpp
+               ;;
        dpx20 | dpx20-*)
                basic_machine=rs6000-bull
                os=-bosx
@@ -659,10 +675,6 @@ case $basic_machine in
        mips3*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
                ;;
-       mmix*)
-               basic_machine=mmix-knuth
-               os=-mmixware
-               ;;
        monitor)
                basic_machine=m68k-rom68k
                os=-coff
@@ -743,10 +755,6 @@ case $basic_machine in
        np1)
                basic_machine=np1-gould
                ;;
-       nv1)
-               basic_machine=nv1-cray
-               os=-unicosmp
-               ;;
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
@@ -1029,6 +1037,10 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
+       xbox)
+               basic_machine=i686-pc
+               os=-mingw32
+               ;;
        xps | xps100)
                basic_machine=xps100-honeywell
                ;;
@@ -1059,6 +1071,9 @@ case $basic_machine in
        romp)
                basic_machine=romp-ibm
                ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
        rs6000)
                basic_machine=rs6000-ibm
                ;;
@@ -1167,7 +1182,7 @@ case $os in
              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* | -skyos*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1294,6 +1309,9 @@ case $os in
        -kaos*)
                os=-kaos
                ;;
+       -zvmoe)
+               os=-zvmoe
+               ;;
        -none)
                ;;
        *)
@@ -1374,6 +1392,9 @@ case $basic_machine in
        *-ibm)
                os=-aix
                ;;
+       *-knuth)
+               os=-mmixware
+               ;;
        *-wec)
                os=-proelf
                ;;
@@ -1539,7 +1560,7 @@ case $basic_machine in
 esac
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
index d08ac9d..f452093 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59a.
+# Generated by GNU Autoconf 2.59b.
 #
 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
 # 2003, 2004 Free Software Foundation, Inc.
@@ -17,9 +17,11 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  setopt NO_GLOB_SUBST
+elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
 
@@ -72,12 +74,14 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+  { echo "$as_me: error: cannot find myself; rerun with an absolute file name" >&2
    { (exit 1); exit 1; }; }
 fi
 
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -91,7 +95,7 @@ do
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
@@ -183,7 +187,7 @@ test \$exitcode = 0) || { (exit 1); exit 1; }
 ") 2> /dev/null; then
   :
 else
-  as_candidate_shells="$SHELL"
+  as_candidate_shells=
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
@@ -198,7 +202,7 @@ do
 done
 
 
-      for as_shell in $as_candidate_shells; do
+      for as_shell in $as_candidate_shells $SHELL; do
         if { $as_shell 2> /dev/null <<\_ASEOF
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -207,9 +211,11 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  setopt NO_GLOB_SUBST
+elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
 :
@@ -225,9 +231,11 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  setopt NO_GLOB_SUBST
+elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
 :
@@ -291,8 +299,9 @@ fi
       done
 
       if test "x$CONFIG_SHELL" != x; then
-  $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-        $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
         export CONFIG_SHELL
         exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
@@ -501,7 +510,7 @@ fi
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 if test -z "$ECHO"; then
 if test "X${echo_test_string+set}" != Xset; then
@@ -727,6 +736,7 @@ infodir='${prefix}/info'
 mandir='${prefix}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
@@ -740,7 +750,9 @@ do
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -1031,7 +1043,7 @@ if test -n "$ac_prev"; then
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute paths.
+# Be sure to have absolute directory names.
 for ac_var in exec_prefix prefix
 do
   eval ac_val=$`echo $ac_var`
@@ -1042,7 +1054,7 @@ do
   esac
 done
 
-# Be sure to have absolute paths.
+# Be sure to have absolute directory names.
 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
              localstatedir libdir includedir oldincludedir infodir mandir
 do
@@ -1303,15 +1315,15 @@ case $srcdir in
     else
        ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
     fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
     ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
+  *) # Relative name.
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
+# Do not use `cd foo && pwd` to compute absolute names, because
 # the directories may not exist.
 case `pwd` in
 .) ac_abs_builddir="$ac_dir";;
@@ -1365,7 +1377,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -1386,7 +1398,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.59a.  Invocation command line was
+generated by GNU Autoconf 2.59b.  Invocation command line was
 
   $ $0 $@
 
@@ -1720,7 +1732,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='9:7:3'
+version_info='9:8:3'
 
 ft_version=`echo $version_info | tr : .`
 
@@ -2233,28 +2245,39 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
 echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
 if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
+  # Be careful to initialize this variable, since it used to be cached.
 # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
 ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+for ac_file in $ac_files
 do
   test -f "$ac_file" || continue
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
        ;;
-    conftest.$ac_ext )
-       # This is the source file.
-       ;;
     [ab].out )
        # We found the default executable, but exeext='' is most
        # certainly right.
@@ -2472,13 +2495,103 @@ echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
 echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2520,10 +2633,14 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cc_g=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
 echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
@@ -3202,10 +3319,10 @@ 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.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # 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 path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
@@ -3232,9 +3349,9 @@ esac
 
 
 
-echo "$as_me:$LINENO: checking for grep that handles long lines" >&5
-echo $ECHO_N "checking for grep that handles long lines... $ECHO_C" >&6
-if test "${oc_cv_path_GREP+set}" = set; then
+echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6
+if test "${ac_cv_path_GREP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   # Extract the first word of "grep ggrep" to use in msg output
@@ -3264,9 +3381,11 @@ $debug ||
    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
    { (exit 1); exit 1; }
 }
+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
+as_dummy="$PATH:/usr/xpg4/bin"
+for as_dir in $as_dummy
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
@@ -3274,16 +3393,12 @@ 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" || continue
-    if $as_executable_p "$ac_path_GREP"; then
+    $ac_path_GREP_found || if $as_executable_p "$ac_path_GREP"; then
   # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 if "$ac_path_GREP" --version 2>&1 < /dev/null | grep 'GNU' >/dev/null; then
-  ac_cv_path_GREP="$ac_path_GREP"
-    break 2
-
-fi
-
-
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:
+else
   ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >"$tmp/conftest.in"
   while :
@@ -3292,21 +3407,25 @@ fi
     mv "$tmp/conftest.tmp" "$tmp/conftest.in"
     cp "$tmp/conftest.in" "$tmp/conftest.nl"
     echo 'GREP' >> "$tmp/conftest.nl"
-    "$ac_path_GREP" 'GREP$' < "$tmp/conftest.nl" >"$tmp/conftest.out" || break
-   diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "$tmp/conftest.nl" >"$tmp/conftest.out" 2>/dev/null || break
+    diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
-    if test $ac_count -gt ${ac_max-0}; then
+    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_max=$ac_count
+      ac_path_GREP_max=$ac_count
     fi
     # 10*(2^10) chars as input seems more than enough
     test $ac_count -gt 10 && break
   done
 fi
 
+fi
+
+    $ac_path_GREP_found && break 3
   done
 done
+
 done
 
 rm -rf "$tmp"
@@ -3315,8 +3434,8 @@ fi
 
 GREP="$ac_cv_path_GREP"
 if test -z "$GREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;}
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -3324,8 +3443,8 @@ fi
 
 
 fi
-echo "$as_me:$LINENO: result: $oc_cv_path_GREP" >&5
-echo "${ECHO_T}$oc_cv_path_GREP" >&6
+echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6
  GREP="$ac_cv_path_GREP"
 
 
@@ -3364,9 +3483,11 @@ $debug ||
    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
    { (exit 1); exit 1; }
 }
+ac_path_EGREP_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
+as_dummy="$PATH:/usr/xpg4/bin"
+for as_dir in $as_dummy
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
@@ -3374,16 +3495,12 @@ 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" || continue
-    if $as_executable_p "$ac_path_EGREP"; then
+    $ac_path_EGREP_found || if $as_executable_p "$ac_path_EGREP"; then
   # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 if "$ac_path_EGREP" --version 2>&1 < /dev/null | grep 'GNU' >/dev/null; then
-  ac_cv_path_EGREP="$ac_path_EGREP"
-    break 2
-
-fi
-
-
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:
+else
   ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >"$tmp/conftest.in"
   while :
@@ -3392,21 +3509,25 @@ fi
     mv "$tmp/conftest.tmp" "$tmp/conftest.in"
     cp "$tmp/conftest.in" "$tmp/conftest.nl"
     echo 'EGREP' >> "$tmp/conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "$tmp/conftest.nl" >"$tmp/conftest.out" || break
-   diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
+    "$ac_path_EGREP" 'EGREP$' < "$tmp/conftest.nl" >"$tmp/conftest.out" 2>/dev/null || break
+    diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
-    if test $ac_count -gt ${ac_max-0}; then
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_max=$ac_count
+      ac_path_EGREP_max=$ac_count
     fi
     # 10*(2^10) chars as input seems more than enough
     test $ac_count -gt 10 && break
   done
 fi
 
+fi
+
+    $ac_path_EGREP_found && break 3
   done
 done
+
 done
 
 rm -rf "$tmp"
@@ -3415,8 +3536,8 @@ fi
 
 EGREP="$ac_cv_path_EGREP"
 if test -z "$EGREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;}
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -3539,6 +3660,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* 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))
@@ -3558,7 +3680,7 @@ main ()
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
        || toupper (i) != TOUPPER (i))
-      exit(2);
+      exit (2);
   exit (0);
 }
 _ACEOF
@@ -4267,8 +4389,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-long longval () { return (long int) (sizeof (int)); }
-unsigned long ulongval () { return (long int) (sizeof (int)); }
+long int longval () { return (long int) (sizeof (int)); }
+unsigned long int ulongval () { return (long int) (sizeof (int)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -4280,14 +4402,14 @@ main ()
     exit (1);
   if (((long int) (sizeof (int))) < 0)
     {
-      long i = longval ();
+      long int i = longval ();
       if (i != ((long int) (sizeof (int))))
        exit (1);
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
+      unsigned long int i = ulongval ();
       if (i != ((long int) (sizeof (int))))
        exit (1);
       fprintf (f, "%lu\n", i);
@@ -4673,8 +4795,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-long longval () { return (long int) (sizeof (long)); }
-unsigned long ulongval () { return (long int) (sizeof (long)); }
+long int longval () { return (long int) (sizeof (long)); }
+unsigned long int ulongval () { return (long int) (sizeof (long)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -4686,14 +4808,14 @@ main ()
     exit (1);
   if (((long int) (sizeof (long))) < 0)
     {
-      long i = longval ();
+      long int i = longval ();
       if (i != ((long int) (sizeof (long))))
        exit (1);
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
+      unsigned long int i = ulongval ();
       if (i != ((long int) (sizeof (long))))
        exit (1);
       fprintf (f, "%lu\n", i);
@@ -5117,7 +5239,7 @@ main ()
   data2 = (char *) malloc (2 * pagesize);
   if (!data2)
     exit (1);
-  data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
+  data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
   if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
                     MAP_PRIVATE | MAP_FIXED, fd, 0L))
     exit (1);
@@ -5771,7 +5893,7 @@ lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && break
+  test ! -f $lt_ac_sed && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -5796,10 +5918,10 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
     fi
   done
 done
-SED=$lt_cv_path_SED
 
 fi
 
+SED=$lt_cv_path_SED
 echo "$as_me:$LINENO: result: $SED" >&5
 echo "${ECHO_T}$SED" >&6
 
@@ -5925,6 +6047,15 @@ case $reload_flag in
 *) reload_flag=" $reload_flag" ;;
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
 
 echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
@@ -6011,7 +6142,7 @@ beos*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-bsdi4*)
+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
@@ -6034,13 +6165,13 @@ darwin* | rhapsody*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-freebsd* | kfreebsd*-gnu)
+freebsd* | kfreebsd*-gnu | 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)/i[3-9]86 (compact )?demand paged shared library'
+      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.*`
       ;;
@@ -6084,15 +6215,6 @@ irix5* | irix6* | nonstopux*)
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -6115,12 +6237,10 @@ nto-qnx*)
   ;;
 
 openbsd*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   fi
   ;;
 
@@ -6212,7 +6332,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6215 "configure"' > conftest.$ac_ext
+  echo '#line 6335 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -6709,13 +6829,16 @@ echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
 GXX=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="-g"
 echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cxx_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6757,9 +6880,100 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cxx_g=no
+CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+        CXXFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
 fi
 echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
@@ -6890,7 +7104,12 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-ac_ext=cc
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cc
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -7120,13 +7339,15 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
+fi
+
 
 ac_ext=f
 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
 if test -n "$ac_tool_prefix"; then
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran
   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
@@ -7168,7 +7389,7 @@ fi
 fi
 if test -z "$F77"; then
   ac_ct_F77=$F77
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -7225,7 +7446,7 @@ fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:7228:" \
+echo "$as_me:7449:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -7415,11 +7636,38 @@ else
     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 *BSD
+    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`
+    ;;
+  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
+    ;;
+  *)
     # 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"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
               = "XX$teststring") >/dev/null 2>&1 &&
            new_result=`expr "X$teststring" : ".*" 2>&1` &&
            lt_cv_sys_max_cmd_len=$new_result &&
@@ -7465,9 +7713,6 @@ symcode='[BCDEGRST]'
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
 
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
 # Transform an extracted symbol line into a proper C declaration
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
@@ -7489,6 +7734,13 @@ hpux*) # Its linker distinguishes data from code symbols
   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
   lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
   ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
 irix* | nonstopux*)
   symcode='[BCDEGRST]'
   ;;
@@ -7520,8 +7772,11 @@ esac
 # Try without a prefix undercore, 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.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[      ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[      ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -7683,7 +7938,7 @@ esac
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
+Xsed='sed -e 1s/^X//'
 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
 
 # Same as above, but do not quote variable references.
@@ -8021,6 +8276,17 @@ if test -n "$RANLIB"; then
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
 file_magic*)
@@ -8207,6 +8473,20 @@ LTCC=${LTCC-"$CC"}
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 #
 # Check for any special shared library compilation flags.
 #
@@ -8248,6 +8528,11 @@ else
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
      else
        lt_prog_compiler_static_works=yes
      fi
@@ -8292,15 +8577,17 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8295: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8580: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8299: \$? = $ac_status" >&5
+   echo "$as_me:8584: \$? = $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
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
@@ -8403,6 +8690,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
 
     mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
@@ -8438,12 +8735,19 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       ;;
 
     linux*)
-      case $CC in
+      case $cc_basename in
       icc* | ecc*)
        lt_prog_compiler_wl='-Wl,'
        lt_prog_compiler_pic='-KPIC'
        lt_prog_compiler_static='-static'
         ;;
+      pgcc* | pgf77* | pgf90*)
+        # 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='-static'
+        ;;
       ccc*)
         lt_prog_compiler_wl='-Wl,'
         # All Alpha code is PIC.
@@ -8464,9 +8768,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       ;;
 
     solaris*)
-      lt_prog_compiler_wl='-Wl,'
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -8488,6 +8797,11 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       fi
       ;;
 
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
     uts4*)
       lt_prog_compiler_pic='-pic'
       lt_prog_compiler_static='-Bstatic'
@@ -8525,15 +8839,17 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8528: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8842: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8532: \$? = $ac_status" >&5
+   echo "$as_me:8846: \$? = $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
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works=yes
      fi
    fi
@@ -8585,16 +8901,18 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8588: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8904: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8592: \$? = $ac_status" >&5
+   echo "$as_me:8908: \$? = $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
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
      fi
    fi
@@ -8674,6 +8992,16 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -8694,6 +9022,27 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
     # 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>/dev/null` in
+      *\ [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
     aix3* | aix4* | aix5*)
@@ -8744,7 +9093,7 @@ EOF
       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 '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
@@ -8762,6 +9111,37 @@ EOF
       fi
       ;;
 
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       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; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* )                       # 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; $echo \"$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' ;;
+       esac
+       archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      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'
@@ -8800,31 +9180,6 @@ EOF
       hardcode_shlibpath_var=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_cmds="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 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
-      if test $supports_anon_versioning = yes; 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 -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        archive_expsym_cmds="$tmp_archive_cmds"
-      fi
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -8835,16 +9190,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
     esac
 
-    if test "$ld_shlibs" = yes; then
-      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
+    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)
@@ -8908,7 +9258,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       link_all_deplibs=yes
 
       if test "$GCC" = yes; then
-       case $host_os in aix4.012|aix4.012.*)
+       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`
@@ -8929,6 +9279,9 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
          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
@@ -9089,7 +9442,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ld_shlibs=no
       ;;
 
-    bsdi4*)
+    bsdi[45]*)
       export_dynamic_flag_spec=-rdynamic
       ;;
 
@@ -9115,52 +9468,52 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     darwin* | rhapsody*)
-    if test "$GXX" = yes ; then
-      archive_cmds_need_lc=no
       case "$host_os" in
-      rhapsody* | darwin1.[012])
-       allow_undefined_flag='-undefined suppress'
-       ;;
-      *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-       allow_undefined_flag='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-       ;;
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
       esac
-       lt_int_apple_cc_single_mod=no
-       output_verbose_link_cmd='echo'
-       if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-         lt_int_apple_cc_single_mod=yes
-       fi
-       if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-         archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-       else
-        archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      fi
-      module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        else
-          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        fi
-          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      archive_cmds_need_lc=no
       hardcode_direct=no
       hardcode_automatic=yes
       hardcode_shlibpath_var=unsupported
-      whole_archive_flag_spec='-all_load $convenience'
+      whole_archive_flag_spec=''
       link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
-      ld_shlibs=no
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
     fi
       ;;
 
@@ -9194,7 +9547,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
@@ -9305,6 +9658,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var=no
       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
@@ -9350,7 +9704,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        allow_undefined_flag=' -expect_unresolved \*'
        archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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'
@@ -9369,10 +9723,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     solaris*)
       no_undefined_flag=' -z text'
       if test "$GCC" = yes; then
+       wlarc='${wl}'
        archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+       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'
@@ -9381,8 +9737,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
       esac
       link_all_deplibs=yes
       ;;
@@ -9656,7 +10022,7 @@ beos*)
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -9714,7 +10080,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -9772,7 +10138,9 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
@@ -9791,7 +10159,7 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -9917,7 +10285,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -9980,7 +10348,11 @@ nto-qnx*)
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  need_version=yes
+  # 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
@@ -10102,8 +10474,8 @@ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var " || \
-   test "X$hardcode_automatic"="Xyes" ; then
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$hardcode_direct" != no &&
@@ -10769,7 +11141,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10772 "configure"
+#line 11144 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10867,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10870 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10995,43 +11367,6 @@ aix3*)
 aix4* | aix5*)
   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
     test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-  darwin* | rhapsody*)
-  if test "$GCC" = yes; then
-    archive_cmds_need_lc=no
-    case "$host_os" in
-    rhapsody* | darwin1.[012])
-      allow_undefined_flag='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-       allow_undefined_flag='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-      ;;
-    esac
-    output_verbose_link_cmd='echo'
-    archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
-    module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-    archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    hardcode_direct=no
-    hardcode_automatic=yes
-    hardcode_shlibpath_var=unsupported
-    whole_archive_flag_spec='-all_load $convenience'
-    link_all_deplibs=yes
-  else
-    ld_shlibs=no
   fi
     ;;
 esac
@@ -11162,7 +11497,7 @@ echo "$as_me: creating $ofile" >&6;}
 #
 # 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.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -11173,11 +11508,11 @@ echo "$as_me: creating $ofile" >&6;}
 SED=$lt_SED
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e s/^X//"
+Xsed="$SED -e 1s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 # The names of the tagged configurations supported by this script.
 available_tags=
@@ -11207,6 +11542,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -11283,7 +11624,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -11578,7 +11919,9 @@ echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
 
       case $tagname in
       CXX)
-       if test -n "$CXX" && test "X$CXX" != "Xno"; then
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
          ac_ext=cc
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -11636,6 +11979,20 @@ LTCC=${LTCC-"$CC"}
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC=$CC
 lt_save_LD=$LD
@@ -11657,7 +12014,16 @@ test -z "${LDCXX+set}" || LD=$LDCXX
 CC=${CXX-"c++"}
 compiler=$CC
 compiler_CXX=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 
 # We don't want -fno-exception wen compiling C++ code, so set the
 # no_builtin_flag separately
@@ -11871,7 +12237,7 @@ case $host_os in
     link_all_deplibs_CXX=yes
 
     if test "$GXX" = yes; then
-      case $host_os in aix4.012|aix4.012.*)
+      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`
@@ -11892,6 +12258,9 @@ case $host_os in
        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
@@ -12053,6 +12422,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     esac
     ;;
 
+
   cygwin* | mingw* | pw32*)
     # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
     # as there is no search path for DLLs.
@@ -12076,65 +12446,76 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ld_shlibs_CXX=no
     fi
   ;;
+      darwin* | rhapsody*)
+        case "$host_os" in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
 
-  darwin* | rhapsody*)
-  if test "$GXX" = yes; then
-    archive_cmds_need_lc_CXX=no
-    case "$host_os" in
-    rhapsody* | darwin1.[012])
-      allow_undefined_flag_CXX='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-       allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag_CXX='-undefined dynamic_lookup'
-            ;;
-        esac
+          archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
       fi
-      ;;
-    esac
-    lt_int_apple_cc_single_mod=no
-    output_verbose_link_cmd='echo'
-    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-      lt_int_apple_cc_single_mod=yes
-    fi
-    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-      archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    else
-      archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    fi
-    module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-
-    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    hardcode_direct_CXX=no
-    hardcode_automatic_CXX=yes
-    hardcode_shlibpath_var_CXX=unsupported
-    whole_archive_flag_spec_CXX='-all_load $convenience'
-    link_all_deplibs_CXX=yes
-  else
-    ld_shlibs_CXX=no
-  fi
-    ;;
+        ;;
 
   dgux*)
     case $cc_basename in
-      ec++)
+      ec++*)
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
        ;;
-      ghcx)
+      ghcx*)
        # Green Hills C++ Compiler
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
@@ -12145,14 +12526,14 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        ;;
     esac
     ;;
-  freebsd12*)
+  freebsd[12]*)
     # C++ shared libraries reported to be fairly broken before switch to ELF
     ld_shlibs_CXX=no
     ;;
   freebsd-elf*)
     archive_cmds_need_lc_CXX=no
     ;;
-  freebsd* | kfreebsd*-gnu)
+  freebsd* | kfreebsd*-gnu | dragonfly*)
     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
     # conventions
     ld_shlibs_CXX=yes
@@ -12169,11 +12550,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
                                # location of the library.
 
     case $cc_basename in
-    CC)
+    CC*)
       # FIXME: insert proper C++ library support
       ld_shlibs_CXX=no
       ;;
-    aCC)
+    aCC*)
       archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
@@ -12183,7 +12564,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -12234,11 +12615,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     esac
 
     case $cc_basename in
-      CC)
+      CC*)
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
        ;;
-      aCC)
+      aCC*)
        case "$host_cpu" in
        hppa*64*|ia64*)
          archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
@@ -12278,9 +12659,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   irix5* | irix6*)
     case $cc_basename in
-      CC)
+      CC*)
        # SGI C++
-       archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+       archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
        # Archives containing C++ object files must be created using
        # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -12291,7 +12672,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       *)
        if test "$GXX" = yes; then
          if test "$with_gnu_ld" = no; then
-           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
          else
            archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
          fi
@@ -12304,7 +12685,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   linux*)
     case $cc_basename in
-      KCC)
+      KCC*)
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
        # KCC will only create a shared library if the output file
@@ -12329,17 +12710,41 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        # "CC -Bstatic", where "CC" is the KAI C++ compiler.
        old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
        ;;
-      icpc)
+      icpc*)
        # Intel C++
        with_gnu_ld=yes
+       # version 8.0 and above of icpc choke on multiply defined symbols
+       # if we add $predep_objects and $postdep_objects, however 7.1 and
+       # earlier do not add the objects themselves.
+       case `$CC -V 2>&1` in
+       *"Version 7."*)
+         archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       *)  # Version 8.0 or newer
+         tmp_idyn=
+         case $host_cpu in
+           ia64*) tmp_idyn=' -i_dynamic';;
+         esac
+         archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       esac
        archive_cmds_need_lc_CXX=no
-       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
        hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
        whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
        ;;
-      cxx)
+      pgCC*)
+        # Portland Group C++ compiler
+       archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+       whole_archive_flag_spec_CXX='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
        # Compaq C++
        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
        archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
@@ -12370,7 +12775,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   mvs*)
     case $cc_basename in
-      cxx)
+      cxx*)
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
        ;;
@@ -12391,9 +12796,25 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     # Workaround some broken pre-1.5 toolchains
     output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
     ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
   osf3*)
     case $cc_basename in
-      KCC)
+      KCC*)
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
        # KCC will only create a shared library if the output file
@@ -12409,14 +12830,14 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
 
        ;;
-      RCC)
+      RCC*)
        # Rational C++ 2.4.1
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
        ;;
-      cxx)
+      cxx*)
        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
        hardcode_libdir_separator_CXX=:
@@ -12434,7 +12855,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       *)
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
          allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-         archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+         archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
          hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
          hardcode_libdir_separator_CXX=:
@@ -12453,7 +12874,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   osf4* | osf5*)
     case $cc_basename in
-      KCC)
+      KCC*)
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
        # KCC will only create a shared library if the output file
@@ -12468,17 +12889,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        # the KAI C++ compiler.
        old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
        ;;
-      RCC)
+      RCC*)
        # Rational C++ 2.4.1
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
        ;;
-      cxx)
+      cxx*)
        allow_undefined_flag_CXX=' -expect_unresolved \*'
-       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
          echo "-hidden">> $lib.exp~
-         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
          $rm $lib.exp'
 
        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
@@ -12497,7 +12918,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       *)
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
          allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-        archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+        archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
          hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
          hardcode_libdir_separator_CXX=:
@@ -12521,7 +12942,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
   sco*)
     archive_cmds_need_lc_CXX=no
     case $cc_basename in
-      CC)
+      CC*)
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
        ;;
@@ -12533,12 +12954,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   sunos4*)
     case $cc_basename in
-      CC)
+      CC*)
        # Sun C++ 4.x
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
        ;;
-      lcc)
+      lcc*)
        # Lucid
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
@@ -12551,7 +12972,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   solaris*)
     case $cc_basename in
-      CC)
+      CC*)
        # Sun C++ 4.2, 5.x and Centerline C++
        no_undefined_flag_CXX=' -zdefs'
        archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
@@ -12561,13 +12982,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        hardcode_libdir_flag_spec_CXX='-R$libdir'
        hardcode_shlibpath_var_CXX=no
        case $host_os in
-         solaris2.0-5 | solaris2.0-5.*) ;;
+         solaris2.[0-5] | solaris2.[0-5].*) ;;
          *)
            # The C++ compiler is used as linker so we must use $wl
            # flag to pass the commands to the underlying system
-           # linker.
+           # linker. We must also pass each convience library through
+           # to the system linker between allextract/defaultextract.
+           # The C++ compiler will combine linker options so we
+           # cannot just pass the convience library names through
+           # without $wl.
            # Supported since Solaris 2.6 (maybe 2.5.1?)
-           whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+           whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
            ;;
        esac
        link_all_deplibs_CXX=yes
@@ -12588,7 +13013,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        # in the archive.
        old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
        ;;
-      gcx)
+      gcx*)
        # Green Hills C++ Compiler
        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
@@ -12631,7 +13056,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ;;
   tandem*)
     case $cc_basename in
-      NCC)
+      NCC*)
        # NonStop-UX NCC 3.20
        # FIXME: insert proper C++ library support
        ld_shlibs_CXX=no
@@ -12840,18 +13265,28 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       chorus*)
        case $cc_basename in
-       cxch68)
+       cxch68*)
          # Green Hills C++ Compiler
          # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
          ;;
        esac
        ;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
       dgux*)
        case $cc_basename in
-         ec++)
+         ec++*)
            lt_prog_compiler_pic_CXX='-KPIC'
            ;;
-         ghcx)
+         ghcx*)
            # Green Hills C++ Compiler
            lt_prog_compiler_pic_CXX='-pic'
            ;;
@@ -12859,19 +13294,19 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
            ;;
        esac
        ;;
-      freebsd* | kfreebsd*-gnu)
+      freebsd* | kfreebsd*-gnu | dragonfly*)
        # FreeBSD uses GNU C++
        ;;
       hpux9* | hpux10* | hpux11*)
        case $cc_basename in
-         CC)
+         CC*)
            lt_prog_compiler_wl_CXX='-Wl,'
            lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
            if test "$host_cpu" != ia64; then
              lt_prog_compiler_pic_CXX='+Z'
            fi
            ;;
-         aCC)
+         aCC*)
            lt_prog_compiler_wl_CXX='-Wl,'
            lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
            case "$host_cpu" in
@@ -12889,7 +13324,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       irix5* | irix6* | nonstopux*)
        case $cc_basename in
-         CC)
+         CC*)
            lt_prog_compiler_wl_CXX='-Wl,'
            lt_prog_compiler_static_CXX='-non_shared'
            # CC pic flag -KPIC is the default.
@@ -12900,18 +13335,24 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       linux*)
        case $cc_basename in
-         KCC)
+         KCC*)
            # KAI C++ Compiler
            lt_prog_compiler_wl_CXX='--backend -Wl,'
            lt_prog_compiler_pic_CXX='-fPIC'
            ;;
-         icpc)
+         icpc* | ecpc*)
            # Intel C++
            lt_prog_compiler_wl_CXX='-Wl,'
            lt_prog_compiler_pic_CXX='-KPIC'
            lt_prog_compiler_static_CXX='-static'
            ;;
-         cxx)
+         pgCC*)
+           # Portland Group C++ compiler.
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-fpic'
+           lt_prog_compiler_static_CXX='-static'
+           ;;
+         cxx*)
            # Compaq C++
            # Make sure the PIC flag is empty.  It appears that all Alpha
            # Linux and Compaq Tru64 Unix objects are PIC.
@@ -12928,7 +13369,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       mvs*)
        case $cc_basename in
-         cxx)
+         cxx*)
            lt_prog_compiler_pic_CXX='-W c,exportall'
            ;;
          *)
@@ -12939,14 +13380,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       osf3* | osf4* | osf5*)
        case $cc_basename in
-         KCC)
+         KCC*)
            lt_prog_compiler_wl_CXX='--backend -Wl,'
            ;;
-         RCC)
+         RCC*)
            # Rational C++ 2.4.1
            lt_prog_compiler_pic_CXX='-pic'
            ;;
-         cxx)
+         cxx*)
            # Digital/Compaq C++
            lt_prog_compiler_wl_CXX='-Wl,'
            # Make sure the PIC flag is empty.  It appears that all Alpha
@@ -12962,7 +13403,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       sco*)
        case $cc_basename in
-         CC)
+         CC*)
            lt_prog_compiler_pic_CXX='-fPIC'
            ;;
          *)
@@ -12971,13 +13412,13 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       solaris*)
        case $cc_basename in
-         CC)
+         CC*)
            # Sun C++ 4.2, 5.x and Centerline C++
            lt_prog_compiler_pic_CXX='-KPIC'
            lt_prog_compiler_static_CXX='-Bstatic'
            lt_prog_compiler_wl_CXX='-Qoption ld '
            ;;
-         gcx)
+         gcx*)
            # Green Hills C++ Compiler
            lt_prog_compiler_pic_CXX='-PIC'
            ;;
@@ -12987,12 +13428,12 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       sunos4*)
        case $cc_basename in
-         CC)
+         CC*)
            # Sun C++ 4.x
            lt_prog_compiler_pic_CXX='-pic'
            lt_prog_compiler_static_CXX='-Bstatic'
            ;;
-         lcc)
+         lcc*)
            # Lucid
            lt_prog_compiler_pic_CXX='-pic'
            ;;
@@ -13002,7 +13443,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        ;;
       tandem*)
        case $cc_basename in
-         NCC)
+         NCC*)
            # NonStop-UX NCC 3.20
            lt_prog_compiler_pic_CXX='-KPIC'
            ;;
@@ -13046,15 +13487,17 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13049: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13490: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13053: \$? = $ac_status" >&5
+   echo "$as_me:13494: \$? = $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
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works_CXX=yes
      fi
    fi
@@ -13106,16 +13549,18 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13109: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13552: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13113: \$? = $ac_status" >&5
+   echo "$as_me:13556: \$? = $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
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_CXX=yes
      fi
    fi
@@ -13174,7 +13619,7 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
     export_symbols_cmds_CXX="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
@@ -13354,7 +13799,7 @@ beos*)
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -13412,7 +13857,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -13470,7 +13915,9 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
@@ -13489,7 +13936,7 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -13615,7 +14062,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -13678,7 +14125,11 @@ nto-qnx*)
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  need_version=yes
+  # 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
@@ -13800,8 +14251,8 @@ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
 hardcode_action_CXX=
 if test -n "$hardcode_libdir_flag_spec_CXX" || \
-   test -n "$runpath_var CXX" || \
-   test "X$hardcode_automatic_CXX"="Xyes" ; then
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$hardcode_direct_CXX" != no &&
@@ -14467,7 +14918,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 14470 "configure"
+#line 14921 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14565,7 +15016,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 14568 "configure"
+#line 15019 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14783,6 +15234,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -14859,7 +15316,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -15140,12 +15597,35 @@ LTCC=${LTCC-"$CC"}
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${F77-"f77"}
 compiler=$CC
 compiler_F77=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 
 echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
@@ -15167,7 +15647,9 @@ aix3*)
   fi
   ;;
 aix4* | aix5*)
-  test "$enable_shared" = yes && enable_static=no
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
   ;;
 esac
 echo "$as_me:$LINENO: result: $enable_shared" >&5
@@ -15270,6 +15752,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
 
     mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
@@ -15305,12 +15797,19 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       ;;
 
     linux*)
-      case $CC in
+      case $cc_basename in
       icc* | ecc*)
        lt_prog_compiler_wl_F77='-Wl,'
        lt_prog_compiler_pic_F77='-KPIC'
        lt_prog_compiler_static_F77='-static'
         ;;
+      pgcc* | pgf77* | pgf90*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_F77='-Wl,'
+       lt_prog_compiler_pic_F77='-fpic'
+       lt_prog_compiler_static_F77='-static'
+        ;;
       ccc*)
         lt_prog_compiler_wl_F77='-Wl,'
         # All Alpha code is PIC.
@@ -15331,9 +15830,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       ;;
 
     solaris*)
-      lt_prog_compiler_wl_F77='-Wl,'
       lt_prog_compiler_pic_F77='-KPIC'
       lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl_F77='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -15355,6 +15859,11 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       fi
       ;;
 
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
     uts4*)
       lt_prog_compiler_pic_F77='-pic'
       lt_prog_compiler_static_F77='-Bstatic'
@@ -15392,15 +15901,17 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15395: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15904: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15399: \$? = $ac_status" >&5
+   echo "$as_me:15908: \$? = $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
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works_F77=yes
      fi
    fi
@@ -15452,16 +15963,18 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15455: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15966: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15459: \$? = $ac_status" >&5
+   echo "$as_me:15970: \$? = $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
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_F77=yes
      fi
    fi
@@ -15541,6 +16054,16 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -15561,6 +16084,27 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
     # 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_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [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
     aix3* | aix4* | aix5*)
@@ -15611,7 +16155,7 @@ EOF
       allow_undefined_flag_F77=unsupported
       always_export_symbols_F77=no
       enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
@@ -15625,7 +16169,38 @@ EOF
        fi~
        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
       else
-       ld_shlibs=no
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* )                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
+       esac
+       archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       ld_shlibs_F77=no
       fi
       ;;
 
@@ -15667,31 +16242,6 @@ EOF
       hardcode_shlibpath_var_F77=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_cmds_F77="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 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
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        archive_expsym_cmds_F77="$tmp_archive_cmds"
-      fi
-    else
-      ld_shlibs_F77=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -15702,16 +16252,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
     esac
 
-    if test "$ld_shlibs_F77" = yes; then
-      runpath_var=LD_RUN_PATH
-      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
-      export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       whole_archive_flag_spec_F77=
-      fi
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -15775,7 +16320,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       link_all_deplibs_F77=yes
 
       if test "$GCC" = yes; then
-       case $host_os in aix4.012|aix4.012.*)
+       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`
@@ -15796,6 +16341,9 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
          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
@@ -15936,7 +16484,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ld_shlibs_F77=no
       ;;
 
-    bsdi4*)
+    bsdi[45]*)
       export_dynamic_flag_spec_F77=-rdynamic
       ;;
 
@@ -15957,57 +16505,57 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       old_archive_From_new_cmds_F77='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_F77=yes
       ;;
 
     darwin* | rhapsody*)
-    if test "$GXX" = yes ; then
-      archive_cmds_need_lc_F77=no
       case "$host_os" in
-      rhapsody* | darwin1.[012])
-       allow_undefined_flag_F77='-undefined suppress'
-       ;;
-      *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-       allow_undefined_flag_F77='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag_F77='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag_F77='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-       ;;
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
       esac
-       lt_int_apple_cc_single_mod=no
-       output_verbose_link_cmd='echo'
-       if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-         lt_int_apple_cc_single_mod=yes
-       fi
-       if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-         archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-       else
-        archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      fi
-      module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        else
-          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        fi
-          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      archive_cmds_need_lc_F77=no
       hardcode_direct_F77=no
       hardcode_automatic_F77=yes
       hardcode_shlibpath_var_F77=unsupported
-      whole_archive_flag_spec_F77='-all_load $convenience'
+      whole_archive_flag_spec_F77=''
       link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
-      ld_shlibs_F77=no
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
     fi
       ;;
 
@@ -16041,7 +16589,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_F77='-R$libdir'
       hardcode_direct_F77=yes
@@ -16152,6 +16700,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var_F77=no
       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
        archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
        hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
        export_dynamic_flag_spec_F77='${wl}-E'
       else
@@ -16197,7 +16746,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        allow_undefined_flag_F77=' -expect_unresolved \*'
        archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
        archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir'
@@ -16216,10 +16765,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     solaris*)
       no_undefined_flag_F77=' -z text'
       if test "$GCC" = yes; then
+       wlarc='${wl}'
        archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
        archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
          $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+       wlarc=''
        archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
        archive_expsym_cmds_F77='$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'
@@ -16228,8 +16779,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var_F77=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-       whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
       esac
       link_all_deplibs_F77=yes
       ;;
@@ -16503,7 +17064,7 @@ beos*)
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -16561,7 +17122,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -16619,7 +17180,9 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
@@ -16638,7 +17201,7 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -16764,7 +17327,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -16827,7 +17390,11 @@ nto-qnx*)
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  need_version=yes
+  # 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
@@ -16949,8 +17516,8 @@ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
 hardcode_action_F77=
 if test -n "$hardcode_libdir_flag_spec_F77" || \
-   test -n "$runpath_var F77" || \
-   test "X$hardcode_automatic_F77"="Xyes" ; then
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$hardcode_direct_F77" != no &&
@@ -17127,6 +17694,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -17203,7 +17776,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -17440,7 +18013,7 @@ objext_GCJ=$objext
 lt_simple_compile_test_code="class foo {}\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
@@ -17451,15 +18024,41 @@ LTCC=${LTCC-"$CC"}
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${GCJ-"gcj"}
 compiler=$CC
 compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
 archive_cmds_need_lc_GCJ=no
 
+old_archive_cmds_GCJ=$old_archive_cmds
+
 
 lt_prog_compiler_no_builtin_flag_GCJ=
 
@@ -17485,15 +18084,17 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17488: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18087: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17492: \$? = $ac_status" >&5
+   echo "$as_me:18091: \$? = $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
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
@@ -17596,6 +18197,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
        lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
 
     mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
@@ -17631,12 +18242,19 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       ;;
 
     linux*)
-      case $CC in
+      case $cc_basename in
       icc* | ecc*)
        lt_prog_compiler_wl_GCJ='-Wl,'
        lt_prog_compiler_pic_GCJ='-KPIC'
        lt_prog_compiler_static_GCJ='-static'
         ;;
+      pgcc* | pgf77* | pgf90*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_GCJ='-Wl,'
+       lt_prog_compiler_pic_GCJ='-fpic'
+       lt_prog_compiler_static_GCJ='-static'
+        ;;
       ccc*)
         lt_prog_compiler_wl_GCJ='-Wl,'
         # All Alpha code is PIC.
@@ -17657,9 +18275,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       ;;
 
     solaris*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
       lt_prog_compiler_pic_GCJ='-KPIC'
       lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -17681,6 +18304,11 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
       fi
       ;;
 
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
     uts4*)
       lt_prog_compiler_pic_GCJ='-pic'
       lt_prog_compiler_static_GCJ='-Bstatic'
@@ -17718,15 +18346,17 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17721: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18349: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17725: \$? = $ac_status" >&5
+   echo "$as_me:18353: \$? = $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
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works_GCJ=yes
      fi
    fi
@@ -17778,16 +18408,18 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17781: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18411: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:17785: \$? = $ac_status" >&5
+   echo "$as_me:18415: \$? = $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
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_GCJ=yes
      fi
    fi
@@ -17867,6 +18499,16 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -17887,6 +18529,27 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
     # 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_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [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
     aix3* | aix4* | aix5*)
@@ -17937,7 +18600,7 @@ EOF
       allow_undefined_flag_GCJ=unsupported
       always_export_symbols_GCJ=no
       enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
@@ -17951,7 +18614,38 @@ EOF
        fi~
        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
       else
-       ld_shlibs=no
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* )                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
+       esac
+       archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       ld_shlibs_GCJ=no
       fi
       ;;
 
@@ -17993,31 +18687,6 @@ EOF
       hardcode_shlibpath_var_GCJ=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_cmds_GCJ="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 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
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        archive_expsym_cmds_GCJ="$tmp_archive_cmds"
-      fi
-    else
-      ld_shlibs_GCJ=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -18028,16 +18697,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       ;;
     esac
 
-    if test "$ld_shlibs_GCJ" = yes; then
-      runpath_var=LD_RUN_PATH
-      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
-      export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       whole_archive_flag_spec_GCJ=
-      fi
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -18101,7 +18765,7 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
       link_all_deplibs_GCJ=yes
 
       if test "$GCC" = yes; then
-       case $host_os in aix4.012|aix4.012.*)
+       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`
@@ -18122,6 +18786,9 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~
          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
@@ -18282,7 +18949,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ld_shlibs_GCJ=no
       ;;
 
-    bsdi4*)
+    bsdi[45]*)
       export_dynamic_flag_spec_GCJ=-rdynamic
       ;;
 
@@ -18303,57 +18970,57 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       old_archive_From_new_cmds_GCJ='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_GCJ=yes
       ;;
 
     darwin* | rhapsody*)
-    if test "$GXX" = yes ; then
-      archive_cmds_need_lc_GCJ=no
       case "$host_os" in
-      rhapsody* | darwin1.[012])
-       allow_undefined_flag_GCJ='-undefined suppress'
-       ;;
-      *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-       allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag_GCJ='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-       ;;
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
       esac
-       lt_int_apple_cc_single_mod=no
-       output_verbose_link_cmd='echo'
-       if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-         lt_int_apple_cc_single_mod=yes
-       fi
-       if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-         archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-       else
-        archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      fi
-      module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        else
-          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        fi
-          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      archive_cmds_need_lc_GCJ=no
       hardcode_direct_GCJ=no
       hardcode_automatic_GCJ=yes
       hardcode_shlibpath_var_GCJ=unsupported
-      whole_archive_flag_spec_GCJ='-all_load $convenience'
+      whole_archive_flag_spec_GCJ=''
       link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
-      ld_shlibs_GCJ=no
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
     fi
       ;;
 
@@ -18387,7 +19054,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | kfreebsd*-gnu | dragonfly*)
       archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_GCJ='-R$libdir'
       hardcode_direct_GCJ=yes
@@ -18498,6 +19165,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var_GCJ=no
       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
        archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
        hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
        export_dynamic_flag_spec_GCJ='${wl}-E'
       else
@@ -18543,7 +19211,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
        allow_undefined_flag_GCJ=' -expect_unresolved \*'
        archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
        archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir'
@@ -18562,10 +19230,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     solaris*)
       no_undefined_flag_GCJ=' -z text'
       if test "$GCC" = yes; then
+       wlarc='${wl}'
        archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
        archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
          $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+       wlarc=''
        archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
        archive_expsym_cmds_GCJ='$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'
@@ -18574,8 +19244,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var_GCJ=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-       whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
       esac
       link_all_deplibs_GCJ=yes
       ;;
@@ -18849,7 +19529,7 @@ beos*)
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -18907,7 +19587,7 @@ cygwin* | mingw* | pw32*)
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -18965,7 +19645,9 @@ kfreebsd*-gnu)
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd*)
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
@@ -18984,7 +19666,7 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -19110,7 +19792,7 @@ linux*)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -19173,7 +19855,11 @@ nto-qnx*)
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  need_version=yes
+  # 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
@@ -19295,8 +19981,8 @@ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
 hardcode_action_GCJ=
 if test -n "$hardcode_libdir_flag_spec_GCJ" || \
-   test -n "$runpath_var GCJ" || \
-   test "X$hardcode_automatic_GCJ"="Xyes" ; then
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$hardcode_direct_GCJ" != no &&
@@ -19962,7 +20648,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 19965 "configure"
+#line 20651 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -20060,7 +20746,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 20063 "configure"
+#line 20749 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -20278,6 +20964,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -20354,7 +21046,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -20601,11 +21293,35 @@ LTCC=${LTCC-"$CC"}
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${RC-"windres"}
 compiler=$CC
 compiler_RC=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 lt_cv_prog_compiler_c_o_RC=yes
 
 # The else clause should only fire when bootstrapping the
@@ -20722,6 +21438,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -20798,7 +21520,7 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -21219,9 +21941,11 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  setopt NO_GLOB_SUBST
+elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
 
@@ -21274,13 +21998,15 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute file name" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute file name" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -21294,7 +22020,7 @@ do
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
@@ -21443,7 +22169,7 @@ _ASBOX
 cat >&5 <<_CSEOF
 
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59a.  Invocation command line was
+generated by GNU Autoconf 2.59b.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -21503,7 +22229,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.59a,
+configured by $0, generated by GNU Autoconf 2.59b,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright (C) 2004 Free Software Foundation, Inc.
@@ -21862,15 +22588,15 @@ case $srcdir in
     else
        ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
     fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
     ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
+  *) # Relative name.
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
+# Do not use `cd foo && pwd` to compute absolute names, because
 # the directories may not exist.
 case `pwd` in
 .) ac_abs_builddir="$ac_dir";;
@@ -22033,7 +22759,7 @@ echo "$as_me: creating $ac_file" >&6;}
         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-        # Do quote $f, to prevent DOS paths from being IFS'd.
+        # Quote $f, to prevent DOS file names from being IFS'd.
         echo "$f";;
       *) # Relative
         if test -f "$f"; then
index 71a04ce..3105ff3 100644 (file)
@@ -1,6 +1,15 @@
 # This file is part of the FreeType project.
 #
 # Process this file with autoconf to produce a configure script.
+#
+# Copyright 2001, 2002, 2003, 2004, 2005 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 AC_INIT
 AC_CONFIG_SRCDIR([ftconfig.in])
@@ -8,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.in])
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='9:7:3'
+version_info='9:8:3'
 AC_SUBST([version_info])
 ft_version=`echo $version_info | tr : .`
 AC_SUBST([ft_version])
index 9a6ae10..16e15e5 100644 (file)
@@ -1,4 +1,13 @@
 #! /bin/sh
+#
+# Copyright 2000, 2001, 2002, 2003, 2004, 2005 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
@@ -23,6 +32,7 @@ Options:
                          the FreeType library
   --exec-prefix=EPREFIX  override \`--exec-prefix' value with EPREFIX
   --version              display libtool version of the FreeType library
+  --ftversion            display FreeType version number
   --libs                 display flags for linking with the FreeType library
   --libtool              display library name for linking with libtool
   --cflags               display flags for compiling with the FreeType
@@ -65,6 +75,19 @@ while test $# -gt 0 ; do
     echo @ft_version@
     exit 0
     ;;
+  --ftversion)
+    major=`grep define @prefix@/include/freetype2/freetype/freetype.h \
+           | grep FREETYPE_MAJOR \
+           | sed 's/.*[        ]\([0-9][0-9]*\).*/\1/'`
+    minor=`grep define @prefix@/include/freetype2/freetype/freetype.h \
+           | grep FREETYPE_MINOR \
+           | sed 's/.*[        ]\([0-9][0-9]*\).*/\1/'`
+    patch=`grep define @prefix@/include/freetype2/freetype/freetype.h \
+           | grep FREETYPE_PATCH \
+           | sed 's/.*[        ]\([0-9][0-9]*\).*/\1/'`
+    echo $major.$minor.$patch
+    exit 0
+    ;;
   --cflags)
     echo_cflags=yes
     ;;
@@ -119,7 +142,7 @@ if test "$echo_libs" = "yes" ; then
     eval "rpath=\"$hardcode_libdir_flag_spec\""
   fi
   libs="-lfreetype @LIBZ@"
-  if test "$libdir" != "/usr/lib" ; then
+  if test "$libdir" != "/usr/lib" && test "$libdir" != "/usr/lib64"; then
     echo -L$libdir $rpath $libs
   else
     echo $libs
index 7424a32..fc2242f 100644 (file)
@@ -1,6 +1,15 @@
 # Configure paths for FreeType2
 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
 #
+# Copyright 2001, 2003 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+#
 # serial 2
 
 # AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
index 0036ffb..68b3361 100644 (file)
@@ -1,4 +1,13 @@
 ## FreeType specific autoconf tests
+#
+# Copyright 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.
 
 # serial 2
 
index c7a34ad..a3520a8 100644 (file)
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
       
-      stream->base = ft_alloc( NULL, stream->size );
+      stream->base = (unsigned char*)ft_alloc( NULL, stream->size );
       
       if ( !stream->base )
       {
 
         total_read_count += read_count;
 
-      } while ( total_read_count != stream->size );
+      } while ( (unsigned long)total_read_count != stream->size );
 
       stream->close = ft_close_stream_by_free;
     }
index 77bc381..1a83534 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2004-02-15.20
+scriptversion=2005-02-02.21
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -58,9 +58,6 @@ stripprog="${STRIPPROG-strip}"
 rmprog="${RMPROG-rm}"
 mkdirprog="${MKDIRPROG-mkdir}"
 
-transformbasename=
-transform_arg=
-instcmd="$mvprog"
 chmodcmd="$chmodprog 0755"
 chowncmd=
 chgrpcmd=
@@ -70,23 +67,27 @@ mvcmd="$mvprog"
 src=
 dst=
 dir_arg=
+dstarg=
+no_target_directory=
 
-usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 -d DIRECTORIES...
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
 
-In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
-In the second, create the directory path DIR.
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
 
 Options:
--b=TRANSFORMBASENAME
--c         copy source (using $cpprog) instead of moving (using $mvprog).
+-c         (ignored)
 -d         create directories instead of installing files.
--g GROUP   $chgrp installed files to GROUP.
--m MODE    $chmod installed files to MODE.
--o USER    $chown installed files to USER.
--s         strip installed files (using $stripprog).
--t=TRANSFORM
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
 --help     display this help and exit.
 --version  display version info and exit.
 
@@ -96,12 +97,7 @@ Environment variables override the default commands:
 
 while test -n "$1"; do
   case $1 in
-    -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-        shift
-        continue;;
-
-    -c) instcmd=$cpprog
-        shift
+    -c) shift
         continue;;
 
     -d) dir_arg=true
@@ -113,7 +109,7 @@ while test -n "$1"; do
         shift
         continue;;
 
-    --help) echo "$usage"; exit 0;;
+    --help) echo "$usage"; exit $?;;
 
     -m) chmodcmd="$chmodprog $2"
         shift
@@ -129,14 +125,20 @@ while test -n "$1"; do
         shift
         continue;;
 
-    -t=*) transformarg=`echo $1 | sed 's/-t=//'`
-        shift
-        continue;;
+    -t) dstarg=$2
+       shift
+       shift
+       continue;;
+
+    -T) no_target_directory=true
+       shift
+       continue;;
 
-    --version) echo "$0 $scriptversion"; exit 0;;
+    --version) echo "$0 $scriptversion"; exit $?;;
 
     *)  # When -d is used, all remaining arguments are directories to create.
-       test -n "$dir_arg" && break
+       # When -t is used, the destination is already specified.
+       test -n "$dir_arg$dstarg" && break
         # Otherwise, the last argument is the destination.  Remove it from $@.
        for arg
        do
@@ -174,13 +176,13 @@ do
     src=
 
     if test -d "$dst"; then
-      instcmd=:
+      mkdircmd=:
       chmodcmd=
     else
-      instcmd=$mkdirprog
+      mkdircmd=$mkdirprog
     fi
   else
-    # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
     if test ! -f "$src" && test ! -d "$src"; then
@@ -202,12 +204,16 @@ do
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+       echo "$0: $dstarg: Is a directory" >&2
+       exit 1
+      fi
       dst=$dst/`basename "$src"`
     fi
   fi
 
   # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
 
   # Make sure that the destination directory exists.
 
@@ -220,7 +226,8 @@ do
     oIFS=$IFS
     # Some sh's can't handle IFS=/ for some reason.
     IFS='%'
-    set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    shift
     IFS=$oIFS
 
     pathcomp=
@@ -229,83 +236,83 @@ do
       pathcomp=$pathcomp$1
       shift
       if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp" || lasterr=$?
+        $mkdirprog "$pathcomp"
        # mkdir can fail with a `File exist' error in case several
        # install-sh are creating the directory concurrently.  This
        # is OK.
-       test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; }
+       test -d "$pathcomp" || exit
       fi
       pathcomp=$pathcomp/
     done
   fi
 
   if test -n "$dir_arg"; then
-    $doit $instcmd "$dst" \
+    $doit $mkdircmd "$dst" \
       && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
       && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
 
   else
-    # If we're going to rename the final executable, determine the name now.
-    if test -z "$transformarg"; then
-      dstfile=`basename "$dst"`
-    else
-      dstfile=`basename "$dst" $transformbasename \
-               | sed $transformarg`$transformbasename
-    fi
-
-    # don't allow the sed command to completely eliminate the filename.
-    test -z "$dstfile" && dstfile=`basename "$dst"`
+    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
     rmtmp=$dstdir/_rm.$$_
 
     # Trap to clean up those temp files at exit.
-    trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
     trap '(exit $?); exit' 1 2 13 15
 
-    # Move or copy the file name to the temp name
-    $doit $instcmd "$src" "$dsttmp" &&
+    # Copy the file name to the temp name.
+    $doit $cpprog "$src" "$dsttmp" &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
     # If any of these fail, we abort the whole thing.  If we want to
     # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $instcmd $src $dsttmp" command.
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
       && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
 
-    # Now remove or move aside any old file at destination location.  We
-    # try this two ways since rm can't unlink itself on some systems and
-    # the destination file might be busy for other reasons.  In this case,
-    # the final cleanup might fail but the new file should still install
-    # successfully.
-    {
-      if test -f "$dstdir/$dstfile"; then
-        $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-        || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-        || {
-         echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-         (exit 1); exit
-        }
-      else
-        :
-      fi
-    } &&
-
     # Now rename the file to the real destination.
-    $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-  fi || { (exit 1); exit; }
+    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+      || {
+          # The rename failed, perhaps because mv can't rename something else
+          # to itself, or perhaps because mv is so ancient that it does not
+          # support -f.
+
+          # Now remove or move aside any old file at destination location.
+          # We try this two ways since rm can't unlink itself on some
+          # systems and the destination file might be busy for other
+          # reasons.  In this case, the final cleanup might fail but the new
+          # file should still install successfully.
+          {
+            if test -f "$dstdir/$dstfile"; then
+              $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+              || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+              || {
+                echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+                (exit 1); exit 1
+              }
+            else
+              :
+            fi
+          } &&
+
+          # Now rename the file to the real destination.
+          $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+        }
+    }
+  fi || { (exit 1); exit 1; }
 done
 
 # The final little trick to "correctly" pass the exit status to the exit trap.
 {
-  (exit 0); exit
+  (exit 0); exit 0
 }
 
 # Local variables:
index 1930d37..815817d 100644 (file)
@@ -51,7 +51,7 @@ install: $(PROJECT_LIBRARY)
         done
        $(INSTALL_DATA) $(BUILD_DIR)/ft2unix.h \
           $(DESTDIR)$(includedir)/ft2build.h
-       $(INSTALL_DATA) $(BUILD_DIR)/ftconfig.h \
+       $(INSTALL_DATA) $(OBJ_BUILD)/ftconfig.h \
           $(DESTDIR)$(includedir)/freetype2/freetype/config/ftconfig.h
        $(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \
           $(DESTDIR)$(bindir)/freetype-config
index 70f0b2d..eecedf2 100644 (file)
@@ -1,7 +1,7 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun configure.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
 # Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
@@ -17,7 +17,7 @@
 #
 # 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.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -43,9 +43,14 @@ EXIT_FAILURE=1
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=1.5.6
-TIMESTAMP=" (1.1220.2.94 2004/04/10 16:27:27)"
+VERSION=1.5.18
+TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
 
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes.
+if test -n "${ZSH_VERSION+set}" ; then
+  setopt NO_GLOB_SUBST
+fi
 
 # Check that we have a working $echo.
 if test "X$1" = X--no-reexec; then
@@ -107,8 +112,9 @@ if test "${LANG+set}" = set; then
 fi
 
 # Make sure IFS has a sensible default
-: ${IFS="      
-"}
+lt_nl='
+'
+IFS="  $lt_nl"
 
 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   $echo "$modename: not configured to build any kind of library" 1>&2
@@ -127,6 +133,7 @@ show_help=
 execute_dlfiles=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
+quote_scanset='[[~#^*{};<>?'"'"'       ]'
 
 #####################################
 # Shell function definitions:
@@ -138,7 +145,8 @@ o2lo="s/\\.${objext}\$/.lo/"
 # Need a lot of goo to handle *both* DLLs and import libs
 # Has to be a shell function in order to 'eat' the argument
 # that is supplied when $file_magic_command is called.
-func_win32_libid () {
+func_win32_libid ()
+{
   win32_libid_type="unknown"
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
@@ -178,12 +186,13 @@ func_win32_libid () {
 # Only attempt this if the compiler in the base compile
 # command doesn't match the default compiler.
 # arg is usually of the form 'gcc ...'
-func_infer_tag () {
+func_infer_tag ()
+{
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
        case $arg in
-         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+         *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -204,7 +213,7 @@ func_infer_tag () {
            for arg in $CC; do
            # Double-quote args containing other shell metacharacters.
            case $arg in
-             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
+             *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
              arg="\"$arg\""
              ;;
            esac
@@ -235,6 +244,108 @@ func_infer_tag () {
       esac
     fi
 }
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+      exit $EXIT_FAILURE
+    fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+    my_status=""
+
+    $show "${rm}r $my_gentop"
+    $run ${rm}r "$my_gentop"
+    $show "$mkdir $my_gentop"
+    $run $mkdir "$my_gentop"
+    my_status=$?
+    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+      exit $my_status
+    fi
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+       [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+       *) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+      my_xdir="$my_gentop/$my_xlib"
+
+      $show "${rm}r $my_xdir"
+      $run ${rm}r "$my_xdir"
+      $show "$mkdir $my_xdir"
+      $run $mkdir "$my_xdir"
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
+       exit $status
+      fi
+      case $host in
+      *-darwin*)
+       $show "Extracting $my_xabs"
+       # Do not bother doing anything if just a dry run
+       if test -z "$run"; then
+         darwin_orig_dir=`pwd`
+         cd $my_xdir || exit $?
+         darwin_archive=$my_xabs
+         darwin_curdir=`pwd`
+         darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+         darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+         if test -n "$darwin_arches"; then 
+           darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+           darwin_arch=
+           $show "$darwin_base_archive has multiple architectures $darwin_arches"
+           for darwin_arch in  $darwin_arches ; do
+             mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+             cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+             cd "$darwin_curdir"
+             $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+           done # $darwin_arches
+      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+           darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+           darwin_file=
+           darwin_files=
+           for darwin_file in $darwin_filelist; do
+             darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+             lipo -create -output "$darwin_file" $darwin_files
+           done # $darwin_filelist
+           ${rm}r unfat-$$
+           cd "$darwin_orig_dir"
+         else
+           cd "$darwin_orig_dir"
+           func_extract_an_archive "$my_xdir" "$my_xabs"
+         fi # $darwin_arches
+       fi # $run
+      ;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+    func_extract_archives_result="$my_oldobjs"
+}
 # End of Shell function definitions
 #####################################
 
@@ -305,10 +416,10 @@ do
   --version)
     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
     $echo
-    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
     $echo "This is free software; see the source for copying conditions.  There is NO"
     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --config)
@@ -317,7 +428,7 @@ do
     for tagname in $taglist; do
       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
     done
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --debug)
@@ -342,7 +453,7 @@ do
     else
       $echo "disable static libraries"
     fi
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --finish) mode="finish" ;;
@@ -399,7 +510,7 @@ if test -z "$show_help"; then
   # Infer the operation mode.
   if test -z "$mode"; then
     $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
     case $nonopt in
     *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
       mode=link
@@ -516,7 +627,7 @@ if test -z "$show_help"; then
            # Many Bourne shells cannot handle close brackets correctly
            # in scan sets, so we specify it separately.
            case $arg in
-             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
+             *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
              arg="\"$arg\""
              ;;
            esac
@@ -547,8 +658,11 @@ if test -z "$show_help"; then
       case $lastarg in
       # Double-quote args containing other shell metacharacters.
       # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        lastarg="\"$lastarg\""
        ;;
       esac
@@ -621,6 +735,15 @@ if test -z "$show_help"; then
       esac
     done
 
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+       qlibobj="\"$qlibobj\"" ;;
+    esac
+    if test "X$libobj" != "X$qlibobj"; then
+       $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+       exit $EXIT_FAILURE
+    fi
     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
     if test "X$xdir" = "X$obj"; then
@@ -693,12 +816,17 @@ compiler."
        $run $rm $removelist
        exit $EXIT_FAILURE
       fi
-      $echo $srcfile > "$lockfile"
+      $echo "$srcfile" > "$lockfile"
     fi
 
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
     fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
 
     $run $rm "$libobj" "${libobj}T"
 
@@ -720,10 +848,10 @@ EOF
       fbsd_hideous_sh_bug=$base_compile
 
       if test "$pic_mode" != no; then
-       command="$base_compile $srcfile $pic_flag"
+       command="$base_compile $qsrcfile $pic_flag"
       else
        # Don't build PIC code
-       command="$base_compile $srcfile"
+       command="$base_compile $qsrcfile"
       fi
 
       if test ! -d "${xdir}$objdir"; then
@@ -803,9 +931,9 @@ EOF
     if test "$build_old_libs" = yes; then
       if test "$pic_mode" != yes; then
        # Don't build PIC code
-       command="$base_compile $srcfile"
+       command="$base_compile $qsrcfile"
       else
-       command="$base_compile $srcfile $pic_flag"
+       command="$base_compile $qsrcfile $pic_flag"
       fi
       if test "$compiler_c_o" = yes; then
        command="$command -o $obj"
@@ -983,7 +1111,7 @@ EOF
       arg="$1"
       shift
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
        ;;
       *) qarg=$arg ;;
@@ -1227,6 +1355,13 @@ EOF
          prev=
          continue
          ;;
+        darwin_framework)
+         compiler_flags="$compiler_flags $arg"
+         compile_command="$compile_command $arg"
+         finalize_command="$finalize_command $arg"
+         prev=
+         continue
+         ;;
        *)
          eval "$prev=\"\$arg\""
          prev=
@@ -1285,6 +1420,14 @@ EOF
        continue
        ;;
 
+      -framework)
+        prev=darwin_framework
+        compiler_flags="$compiler_flags $arg"
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
+        continue
+        ;;
+
       -inst-prefix-dir)
        prev=inst_prefix
        continue
@@ -1345,7 +1488,7 @@ EOF
            # These systems don't actually have a C library (as such)
            test "X$arg" = "X-lc" && continue
            ;;
-         *-*-openbsd* | *-*-freebsd*)
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
            # Do not include libc due to us having libc/libc_r.
            test "X$arg" = "X-lc" && continue
            ;;
@@ -1356,7 +1499,7 @@ EOF
          esac
        elif test "X$arg" = "X-lc_r"; then
         case $host in
-        *-*-openbsd* | *-*-freebsd*)
+        *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
           # Do not include libc_r directly, use -pthread flag.
           continue
           ;;
@@ -1366,8 +1509,20 @@ EOF
        continue
        ;;
 
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+       compile_command="$compile_command $arg"
+       compiler_flags="$compiler_flags $arg"
+       finalize_command="$finalize_command $arg"
+       prev=xcompiler
+       continue
+       ;;
+
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-       deplibs="$deplibs $arg"
+       compiler_flags="$compiler_flags $arg"
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
        continue
        ;;
 
@@ -1376,18 +1531,19 @@ EOF
        continue
        ;;
 
-      # gcc -m* arguments should be passed to the linker via $compiler_flags
-      # in order to pass architecture information to the linker
-      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
-      # but this is not reliable with gcc because gcc may use -mfoo to
-      # select a different linker, different libraries, etc, while
-      # -Wl,-mfoo simply passes -mfoo to the linker.
-      -m*)
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+
        # Unknown arguments in both finalize_command and compile_command need
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case $arg in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -1503,7 +1659,7 @@ EOF
        for flag in $args; do
          IFS="$save_ifs"
          case $flag in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
            flag="\"$flag\""
            ;;
          esac
@@ -1521,7 +1677,7 @@ EOF
        for flag in $args; do
          IFS="$save_ifs"
          case $flag in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
            flag="\"$flag\""
            ;;
          esac
@@ -1554,7 +1710,7 @@ EOF
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case $arg in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -1688,7 +1844,7 @@ EOF
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case $arg in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -1855,7 +2011,7 @@ EOF
            compile_deplibs="$deplib $compile_deplibs"
            finalize_deplibs="$deplib $finalize_deplibs"
          else
-           deplibs="$deplib $deplibs"
+           compiler_flags="$compiler_flags $deplib"
          fi
          continue
          ;;
@@ -1864,10 +2020,6 @@ EOF
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
            continue
          fi
-         if test "$pass" = conv; then
-           deplibs="$deplib $deplibs"
-           continue
-         fi
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
            for search_ext in .la $std_shrext .so .a; do
@@ -1978,7 +2130,22 @@ EOF
          fi
          case $linkmode in
          lib)
-           if test "$deplibs_check_method" != pass_all; then
+           valid_a_lib=no
+           case $deplibs_check_method in
+             match_pattern*)
+               set dummy $deplibs_check_method
+               match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+               if eval $echo \"$deplib\" 2>/dev/null \
+                   | $SED 10q \
+                   | $EGREP "$match_pattern_regex" > /dev/null; then
+                 valid_a_lib=yes
+               fi
+               ;;
+             pass_all)
+               valid_a_lib=yes
+               ;;
+            esac
+           if test "$valid_a_lib" != yes; then
              $echo
              $echo "*** Warning: Trying to link with static lib archive $deplib."
              $echo "*** I have the capability to make that library automatically link in when"
@@ -2052,6 +2219,8 @@ EOF
        # it will not redefine variables installed, or shouldnotlink
        installed=yes
        shouldnotlink=no
+       avoidtemprpath=
+
 
        # Read the .la file
        case $lib in
@@ -2150,11 +2319,19 @@ EOF
            dir="$libdir"
            absdir="$libdir"
          fi
+         test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
        else
-         dir="$ladir/$objdir"
-         absdir="$abs_ladir/$objdir"
-         # Remove this search path later
-         notinst_path="$notinst_path $abs_ladir"
+         if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           dir="$ladir"
+           absdir="$abs_ladir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         else
+           dir="$ladir/$objdir"
+           absdir="$abs_ladir/$objdir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         fi
        fi # $installed = yes
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
 
@@ -2227,7 +2404,7 @@ EOF
          if test -n "$library_names" &&
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
            # We need to hardcode the library path
-           if test -n "$shlibpath_var"; then
+           if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
              # Make sure the rpath contains only unique directories.
              case "$temp_rpath " in
              *" $dir "*) ;;
@@ -2671,12 +2848,12 @@ EOF
              *) continue ;;
              esac
              case " $deplibs " in
-             *" $depdepl "*) ;;
-             *) deplibs="$depdepl $deplibs" ;;
+             *" $path "*) ;;
+             *) deplibs="$path $deplibs" ;;
              esac
              case " $deplibs " in
-             *" $path "*) ;;
-             *) deplibs="$deplibs $path" ;;
+             *" $depdepl "*) ;;
+             *) deplibs="$depdepl $deplibs" ;;
              esac
            done
          fi # link_all_deplibs != no
@@ -2941,27 +3118,27 @@ EOF
 
        # Check that each of the things are valid numbers.
        case $current in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
-         $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+         $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
          exit $EXIT_FAILURE
          ;;
        esac
 
        case $revision in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
-         $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+         $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
          exit $EXIT_FAILURE
          ;;
        esac
 
        case $age in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
-         $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+         $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
          exit $EXIT_FAILURE
          ;;
@@ -2987,7 +3164,7 @@ EOF
          versuffix="$major.$age.$revision"
          # Darwin ld doesn't like 0 for these options...
          minor_current=`expr $current + 1`
-         verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+         verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
          ;;
 
        freebsd-aout)
@@ -3193,7 +3370,7 @@ EOF
          *-*-netbsd*)
            # Don't link with libc until the a.out ld.so is fixed.
            ;;
-         *-*-openbsd* | *-*-freebsd*)
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
            # Do not include libc due to us having libc/libc_r.
            test "X$arg" = "X-lc" && continue
            ;;
@@ -3675,67 +3852,13 @@ EOF
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
          else
            gentop="$output_objdir/${outputname}x"
-           $show "${rm}r $gentop"
-           $run ${rm}r "$gentop"
-           $show "$mkdir $gentop"
-           $run $mkdir "$gentop"
-           status=$?
-           if test "$status" -ne 0 && test ! -d "$gentop"; then
-             exit $status
-           fi
            generated="$generated $gentop"
 
-           for xlib in $convenience; do
-             # Extract the objects.
-             case $xlib in
-             [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-             *) xabs=`pwd`"/$xlib" ;;
-             esac
-             xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-             xdir="$gentop/$xlib"
-
-             $show "${rm}r $xdir"
-             $run ${rm}r "$xdir"
-             $show "$mkdir $xdir"
-             $run $mkdir "$xdir"
-             status=$?
-             if test "$status" -ne 0 && test ! -d "$xdir"; then
-               exit $status
-             fi
-             # We will extract separately just the conflicting names and we will no
-             # longer touch any unique names. It is faster to leave these extract
-             # automatically by $AR in one run.
-             $show "(cd $xdir && $AR x $xabs)"
-             $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-             if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-               :
-             else
-               $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-               $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-               $AR t "$xabs" | sort | uniq -cd | while read -r count name
-               do
-                 i=1
-                 while test "$i" -le "$count"
-                 do
-                  # Put our $i before any first dot (extension)
-                  # Never overwrite any file
-                  name_to="$name"
-                  while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-                  do
-                    name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-                  done
-                  $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-                  $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-                  i=`expr $i + 1`
-                 done
-               done
-             fi
-
-             libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-           done
+           func_extract_archives $gentop $convenience
+           libobjs="$libobjs $func_extract_archives_result"
          fi
        fi
-
+       
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
          eval flag=\"$thread_safe_flag_spec\"
          linker_flags="$linker_flags $flag"
@@ -3784,6 +3907,7 @@ EOF
            save_libobjs=$libobjs
          fi
          save_output=$output
+         output_la=`$echo "X$output" | $Xsed -e "$basename"`
 
          # Clear the reloadable object creation command queue and
          # initialize k to one.
@@ -3793,7 +3917,7 @@ EOF
          delfiles=
          last_robj=
          k=1
-         output=$output_objdir/$save_output-${k}.$objext
+         output=$output_objdir/$output_la-${k}.$objext
          # Loop over the list of objects to be linked.
          for obj in $save_libobjs
          do
@@ -3813,9 +3937,9 @@ EOF
                # the last one created.
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
              fi
-             last_robj=$output_objdir/$save_output-${k}.$objext
+             last_robj=$output_objdir/$output_la-${k}.$objext
              k=`expr $k + 1`
-             output=$output_objdir/$save_output-${k}.$objext
+             output=$output_objdir/$output_la-${k}.$objext
              objlist=$obj
              len=1
            fi
@@ -3835,13 +3959,13 @@ EOF
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
           fi
 
-         # Set up a command to remove the reloadale object files
+         # Set up a command to remove the reloadable object files
          # after they are used.
          i=0
          while test "$i" -lt "$k"
          do
            i=`expr $i + 1`
-           delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+           delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
          done
 
          $echo "creating a temporary reloadable object file: $output"
@@ -3973,64 +4097,10 @@ EOF
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
        else
          gentop="$output_objdir/${obj}x"
-         $show "${rm}r $gentop"
-         $run ${rm}r "$gentop"
-         $show "$mkdir $gentop"
-         $run $mkdir "$gentop"
-         status=$?
-         if test "$status" -ne 0 && test ! -d "$gentop"; then
-           exit $status
-         fi
          generated="$generated $gentop"
 
-         for xlib in $convenience; do
-           # Extract the objects.
-           case $xlib in
-           [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-           *) xabs=`pwd`"/$xlib" ;;
-           esac
-           xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-           xdir="$gentop/$xlib"
-
-           $show "${rm}r $xdir"
-           $run ${rm}r "$xdir"
-           $show "$mkdir $xdir"
-           $run $mkdir "$xdir"
-           status=$?
-           if test "$status" -ne 0 && test ! -d "$xdir"; then
-             exit $status
-           fi
-           # We will extract separately just the conflicting names and we will no
-           # longer touch any unique names. It is faster to leave these extract
-           # automatically by $AR in one run.
-           $show "(cd $xdir && $AR x $xabs)"
-           $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-           if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-             :
-           else
-             $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-             $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-             $AR t "$xabs" | sort | uniq -cd | while read -r count name
-             do
-               i=1
-               while test "$i" -le "$count"
-               do
-                # Put our $i before any first dot (extension)
-                # Never overwrite any file
-                name_to="$name"
-                while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-                do
-                  name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-                done
-                $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-                $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-                i=`expr $i + 1`
-               done
-             done
-           fi
-
-           reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-         done
+         func_extract_archives $gentop $convenience
+         reload_conv_objs="$reload_objs $func_extract_archives_result"
        fi
       fi
 
@@ -4292,12 +4362,12 @@ extern \"C\" {
 
            # Prepare the list of exported symbols
            if test -z "$export_symbols"; then
-             export_symbols="$output_objdir/$output.exp"
+             export_symbols="$output_objdir/$outputname.exp"
              $run $rm $export_symbols
              $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
            else
-             $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
-             $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+             $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+             $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
              $run eval 'mv "$nlist"T "$nlist"'
            fi
          fi
@@ -4349,7 +4419,26 @@ extern \"C\" {
 #endif
 
 /* The mapping between symbol names and symbols. */
+"
+
+           case $host in
+           *cygwin* | *mingw* )
+         $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+             ;;
+           * )
+         $echo >> "$output_objdir/$dlsyms" "\
 const struct {
+"
+             ;;
+           esac
+
+
+         $echo >> "$output_objdir/$dlsyms" "\
   const char *name;
   lt_ptr address;
 }
@@ -4578,7 +4667,7 @@ static const void *lt_preloaded_setup() {
        esac
        case $host in
          *cygwin* | *mingw* )
-           cwrappersource=`$echo ${objdir}/lt-${output}.c`
+           cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
            cwrapper=`$echo ${output}.exe`
            $rm $cwrappersource $cwrapper
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
@@ -4811,7 +4900,7 @@ sed_quote_subst='$sed_quote_subst'
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 relink_command=\"$relink_command\"
 
@@ -4988,71 +5077,73 @@ fi\
 
       if test -n "$addlibs"; then
        gentop="$output_objdir/${outputname}x"
-       $show "${rm}r $gentop"
-       $run ${rm}r "$gentop"
-       $show "$mkdir $gentop"
-       $run $mkdir "$gentop"
-       status=$?
-       if test "$status" -ne 0 && test ! -d "$gentop"; then
-         exit $status
-       fi
        generated="$generated $gentop"
 
-       # Add in members from convenience archives.
-       for xlib in $addlibs; do
-         # Extract the objects.
-         case $xlib in
-         [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-         *) xabs=`pwd`"/$xlib" ;;
-         esac
-         xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-         xdir="$gentop/$xlib"
-
-         $show "${rm}r $xdir"
-         $run ${rm}r "$xdir"
-         $show "$mkdir $xdir"
-         $run $mkdir "$xdir"
-         status=$?
-         if test "$status" -ne 0 && test ! -d "$xdir"; then
-           exit $status
-         fi
-         # We will extract separately just the conflicting names and we will no
-         # longer touch any unique names. It is faster to leave these extract
-         # automatically by $AR in one run.
-         $show "(cd $xdir && $AR x $xabs)"
-         $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-         if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-           :
-         else
-           $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-           $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-           $AR t "$xabs" | sort | uniq -cd | while read -r count name
-           do
-             i=1
-             while test "$i" -le "$count"
-             do
-              # Put our $i before any first dot (extension)
-              # Never overwrite any file
-              name_to="$name"
-              while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-              do
-                name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-              done
-              $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-              $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-              i=`expr $i + 1`
-             done
-           done
-         fi
-
-         oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
-       done
+       func_extract_archives $gentop $addlibs
+       oldobjs="$oldobjs $func_extract_archives_result"
       fi
 
       # Do each command in the archive commands.
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
        cmds=$old_archive_from_new_cmds
       else
+       # POSIX demands no paths to be encoded in archives.  We have
+       # to avoid creating archives with duplicate basenames if we
+       # might have to extract them afterwards, e.g., when creating a
+       # static archive out of a convenience library, or when linking
+       # the entirety of a libtool archive into another (currently
+       # not supported by libtool).
+       if (for obj in $oldobjs
+           do
+             $echo "X$obj" | $Xsed -e 's%^.*/%%'
+           done | sort | sort -uc >/dev/null 2>&1); then
+         :
+       else
+         $echo "copying selected object files to avoid basename conflicts..."
+
+         if test -z "$gentop"; then
+           gentop="$output_objdir/${outputname}x"
+           generated="$generated $gentop"
+
+           $show "${rm}r $gentop"
+           $run ${rm}r "$gentop"
+           $show "$mkdir $gentop"
+           $run $mkdir "$gentop"
+           status=$?
+           if test "$status" -ne 0 && test ! -d "$gentop"; then
+             exit $status
+           fi
+         fi
+
+         save_oldobjs=$oldobjs
+         oldobjs=
+         counter=1
+         for obj in $save_oldobjs
+         do
+           objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+           case " $oldobjs " in
+           " ") oldobjs=$obj ;;
+           *[\ /]"$objbase "*)
+             while :; do
+               # Make sure we don't pick an alternate name that also
+               # overlaps.
+               newobj=lt$counter-$objbase
+               counter=`expr $counter + 1`
+               case " $oldobjs " in
+               *[\ /]"$newobj "*) ;;
+               *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+               esac
+             done
+             $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+             $run ln "$obj" "$gentop/$newobj" ||
+             $run cp "$obj" "$gentop/$newobj"
+             oldobjs="$oldobjs $gentop/$newobj"
+             ;;
+           *) oldobjs="$oldobjs $obj" ;;
+           esac
+         done
+       fi
+
        eval cmds=\"$old_archive_cmds\"
 
        if len=`expr "X$cmds" : ".*"` &&
@@ -5066,20 +5157,7 @@ fi\
          objlist=
          concat_cmds=
          save_oldobjs=$oldobjs
-         # GNU ar 2.10+ was changed to match POSIX; thus no paths are
-         # encoded into archives.  This makes 'ar r' malfunction in
-         # this piecewise linking case whenever conflicting object
-         # names appear in distinct ar calls; check, warn and compensate.
-           if (for obj in $save_oldobjs
-           do
-             $echo "X$obj" | $Xsed -e 's%^.*/%%'
-           done | sort | sort -uc >/dev/null 2>&1); then
-           :
-         else
-           $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
-           $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
-           AR_FLAGS=cq
-         fi
+
          # Is there a better way of finding the last object in the list?
          for obj in $save_oldobjs
          do
@@ -5291,7 +5369,7 @@ relink_command=\"$relink_command\""
       # Aesthetically quote it.
       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        arg="\"$arg\""
        ;;
       esac
@@ -5307,7 +5385,7 @@ relink_command=\"$relink_command\""
     # Aesthetically quote it.
     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
     case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \      ]*|*]*)
+    *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
       arg="\"$arg\""
       ;;
     esac
@@ -5355,7 +5433,7 @@ relink_command=\"$relink_command\""
       # Aesthetically quote the argument.
       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        arg="\"$arg\""
        ;;
       esac
@@ -6394,7 +6472,7 @@ esac
 $echo
 $echo "Try \`$modename --help' for more information about other modes."
 
-exit $EXIT_SUCCESS
+exit $?
 
 # The TAGs below are defined such that we never get into a situation
 # in which we disable both kinds of libraries.  Given conflicting
index 6fbe5e1..5d26a48 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
 
-scriptversion=2004-02-15.20
+scriptversion=2005-02-02.21
 
 # Original author: Noah Friedman <friedman@prep.ai.mit.edu>
 # Created: 1993-05-16
@@ -27,7 +27,7 @@ while test $# -gt 0 ; do
   case $1 in
     -h | --help | --h*)         # -h for help
       echo "$usage"
-      exit 0
+      exit $?
       ;;
     -m)                         # -m PERM arg
       shift
@@ -37,7 +37,7 @@ while test $# -gt 0 ; do
       ;;
     --version)
       echo "$0 $scriptversion"
-      exit 0
+      exit $?
       ;;
     --)                         # stop option processing
       shift
index f24538f..97e7b52 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2004 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 ifeq ($(PLATFORM),ansi)
 
   # Detecting Windows NT is easy, as the OS variable must be defined and
-  # contains `Windows_NT'.  Untested with Windows 2K, but I guess it should
-  # work...
+  # contains `Windows_NT'.  This also works with Windows 2000 and XP.
   #
   ifeq ($(OS),Windows_NT)
 
-    is_windows := 1
+    PLATFORM := win32
+
+  else
 
-    # We test for the COMSPEC environment variable, then run the `ver'
-    # command-line program to see if its output contains the word `Windows'.
+    # Detecting Windows 9X
+
+    # We used to run the `ver' command to see if its output contains the
+    # word `Windows'.  If this is true, we are running Windows 95 or later:
     #
-    # If this is true, we are running a win32 platform (or an emulation).
+    #   ifdef COMSPEC
+    #     # First, check if we have the COMSPEC environment variable, which
+    #     # indicates we can use COMMAND.COM's internal commands
+    #     is_windows := $(findstring Windows,$(strip $(shell ver)))
+    #   endif
     #
-  else
-    ifdef COMSPEC
-      is_windows := $(findstring Windows,$(strip $(shell ver)))
-    endif
-  endif  # test NT
+    # Unfortunately, this also detects the case when one is running
+    # DOS 7.x (the MS-DOS version that lies below Windows) without actually
+    # launching the GUI.
+    #
+    # 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.
+    #
+    # 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
+    # since NT is detected independantly above.  But do not try to be clever!
+    #
+    ifdef winbootdir
+      ifdef windir
 
-  ifdef is_windows
+        PLATFORM := win32
 
-    PLATFORM := win32
+      endif
+    endif
+
+  endif  # test NT
 
-  endif
 endif # test PLATFORM ansi
 
 ifeq ($(PLATFORM),win32)
 
   DELETE := del
-  COPY   := copy
   SEP    := $(BACKSLASH)
 
+  # Setting COPY is a bit trickier.  Plain COPY on NT will not work
+  # correctly, because it will uppercase 8.3 filenames, creating a
+  # `CONFIG.MK' file which isn't found later on by `make'.
+  # Since we do not want that, we need to force execution of CMD.EXE.
+  # Unfortunately, CMD.EXE is not available on Windows 9X.
+  # So we need to hack.
+  #
+  # Kudos to Eli Zaretskii (DJGPP guru) that helped debug it.
+  # Details are available in threads of the freetype mailing list 
+  # (2004-11-11), and then in the devel mailing list (2004-11-20 to -23).
+  #
+  ifeq ($(OS),Windows_NT)
+    COPY := cmd.exe /c copy
+  else
+    COPY := copy
+  endif  # test NT
+
+
   # gcc Makefile by default
   CONFIG_FILE := w32-gcc.mk
   ifeq ($(firstword $(CC)),cc)
index 5e88deb..76a5f31 100644 (file)
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug"
 
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110_D.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Multithreaded"
 
@@ -103,7 +103,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219MT_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110MT_D.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Multithreaded"
 
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219MT.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110MT.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Singlethreaded"
 
@@ -152,7 +152,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib"
-# ADD LIB32 /out:"..\..\..\objs\freetype219ST.lib"
+# ADD LIB32 /out:"..\..\..\objs\freetype2110ST.lib"
 # SUBTRACT LIB32 /nologo
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Singlethreaded"
@@ -178,7 +178,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219ST_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110ST_D.lib"
 
 !ENDIF 
 
index 4967e58..0a90d1e 100644 (file)
                                ObjectFile=".\..\..\..\objs\release/"
                                ProgramDataBaseFileName=".\..\..\..\objs\release/"
                                WarningLevel="4"
-                               DebugInformationFormat="3"
+                               DebugInformationFormat="0"
                                CompileAs="0"/>
                        <Tool
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLibrarianTool"
-                               OutputFile="..\..\..\objs\freetype219.lib"
+                               OutputFile="..\..\..\objs\freetype2110.lib"
                                SuppressStartupBanner="TRUE"/>
                        <Tool
                                Name="VCMIDLTool"/>
                                ObjectFile=".\..\..\..\objs\release_mt/"
                                ProgramDataBaseFileName=".\..\..\..\objs\release_mt/"
                                WarningLevel="4"
-                               DebugInformationFormat="3"
+                               DebugInformationFormat="0"
                                CompileAs="0"/>
                        <Tool
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLibrarianTool"
-                               OutputFile="..\..\..\objs\freetype219MT.lib"
+                               OutputFile="..\..\..\objs\freetype2110MT.lib"
                                SuppressStartupBanner="TRUE"/>
                        <Tool
                                Name="VCMIDLTool"/>
                                ObjectFile=".\..\..\..\objs\release_st/"
                                ProgramDataBaseFileName=".\..\..\..\objs\release_st/"
                                WarningLevel="4"
-                               DebugInformationFormat="3"
+                               DebugInformationFormat="0"
                                CompileAs="0"/>
                        <Tool
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLibrarianTool"
-                               OutputFile="..\..\..\objs\freetype219ST.lib"/>
+                               OutputFile="..\..\..\objs\freetype2110ST.lib"/>
                        <Tool
                                Name="VCMIDLTool"/>
                        <Tool
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLibrarianTool"
-                               OutputFile="..\..\..\objs\freetype219_D.lib"
+                               OutputFile="..\..\..\objs\freetype2110_D.lib"
                                SuppressStartupBanner="TRUE"/>
                        <Tool
                                Name="VCMIDLTool"/>
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLibrarianTool"
-                               OutputFile="..\..\..\objs\freetype219ST_D.lib"
+                               OutputFile="..\..\..\objs\freetype2110ST_D.lib"
                                SuppressStartupBanner="TRUE"/>
                        <Tool
                                Name="VCMIDLTool"/>
                                ImproveFloatingPointConsistency="TRUE"
                                AdditionalIncludeDirectories="..\..\..\include"
                                PreprocessorDefinitions="_DEBUG;WIN32;_LIB;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE"
+                               GeneratePreprocessedFile="0"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="1"
                                DisableLanguageExtensions="TRUE"
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLibrarianTool"
-                               OutputFile="..\..\..\objs\freetype219MT_D.lib"
+                               OutputFile="..\..\..\objs\freetype2110MT_D.lib"
                                SuppressStartupBanner="TRUE"/>
                        <Tool
                                Name="VCMIDLTool"/>
                        <File
                                RelativePath="..\..\..\src\autofit\autofit.c">
                        </File>
-                       <File
-                               RelativePath="..\..\..\src\autohint\autohint.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
                        <File
                                RelativePath="..\..\..\src\bdf\bdf.c">
                                <FileConfiguration
                                                BasicRuntimeChecks="3"/>
                                </FileConfiguration>
                        </File>
+                       <File
+                               RelativePath="..\..\..\src\base\ftbitmap.c">
+                       </File>
                        <File
                                RelativePath="..\..\..\src\cache\ftcache.c">
                                <FileConfiguration
                                                BasicRuntimeChecks="3"/>
                                </FileConfiguration>
                        </File>
-                       <File
-                               RelativePath="..\..\..\src\lzw\ftlzw.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
                        <File
                                RelativePath="..\..\..\src\base\ftinit.c">
                                <FileConfiguration
                                </FileConfiguration>
                        </File>
                        <File
-                               RelativePath="..\..\..\src\base\ftmm.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\base\ftsystem.c">
+                               RelativePath="..\..\..\src\lzw\ftlzw.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                        <Tool
                                </FileConfiguration>
                        </File>
                        <File
-                               RelativePath="..\..\..\src\pcf\pcf.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
+                               RelativePath="..\..\..\src\base\ftstroke.c">
                        </File>
                        <File
-                               RelativePath="..\..\..\src\pfr\pfr.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\psaux\psaux.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\pshinter\pshinter.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\psnames\psmodule.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\raster\raster.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\sfnt\sfnt.c">
+                               RelativePath="..\..\..\src\base\ftsystem.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                        <Tool
                                                BasicRuntimeChecks="3"/>
                                </FileConfiguration>
                        </File>
-                       <File
-                               RelativePath="..\..\..\src\truetype\truetype.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\type1\type1.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\cid\type1cid.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\type42\type42.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\..\src\winfonts\winfnt.c">
-                               <FileConfiguration
-                                       Name="Release|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="2"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Singlethreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Debug Multithreaded|Win32">
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               Optimization="0"
-                                               AdditionalIncludeDirectories=""
-                                               PreprocessorDefinitions=""
-                                               BasicRuntimeChecks="3"/>
-                               </FileConfiguration>
-                       </File>
+                       <Filter
+                               Name="FT_MODULES"
+                               Filter="">
+                               <File
+                                       RelativePath="..\..\..\src\base\ftmm.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\pcf\pcf.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\pfr\pfr.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\psaux\psaux.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\pshinter\pshinter.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\psnames\psmodule.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\raster\raster.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\sfnt\sfnt.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\truetype\truetype.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\type1\type1.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\cid\type1cid.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\type42\type42.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                               <File
+                                       RelativePath="..\..\..\src\winfonts\winfnt.c">
+                                       <FileConfiguration
+                                               Name="Release|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="2"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Singlethreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Debug Multithreaded|Win32">
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                                       Optimization="0"
+                                                       AdditionalIncludeDirectories=""
+                                                       PreprocessorDefinitions=""
+                                                       BasicRuntimeChecks="3"/>
+                                       </FileConfiguration>
+                               </File>
+                       </Filter>
                </Filter>
                <Filter
                        Name="Header Files"
index 9454d4c..bf17394 100644 (file)
   FreeType&nbsp;2 Project Files for Visual&nbsp;C++ and VS.NET&nbsp;2003
 </h1>
 
-<p>This directory contains project files for Visual C++, named
+<p>This directory contains project files for Visual C++, named
 <tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>.  It
-will compile the following libraries from the FreeType 2.1.9 sources:</p>
+will compile the following libraries from the FreeType 2.1.10 sources:</p>
 
 <ul>
   <pre>
-    freetype219.lib     - release build; single threaded
-    freetype219_D.lib   - debug build;   single threaded
-    freetype219MT.lib   - release build; multi-threaded
-    freetype219MT_D.lib - debug build;   multi-threaded</pre>
+    freetype2110.lib     - release build; single threaded
+    freetype2110_D.lib   - debug build;   single threaded
+    freetype2110MT.lib   - release build; multi-threaded
+    freetype2110MT_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 step is required.  If
+<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
index 8621c0e..3f9c7b3 100644 (file)
@@ -1,12 +1,19 @@
 #!/bin/sh
 #
-# Call the 'configure' script located in 'builds/unix'.
+# Copyright 2002, 2003, 2004, 2005 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This should re-generate the following files:
+# 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.
 #
-#   config.mk
-#   install
 #
+# Call the `configure' script located in `builds/unix'.
+#
+
+rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk
 
 if test "x$GNUMAKE" = x; then
   GNUMAKE=make
@@ -51,12 +58,19 @@ abs_ft2_dir=`cd "$ft2_dir" && pwd`
 
 if test "$abs_curr_dir" != "$abs_ft2_dir"; then
   mkdir reference
-  echo "TOP_DIR=$abs_ft2_dir"             > Makefile
-  echo "OBJ_DIR=$abs_curr_dir"           >> Makefile
-  echo "OBJ_BUILD=$abs_curr_dir"         >> Makefile
-  echo "DOC_DIR=$abs_curr_dir/reference" >> Makefile
-  echo "LIBTOOL=$abs_curr_dir/libtool"   >> Makefile
-  echo "include $abs_ft2_dir/Makefile"   >> Makefile
+  echo "TOP_DIR   := $abs_ft2_dir"               > Makefile
+  echo "OBJ_DIR   := $abs_curr_dir"             >> Makefile
+  echo "OBJ_BUILD := \$(OBJ_DIR)"               >> Makefile
+  echo "DOC_DIR   := \$(OBJ_DIR)/reference"     >> Makefile
+  echo "LIBTOOL   := \$(OBJ_DIR)/libtool"       >> Makefile
+  echo "ifndef FT2DEMOS"                        >> Makefile
+  echo "  include \$(TOP_DIR)/Makefile"         >> Makefile
+  echo "else"                                   >> Makefile
+  echo "  TOP_DIR_2 := \$(TOP_DIR)/../ft2demos" >> Makefile
+  echo "  PROJECT   := freetype"                >> Makefile
+  echo "  CONFIG_MK := \$(OBJ_DIR)/config.mk"   >> Makefile
+  echo "  include \$(TOP_DIR_2)/Makefile"       >> Makefile
+  echo "endif"                                  >> Makefile
 fi
 
 # call make
index eaad2b6..f523403 100644 (file)
@@ -1,10 +1,10 @@
 /***************************************************************************/
 /*                                                                         */
-/*  ftoption.h                                                             */
+/*  ftoption.h (for development)                                           */
 /*                                                                         */
 /*    User-selectable configuration macros (specification only).           */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -446,9 +446,9 @@ FT_BEGIN_HEADER
   /* work-around hinting system.  Note that for the moment, the algorithm  */
   /* is only used when selected at runtime through the parameter tag       */
   /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook               */
-  /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally actived                  */
+  /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally activated.               */
   /*                                                                       */
-#define TT_CONFIG_OPTION_UNPATENTED_HINTING
+/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
 
 
   /*************************************************************************/
@@ -550,23 +550,12 @@ FT_BEGIN_HEADER
  /* */
 
 /*
- * The FT_CONFIG_OPTION_CHESTER_XXXX macros are used to toggle some recent
- * improvements to the auto-hinter contributed by David Chester.  They will
- * most likely disappear completely in the next release.  For now, you
- * should always keep them defined.
+ * This temporary macro is used to control various optimizations for
+ * reducing the heap footprint of memory-mapped TrueType files.
  *
  */
-#define  FT_CONFIG_OPTION_CHESTER_HINTS
+/* #define  FT_OPTIMIZE_MEMORY */
 
-#ifdef   FT_CONFIG_OPTION_CHESTER_HINTS
-
-#define  FT_CONFIG_CHESTER_SMALL_F
-#define  FT_CONFIG_CHESTER_ASCENDER
-#define  FT_CONFIG_CHESTER_SERIF
-#define  FT_CONFIG_CHESTER_STEM
-#define  FT_CONFIG_CHESTER_BLUE_SCALE
-
-#endif /* FT_CONFIG_OPTION_CHESTER_HINTS */
 
 FT_END_HEADER
 
index fdb9ce3..cc20712 100644 (file)
@@ -1,3 +1,122 @@
+LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
+
+  I. IMPORTANT BUG FIXES
+
+    - The size comparison for BDF and PCF files could fail sometimes.
+
+    - Some  CFF files  were still not  loaded  correctly.   Patch from
+      Derek Noonburg.
+
+    - The stroker still had some serious bugs.
+
+    - Boris  Letocha  fixed a  bug in  the  TrueType interpreter:  The
+      NPUSHW instruction wasn't skipped correctly in IF clauses.  Some
+      fonts like `Helvetica 75 Bold' failed.
+
+    - Another  serious  bug  in  handling  TrueType hints  caused many
+      distortions.  It has been introduced in version 2.1.8, and it is
+      highly recommended to upgrade.
+
+    - FreeType didn't properly parse empty Type 1 glyphs.
+    
+    - An unbound dynamic buffer growth was fixed in the PFR loader.
+    
+    - Several bugs have been fixed in the cache sub-system.
+
+    - FreeType behaved incorrectly when resizing two distinct but very
+      close character pixel sizes through `FT_Set_Char_Size' (Savannah
+      bug #12263).
+      
+    - The auto-hinter didn't work properly for fonts without a Unicode
+      charmap -- it even refused to load the glyphs.
+
+
+  II. IMPORTANT CHANGES
+
+    - Many fixes have been applied to drastically reduce the amount of
+      heap   memory   used   by   FreeType,   especially   when  using
+      memory-mapped font files  (which is the default on Unix  systems
+      which support them).
+
+    - The auto-hinter  has been replaced with a new module, called the
+      `auto-fitter'.  It consumes  less memory  than its  predecessor,
+      and it is  prepared to support non-latin scripts  better in next
+      releases.
+
+    - George Williams  contributed code to read  kerning data from PFM
+      files.
+
+    - FreeType   now   uses    the   TT_NAME_ID_PREFERRED_FAMILY   and
+      TT_NAME_ID_PREFERRED_SUBFAMILY   strings   (if   available)  for
+      setting  family  and  style in SFNT  fonts  (patch from Kornfeld
+      Eliyahu Peter).
+
+    - A  new  API `FT_Sfnt_Table_Info'  (in FT_TRUETYPE_TABLES_H)  has
+      been added to retrieve name and size information of SFNT tables.
+
+    - A new API `FT_OpenType_Validate' (in FT_OPENTYPE_VALIDATE_H) has
+      been added to validate OpenType tables  (BASE, GDEF, GPOS, GSUB,
+      JSTF).   After validation  it is  no longer  necessary to  check
+      for errors in those tables while accessing them.
+
+      Note that  this module might  be moved to another library in the
+      future  to avoid  a tight  dependency between  FreeType and  the
+      OpenType specification.
+
+    - A new API in FT_BITMAP_H  (`FT_Bitmap_New', `FT_Bitmap_Convert',
+      `FT_Bitmap_Copy',  `FT_Bitmap_Embolden',  `FT_Bitmap_Done')  has
+      been added.   Its  use is  to convert an  FT_Bitmap structure in
+      1bpp, 2bpp,  4bpp, or 8bpp  format into  another 8bpp FT_Bitmap,
+      probably using a different pitch, and to further manipulate it.
+
+    - A new  API `FT_Outline_Embolden'  (in FT_OUTLINE_H) gives  finer
+      control how  outlines are embolded.
+
+    - `FT_GlyphSlot_Embolden' (in FT_SYNTHESIS_H)  now handles bitmaps
+      also (code contributed  by Chia I Wu).  Note that this  function
+      is still experimental and may be replaced with a better API.
+
+    - The method  how BDF and PCF  bitmap fonts  are accessed has been
+      refined.   Formerly,   FT_Set_Pixel_Sizes  and  FT_Set_Char_Size
+      were  synonyms in  FreeType's  BDF and PCF interface.  This  has
+      changed now.  FT_Set_Pixel_Sizes  should be  used to  select the
+      actual  font dimensions  (the `strike',  which is the sum of the
+      `FONT_ASCENT'    and    `FONT_DESCENT'    properties),     while
+      FT_Set_Char_Size  selects  the  `nominal' size  (the `PIXELSIZE'
+      property).  In both functions, the width parameter is ignored.
+
+
+  III. MISCELLANEOUS
+
+    - The BDF driver  no longer converts  all returned bitmaps  with a
+      depth of 2bpp or 4bpp to a depth of 8bpp.  The documentation has
+      not  mentioned  this  explicitly,  but  implementors  might have
+      relied on this after looking into the source files.
+
+    - A new option `--ftversion' has been  added to freetype-config to
+      return the FreeType version.
+
+    - The  memory  debugger  has  been  updated   to  dump  allocation
+      statistics on  all allocation  sources in the library.   This is
+      useful to  spot greedy  allocations when  loading and processing
+      fonts.
+
+    - We removed a huge array of constant pointers to constant strings
+      in the `psnames' module.   The problem was that  compilations in
+      PIC mode (i.e.,  when generating a  Unix shared object/dll)  put
+      the array  into the non-shared  writable section of  the library
+      since absolute pointers are not relocatable by nature.
+      
+      This reduces the memory consumption by approximately 16KByte per
+      process linked  to FreeType.   We now also store  the array in a
+      compressed form (as a trie) which saves about 20KByte of code as
+      well.
+
+    - Kirill  Smelkov provided  patches to make  src/raster/ftraster.c
+      compile stand-alone again.
+
+
+======================================================================
 
 LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
 
@@ -22,6 +141,8 @@ LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
     - The BDF driver now uses the DEFAULT_CHAR property (if available)
       to select a glyph shape for the undefined glyph.
 
+    - The stroker failed for closed outlines and single points.
+
 
   II. IMPORTANT CHANGES
 
@@ -37,6 +158,11 @@ LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
       considerably.   See the documentation of  `FT_GlyphSlotRec'  and
       the `ftstring' demo program how to use it.
 
+    - Loading TrueType and Type 1 fonts has been made much faster.
+
+    - The stroker is  no longer experimental (but the  cache subsystem
+      still is).
+
 
   III. MISCELLANEOUS
 
@@ -777,7 +903,7 @@ LATEST CHANGES BETWEEN 2.1.0 and 2.0.9
 
   III. MISCELLANEOUS
 
-    - The  FreeType  License in  `docs/FTL.txt'  has  been updated  to
+    - The  FreeType  License in  `docs/FTL.TXT'  has  been updated  to
       include  a  proposed preferred  disclaimer.   If  you are  using
       FreeType in your products, you are encouraged (but not mandated)
       to use the following text in your documentation:
@@ -2474,4 +2600,16 @@ Extensions support:
      return ext_interface->do_it(ext);
    }
 
+------------------------------------------------------------------------
+
+Copyright 2000, 2001, 2002, 2003, 2004, 2005 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
+
 --- end of CHANGES ---
index 8709b3d..e2beb68 100644 (file)
@@ -121,5 +121,16 @@ IV. Overriding default configuration and module headers
     and  change the C  include path  to ensure  that "custom"  is always
     placed before the FT2 "include" during compilation.
 
+------------------------------------------------------------------------
+
+Copyright 2003 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
 
 --- end of CUSTOMIZE ---
index c85ef3c..4e13233 100644 (file)
@@ -20,7 +20,7 @@ located in the file "ftoptions.h".  The macros are:
 
     #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_TRACE6.
+    FT_TRACE2, ..., FT_TRACE7.
 
     The  trace  macros are  used  to  send  debugging messages  when  an
     appropriate  "debug  level" is  configured  at  runtime through  the
@@ -94,7 +94,7 @@ its code:
     internal file <freetype/internal/fttrace.h>.
 
     Each  such component  is assigned  a "debug  level", ranging  from 0
-    to 6,  through  the  use   of  the  FT2_DEBUG  environment  variable
+    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
@@ -110,7 +110,7 @@ its code:
 
       FT_TRACE( 2, ( "your %s is not %s\n", "foo", "bar" ) )
 
-    The shortcut macros  FT_TRACE0, FT_TRACE1, FT_TRACE2_, ... FT_TRACE6
+    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
 
@@ -179,5 +179,16 @@ behaviour of FreeType at runtime:
     If it is  undefined, or if its value is  not strictly positive, then
     no allocation bounsd are checked at runtime.
 
+------------------------------------------------------------------------
+
+Copyright 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.
+
 
 --- end of DEBUG ---
index 0967302..459bda3 100644 (file)
@@ -171,4 +171,4 @@ Legal Terms
     Werner Lemberg    <werner.lemberg@freetype.org>
 
 
---- end of LICENSE.TXT ---
+--- end of FTL.TXT ---
index e8a612e..b2fe7b6 100644 (file)
@@ -1,8 +1,8 @@
                    GNU GENERAL PUBLIC LICENSE
                       Version 2, June 1991
 
- Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ 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.
 
@@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES.
 
                     END OF TERMS AND CONDITIONS
 \f
-       Appendix: How to Apply These Terms to Your New Programs
+           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
@@ -291,7 +291,7 @@ 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) 19yy  <name of author>
+    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
@@ -305,14 +305,15 @@ the "copyright" line and a pointer to where the full notice is found.
 
     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., 675 Mass Ave, Cambridge, MA 02139, USA.
+    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) 19yy name of author
+    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.
index 8fb6657..b342d96 100644 (file)
@@ -64,4 +64,16 @@ II. Custom builds of the library
     http://makepp.sourceforge.net for more information; you need version
     1.19 or newer, and you must pass option `--norc-substitution'.
 
+------------------------------------------------------------------------
+
+Copyright 2000, 2001, 2002, 2003, 2004, 2005 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
+
 --- end of INSTALL ---
index af3f6e7..133b45f 100644 (file)
@@ -42,7 +42,7 @@ I. Standard procedure
 
     -- other components (optional)
 
-      src/autohint/autohint.c -- auto hinting module
+      src/autofit/autofit.c   -- auto hinting module
       src/cache/ftcache.c     -- cache sub-system (in beta)
       src/sfnt/sfnt.c         -- SFNT files support
                                  (TrueType & OpenType)
@@ -95,5 +95,16 @@ II. Support for flat-directory compilation
     You don't need to define  the FT_FLAT_COMPILATION macro (as this was
     required in previous releases of FreeType 2).
 
+------------------------------------------------------------------------
+
+Copyright 2003, 2005 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
 
 --- end of INSTALL.ANY ---
index 4a56d6d..cd2208e 100644 (file)
@@ -136,5 +136,16 @@ the file INSTALL.UNX instead.
     a  IDE-specific   project  file,  or  follow   the  instructions  in
     "INSTALL.ANY" to create your own Makefiles.
 
+------------------------------------------------------------------------
+
+Copyright 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.
+
 
 --- end of INSTALL.GNU ---
index d5a45c0..52f2820 100644 (file)
@@ -61,5 +61,16 @@ Win32:
       make
       make install
 
+------------------------------------------------------------------------
 
---- end of INSTALL.UNX --
+Copyright 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.
+
+
+--- end of INSTALL.UNX ---
index 4d9d64c..7d3ee6e 100644 (file)
@@ -1,36 +1,62 @@
 How to build the freetype2 library on VMS
 -----------------------------------------
 
-Just type one of the following depending on the type of external entries
-you want:
+It is actually very  straightforward to install the Freetype2 library.
+Just  execute vms_make.com from  the toplevel  directory to  build the
+library.  This procedure currently accepts the following options:
 
-  mms
+DEBUG
+  Build the library with debug information and without optimization.
 
-or
+lopts=<value>
+  Options to pass to the link command e.g. lopts=/traceback
 
-  mms/macro=("COMP_FLAGS=/name=(as_is,short)")
+ccopt=<value>
+  Options to pass to the C compiler e.g. ccopt=/float=ieee
+
+In case you did download the demos, place them in a separate directory
+sharing the same toplevel as the directory of Freetype2 and follow the
+same  instructions as  above  for  the demos  from  there.  The  build
+process relies on this to figure the location of the Freetype2 include
+files.
+
+
+To rebuild the  sources it is neccessary to  have MMS/MMK installed on
+the system.
 
 The library is avalaible in the directory
 
   [.LIB]
 
-To compile applications using FreeType  2 you have to define the logical
-FREETYPE pointing to the directory
+To  compile applications  using  FreeType  2 you  have  to define  the
+logical FREETYPE pointing to the directory
 
   [.INCLUDE.FREETYPE]
 
-i.e.,  if the directory  in which  this INSTALL.VMS  file is  located is
+i.e., if  the directory in which  this INSTALL.VMS file  is located is
 $disk:[freetype] then define the logical with
 
   define freetype $disk:[freetype.include.freetype]
 
-This version  has been  tested with Compaq  C V6.2-006 on  OpenVMS Alpha
+This version has  been tested with Compaq C  V6.2-006 on OpenVMS Alpha
 V7.2-1.
 
 
   Any problems can be reported to
 
-    Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+    Jouk Jansen <joukj@hrem.stm.tudelft.nl> or
+    Martin P.J. Zinser <zinser@zinser.no-ip.info>
+
+------------------------------------------------------------------------
+
+Copyright 2000, 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.
 
 
 --- end of INSTALL.VMS ---
index 717bb7d..f36778b 100644 (file)
@@ -7,7 +7,7 @@
 WE HAVE  DISCOVERED THAT APPLE  OWNS SEVERAL PATENTS RELATED  TO THE
 RENDERING OF TRUETYPE  FONTS.  THIS COULD MEAN THAT  THE FREE USE OF
 FREETYPE  MIGHT BE  ILLEGAL IN  THE USA,  JAPAN, AND  POSSIBLY OTHER
-COUNTRIES, BE IT IN COMMERCIAL OR OPEN SOURCE PRODUCTS.
+COUNTRIES, BE IT IN PROPRIETARY OR FREE SOFTWARE PRODUCTS.
 
 FOR  MORE DETAILS,  WE STRONGLY  ADVISE YOU  TO GO  TO  THE FREETYPE
 PATENTS PAGE AT THE FOLLOWING WEB ADDRESS:
index 592809a..530ab5b 100644 (file)
@@ -1,5 +1,5 @@
-Here is a list of items that need to be addressed in FreeType 2; they are
-not exactly bugs, but should be considered though:
+Here is a list of items that need to be addressed in FreeType 2
+---------------------------------------------------------------
 
 * Implement stem3/counter hints properly in the Postscript hinter.
 
@@ -17,7 +17,32 @@ not exactly bugs, but should be considered though:
 
 * Add kerning (AFM file) support to the CID driver.
 
-* Possibly add support for reading PFM files.
+
+Here is a list of bugs which should be handled
+----------------------------------------------
+
+Other bugs have been registered at the savannah bugzilla of FreeType.
+
+* CID driver:
+    Handle the case where a CID font has a top-level font matrix also
+    (see PLRM, 5.11.3, Type 0 CIDFonts).  Since CID_FaceInfoRec lacks
+    a font_matrix entry we have to directly apply it to all subfont
+    matrices.
+
+* CID driver:
+    Use top-level font matrix entry for setting the upem value, not the
+    entries in the FDarray.  If absent, use 1000.
+
+------------------------------------------------------------------------
+
+Copyright 2001, 2002, 2003, 2004, 2005 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
 
 
 --- end of TODO ---
index 68ecf19..30029f4 100644 (file)
@@ -22,5 +22,16 @@ How to enable the TrueType native hinter if you need it
 
   These steps must be done _before_ compiling the library.
 
+------------------------------------------------------------------------
+
+Copyright 2003 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
 
 --- end of TRUETYPE ---
index 0246b97..6c273d4 100644 (file)
@@ -123,5 +123,16 @@ SPECIAL NOTE FOR UNIX USERS
     distributor to help  clear this issue in case  the information given
     here doesn't help.
 
+------------------------------------------------------------------------
+
+Copyright 2003 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
 
 ---- end of UPGRADE.UNX ---
index 9e27a57..ff266ef 100644 (file)
@@ -52,6 +52,7 @@ systems, but not all of them:
 
     release    libtool      so
   -------------------------------
+     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
@@ -106,5 +107,16 @@ other release numbers.
    CPPFLAGS="$old_CPPFLAGS"],
   [AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])])
 
+------------------------------------------------------------------------
+
+Copyright 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.
+
 
 --- end of VERSION.DLL ---
index b11f6c4..332af0a 100644 (file)
@@ -39,9 +39,9 @@ reference document and whether it is supported in FreeType 2.
 
 
 Please send additions and/or corrections to wl@gnu.org or to the
-FreeType developer's list at devel@freetype (for subscribers only).  If
-you can provide a font example for a format which isn't supported yet
-please send a mail too.
+FreeType developer's list at freetype-devel@nongnu.org (for subscribers
+only).  If you can provide a font example for a format which isn't
+supported yet please send a mail too.
 
 
 file wrapper font   font    glyph      FreeType reference
@@ -65,8 +65,8 @@ MAC  SFNT    PS     CFF     ---        cff      OT spec, 5176.CFF.pdf
 MAC  SFNT    PS     CFF     CID        cff      OT spec, 5176.CFF.pdf
 ---  SFNT    PS     CFF     SYNTHETIC  ---      OT spec, 5176.CFF.pdf
 MAC  SFNT    PS     CFF     SYNTHETIC  ---      OT spec, 5176.CFF.pdf
----  SFNT    TT     SBIT    ---        ---      XFree86? (bitmaps only;
-                                                `head' table)
+---  SFNT    TT     SBIT    ---        sfnt     XFree86 (bitmaps only;
+                                                with `head' table)
 ---  SFNT    TT     MACSBIT ---        sfnt     OT spec (for the Mac;
                                                 bitmaps only; `bhed' table)
 MAC  SFNT    TT     MACSBIT ---        sfnt     OT spec (for the Mac;
@@ -137,3 +137,17 @@ MAC  ---     PS     TYPE_1  ---        type1    T1_SPEC.pdf
       http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=18799
 
     (free registration required).
+
+------------------------------------------------------------------------
+
+Copyright 2004, 2005 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
+
+--- end of formats.txt ---
index 876cc4b..102a03d 100644 (file)
@@ -25,4 +25,4 @@ Window System.   It is  compatible to the  above two licenses  (see file
 src/pcf/readme).
 
 
---- end of licence.txt ---
+--- end of LICENSE.TXT ---
index 04f4d12..e1a8cfd 100644 (file)
@@ -12,3 +12,17 @@ Note that the use of `psnames' can be controlled in ftconfig.h
   type42       truetype
   psaux        psnames
   sfnt         psnames
+
+------------------------------------------------------------------------
+
+Copyright 2001, 2002 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
+
+--- end of modules.txt ---
index 078c51a..183e0ce 100644 (file)
@@ -616,6 +616,17 @@ II. Rendering Technology
     Once the spans  have been `created', we can  simply draw them in
     the target bitmap.
 
+------------------------------------------------------------------------
+
+Copyright 2003 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
 
 --- end of raster.txt ---
 
index 7cf37b8..9f51c43 100644 (file)
@@ -5,7 +5,9 @@ How to prepare a new release
   FREETYPE_PATCH.
 
 . builds/unix/configure.ac (version_info): Update according to the libtool
-  rules, then regenerate the configure script.
+  rules, then regenerate the configure script with the top-level
+  `autogen.sh'.  After that, update `config.guess' and `config.sub' to
+  the most recent versions (from the `config' CVS repository).
 
 . builds/freetype.mk (refdoc): Update the `--title' option.
 
@@ -17,6 +19,11 @@ How to prepare a new release
 
 . ChangeLog: Announce new release.
 
+
+********* The items below should be done but are out-of-date due *********
+********* to the move of the FreeType CVS and web pages.         *********
+
+
 . Call `make refdoc' to update HTML reference.  Copy it to
   freetype2/docs/reference in the `www' CVS module and update the CVS.
   Then call `update-www' in ~/cvs/scripts on www.freetype.org to
@@ -30,3 +37,17 @@ How to prepare a new release
 . Create an md5 checksum file (with md5sum).
 
 . Announce new release on announce@freetype.org and to relevant newsgroups.
+
+------------------------------------------------------------------------
+
+Copyright 2003, 2005 by
+David Turner, Robert Wilhelm, and Werner Lemberg.
+
+This  file  is  part  of the  FreeType  project, and may  only be  used,
+modified,  and  distributed  under  the  terms of  the FreeType  project
+license, LICENSE.TXT.   By continuing to use, modify, or distribute this
+file you  indicate that  you have  read the  license and understand  and
+accept it fully.
+
+
+--- end of release ---
index b64a52d..8b2addc 100644 (file)
@@ -3,24 +3,23 @@ EXPORTS
 FT_Done_Memory
 FT_New_Memory
 FT_Stream_Open
-ft_debug_init
 FT_Trace_Get_Count
 FT_Trace_Get_Name
+ft_debug_init
 FT_Add_Default_Modules
 FT_Done_FreeType
 FT_Init_FreeType
-_debug_mem_dummy
 FT_Activate_Size
-FT_Add_Module
 FT_Add64
+FT_Add_Module
 FT_Alloc
 FT_Angle_Diff
 FT_Atan2
 FT_Attach_File
 FT_Attach_Stream
-FT_CeilFix
 FT_CMap_Done
 FT_CMap_New
+FT_CeilFix
 FT_Cos
 FT_Div64by32
 FT_DivFix
@@ -30,9 +29,9 @@ FT_Done_Library
 FT_Done_Size
 FT_FloorFix
 FT_Free
+FT_Get_CMap_Language_ID
 FT_Get_Char_Index
 FT_Get_Charmap_Index
-FT_Get_CMap_Language_ID
 FT_Get_First_Char
 FT_Get_Glyph_Name
 FT_Get_Kerning
@@ -55,9 +54,6 @@ FT_GlyphLoader_New
 FT_GlyphLoader_Prepare
 FT_GlyphLoader_Reset
 FT_GlyphLoader_Rewind
-ft_glyphslot_alloc_bitmap
-ft_glyphslot_free_bitmap
-ft_glyphslot_set_bitmap
 FT_Library_Version
 FT_List_Add
 FT_List_Finalize
@@ -70,7 +66,6 @@ FT_Load_Char
 FT_Load_Glyph
 FT_Load_Sfnt_Table
 FT_Lookup_Renderer
-ft_module_get_service
 FT_MulDiv
 FT_MulFix
 FT_MulTo64
@@ -85,6 +80,7 @@ FT_Outline_Copy
 FT_Outline_Decompose
 FT_Outline_Done
 FT_Outline_Done_Internal
+FT_Outline_Embolden
 FT_Outline_Get_Bitmap
 FT_Outline_Get_CBox
 FT_Outline_Get_Orientation
@@ -105,13 +101,13 @@ FT_Render_Glyph
 FT_Render_Glyph_Internal
 FT_RoundFix
 FT_Select_Charmap
-ft_service_list_lookup
 FT_Set_Char_Size
 FT_Set_Charmap
 FT_Set_Debug_Hook
 FT_Set_Pixel_Sizes
 FT_Set_Renderer
 FT_Set_Transform
+FT_Sfnt_Table_Info
 FT_Sin
 FT_Sqrt32
 FT_SqrtFixed
@@ -141,20 +137,31 @@ FT_Stream_ReadShortLE
 FT_Stream_ReleaseFrame
 FT_Stream_Seek
 FT_Stream_Skip
+FT_Stream_TryRead
 FT_Tan
-ft_validator_error
-ft_validator_init
-ft_validator_run
 FT_Vector_From_Polar
 FT_Vector_Length
 FT_Vector_Polarize
 FT_Vector_Rotate
 FT_Vector_Transform
 FT_Vector_Unit
+ft_glyphslot_alloc_bitmap
+ft_glyphslot_free_bitmap
+ft_glyphslot_set_bitmap
+ft_highpow2
+ft_module_get_service
+ft_service_list_lookup
+ft_validator_error
+ft_validator_init
+ft_validator_run
+FT_Bitmap_Convert
+FT_Bitmap_Copy
+FT_Bitmap_Done
+FT_Bitmap_Embolden
+FT_Bitmap_New
 FT_Outline_Get_BBox
 FT_Get_BDF_Charset_ID
 FT_Get_BDF_Property
-ft_bitmap_glyph_class
 FT_Done_Glyph
 FT_Get_Glyph
 FT_Glyph_Copy
@@ -163,13 +170,13 @@ FT_Glyph_To_Bitmap
 FT_Glyph_Transform
 FT_Matrix_Invert
 FT_Matrix_Multiply
-ft_outline_glyph_class
 FT_Get_MM_Var
 FT_Get_Multi_Master
 FT_Set_MM_Blend_Coordinates
 FT_Set_MM_Design_Coordinates
 FT_Set_Var_Blend_Coordinates
 FT_Set_Var_Design_Coordinates
+FT_OpenType_Validate
 FT_Get_PFR_Advance
 FT_Get_PFR_Kerning
 FT_Get_PFR_Metrics
@@ -191,29 +198,21 @@ FT_Stroker_New
 FT_Stroker_ParseOutline
 FT_Stroker_Rewind
 FT_Stroker_Set
+FT_GlyphSlot_Embolden
+FT_GlyphSlot_Oblique
 FT_Get_PS_Font_Info
+FT_Get_PS_Font_Private
 FT_Has_PS_Glyph_Names
 FT_Get_WinFNT_Header
 FT_Get_X11_Font_Format
-ah_arctan
-autohint_module_class
-ft_autohinter_service
-bdf_cmap_class
-bdf_driver_class
-ftc_basic_image_cache_class
-ftc_basic_image_family_class
-ftc_basic_sbit_cache_class
-ftc_basic_sbit_family_class
+FTC_CMapCache_Lookup
+FTC_CMapCache_New
 FTC_Cache_Clear
 FTC_Cache_Done
 FTC_Cache_Init
 FTC_Cache_Lookup
 FTC_Cache_NewNode
 FTC_Cache_RemoveFaceID
-ftc_cmap_cache_class
-FTC_CMapCache_Lookup
-FTC_CMapCache_New
-ftc_face_list_class
 FTC_Family_Init
 FTC_GCache_Done
 FTC_GCache_Init
@@ -223,11 +222,11 @@ FTC_GNode_Compare
 FTC_GNode_Done
 FTC_GNode_Init
 FTC_GNode_UnselectFamily
-FTC_ImageCache_Lookup
-FTC_ImageCache_New
 FTC_INode_Free
 FTC_INode_New
 FTC_INode_Weight
+FTC_ImageCache_Lookup
+FTC_ImageCache_New
 FTC_Manager_Compress
 FTC_Manager_Done
 FTC_Manager_FlushN
@@ -248,57 +247,15 @@ FTC_MruList_Reset
 FTC_MruNode_Prepend
 FTC_MruNode_Remove
 FTC_MruNode_Up
-ftc_node_destroy
 FTC_Node_Unref
 FTC_SBitCache_Lookup
 FTC_SBitCache_New
-ftc_size_list_class
 FTC_SNode_Compare
 FTC_SNode_Free
 FTC_SNode_New
 FTC_SNode_Weight
-cff_cmap_encoding_class_rec
-cff_cmap_unicode_class_rec
-cff_driver_class
-t1cid_driver_class
+ftc_node_destroy
 FT_Stream_OpenGzip
 FT_Stream_OpenLZW
-pcf_cmap_class
-pcf_driver_class
-pfr_cmap_class_rec
-pfr_driver_class
-pfr_metrics_service_rec
-ps_parser_funcs
-ps_table_funcs
-psaux_module_class
-t1_builder_funcs
-t1_cmap_classes
-t1_cmap_custom_class_rec
-t1_cmap_expert_class_rec
-t1_cmap_standard_class_rec
-t1_cmap_unicode_class_rec
-t1_decoder_funcs
 ps_hints_apply
-pshinter_module_class
-psnames_module_class
-ft_raster1_renderer_class
-ft_raster5_renderer_class
-ft_standard_raster
-sbit_metrics_fields
-sfnt_module_class
-tt_cmap0_class_rec
-tt_cmap10_class_rec
-tt_cmap12_class_rec
-tt_cmap2_class_rec
-tt_cmap4_class_rec
-tt_cmap6_class_rec
-tt_cmap8_class_rec
-ft_grays_raster
-ft_smooth_lcd_renderer_class
-ft_smooth_lcdv_renderer_class
-ft_smooth_renderer_class
 gray_raster_render
-tt_driver_class
-t1_driver_class
-t42_driver_class
-winfnt_driver_class
index 6c131c1..96b881b 100644 (file)
                        <file>ftbase.c</file>\r
                        <file>ftbbox.c</file>\r
                        <file>ftbdf.c</file>\r
+                       <file>ftbitmap.c</file>\r
                        <file>ftglyph.c</file>\r
                        <file>ftmm.c</file>\r
+                       <file>ftotval.c</file>\r
                        <file>ftpfr.c</file>\r
                        <file>ftstroke.c</file>\r
+                       <file>ftsynth.c</file>\r
                        <file>fttype1.c</file>\r
                        <file>ftwinfnt.c</file>\r
                        <file>ftxf86.c</file>\r
                </directory>\r
-               <directory name="autohint">\r
-                       <file>autohint.c</file>\r
+               <directory name="autofit">\r
+                       <file>autofit.c</file>\r
                </directory>\r
                <directory name="bdf">\r
                        <file>bdf.c</file>\r
                <directory name="lzw">\r
                        <file>ftlzw.c</file>\r
                </directory>\r
+               <directory name="otvalid">\r
+                       <file>otvbase.c</file>\r
+                       <file>otvcommn.c</file>\r
+                       <file>otvgpos.c</file>\r
+                       <file>otvgsub.c</file>\r
+                       <file>otvgdef.c</file>\r
+                       <file>otvjstf.c</file>\r
+                       <file>otvmod.c</file>\r
+               </directory>\r
                <directory name="pcf">\r
                        <file>pcf.c</file>\r
                </directory>\r
index 7c7688d..f2e1028 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType internal cache interface (specification).                   */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -248,7 +248,8 @@ FT_BEGIN_HEADER
     error = FTC_Cache_NewNode( _cache, _hash, query, &_node );           \
                                                                          \
   _Ok:                                                                   \
-    *(FTC_Node*)&(node) = _node;                                         \
+    _pnode = (FTC_Node*)(void*)&(node);                                  \
+    *_pnode = _node;                                                     \
   FT_END_STMNT
 
 #else /* !FTC_INLINE */
@@ -261,6 +262,52 @@ FT_BEGIN_HEADER
 
 #endif /* !FTC_INLINE */
 
+
+  /*
+   * This macro, together with FTC_CACHE_TRYLOOP_END, defines a retry
+   * loop to flush the cache repeatedly in case of memory overflows.
+   *
+   * It is used when creating a new cache node, or within a lookup
+   * that needs to allocate data (e.g., the sbit cache lookup).
+   * 
+   * Example:
+   *
+   *   {
+   *     FTC_CACHE_TRYLOOP( cache )
+   *       error = load_data( ... );
+   *     FTC_CACHE_TRYLOOP_END()
+   *   }
+   *
+   */
+#define FTC_CACHE_TRYLOOP( cache )                           \
+  {                                                          \
+    FTC_Manager  _try_manager = FTC_CACHE( cache )->manager; \
+    FT_UInt      _try_count   = 4;                           \
+                                                             \
+                                                             \
+    for (;;)                                                 \
+    {                                                        \
+      FT_UInt  _try_done;
+
+
+#define FTC_CACHE_TRYLOOP_END()                                   \
+      if ( !error || error != FT_Err_Out_Of_Memory )              \
+        break;                                                    \
+                                                                  \
+      _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
+      if ( _try_done == 0 )                                       \
+        break;                                                    \
+                                                                  \
+      if ( _try_done == _try_count )                              \
+      {                                                           \
+        _try_count *= 2;                                          \
+        if ( _try_count < _try_done              ||               \
+            _try_count > _try_manager->num_nodes )                \
+          _try_count = _try_manager->num_nodes;                   \
+      }                                                           \
+    }                                                             \
+  }
+
  /* */
 
 FT_END_HEADER
index be237f9..3f8301a 100644 (file)
@@ -238,7 +238,7 @@ FT_BEGIN_HEADER
 #define FTC_CACHE__GCACHE_CLASS( x ) \
           FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
 #define FTC_CACHE__FAMILY_CLASS( x ) \
-          ((FTC_MruListClass) FTC_CACHE__GCACHE_CLASS(x)->family_class)
+          ( (FTC_MruListClass)FTC_CACHE__GCACHE_CLASS( x )->family_class )
 
 
   /* convenience function; use it instead of FTC_Manager_Register_Cache */
@@ -255,6 +255,14 @@ FT_BEGIN_HEADER
                      FTC_Node    *anode );
 
 
+  /* */
+
+
+#define FTC_FAMILY_FREE( family, cache )                      \
+          FTC_MruList_Remove( &FTC_GCACHE((cache))->families, \
+                              (FTC_MruNode)(family) )
+
+
 #ifdef FTC_INLINE
 
 #define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash,                \
@@ -270,7 +278,17 @@ FT_BEGIN_HEADER
     FTC_MRULIST_LOOKUP_CMP( &_gcache->families, _gquery, _fcompare,         \
                             _gquery->family, error );                       \
     if ( !error )                                                           \
+    {                                                                       \
+      FTC_Family  _gqfamily = _gquery->family;                              \
+                                                                            \
+                                                                            \
+      _gqfamily->num_nodes++;                                               \
+                                                                            \
       FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error );     \
+                                                                            \
+      if ( --_gqfamily->num_nodes == 0 )                                    \
+        FTC_FAMILY_FREE( _gqfamily, _gcache );                              \
+    }                                                                       \
   FT_END_STMNT
   /* */
 
index d70c5cc..ac1a1a9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Simple MRU list-cache (specification).                               */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004 by                                     */
+/*  Copyright 2000-2001, 2003, 2004, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -172,34 +172,35 @@ FT_BEGIN_HEADER
   FT_BEGIN_STMNT                                                            \
     FTC_MruNode*             _pfirst  = &(list)->nodes;                     \
     FTC_MruNode_CompareFunc  _compare = (FTC_MruNode_CompareFunc)(compare); \
-    FTC_MruNode              _first, _node;                              \
-                                                                         \
-                                                                         \
-    error  = 0;                                                          \
-    _first = *(_pfirst);                                                 \
-    _node  = NULL;                                                       \
-                                                                         \
-    if ( _first )                                                        \
-    {                                                                    \
-      _node = _first;                                                    \
-      do                                                                 \
-      {                                                                  \
-        if ( _compare( _node, (key) ) )                                  \
-        {                                                                \
-          if ( _node != _first )                                         \
-            FTC_MruNode_Up( _pfirst, _node );                            \
-                                                                         \
-          *(FTC_MruNode*)&(node) = _node;                                \
-          goto _MruOk;                                                   \
-        }                                                                \
-        _node = _node->next;                                             \
-                                                                         \
-      } while ( _node != _first) ;                                       \
-    }                                                                    \
-                                                                         \
-    error = FTC_MruList_New( (list), (key), (FTC_MruNode*)&(node) );     \
-  _MruOk:                                                                \
-    ;                                                                    \
+    FTC_MruNode              _first, _node, *_pnode;                        \
+                                                                            \
+                                                                            \
+    error  = 0;                                                             \
+    _first = *(_pfirst);                                                    \
+    _node  = NULL;                                                          \
+                                                                            \
+    if ( _first )                                                           \
+    {                                                                       \
+      _node = _first;                                                       \
+      do                                                                    \
+      {                                                                     \
+        if ( _compare( _node, (key) ) )                                     \
+        {                                                                   \
+          if ( _node != _first )                                            \
+            FTC_MruNode_Up( _pfirst, _node );                               \
+                                                                            \
+          _pnode = (FTC_MruNode*)(void*)&(node);                            \
+          *_pnode = _node;                                                  \
+          goto _MruOk;                                                      \
+        }                                                                   \
+        _node = _node->next;                                                \
+                                                                            \
+      } while ( _node != _first) ;                                          \
+    }                                                                       \
+                                                                            \
+    error = FTC_MruList_New( (list), (key), (FTC_MruNode*)(void*)&(node) ); \
+  _MruOk:                                                                   \
+    ;                                                                       \
   FT_END_STMNT
 
 #define FTC_MRULIST_LOOKUP( list, key, node, error ) \
index 4bd8cf6..e878efb 100644 (file)
@@ -72,20 +72,23 @@ FT_BEGIN_HEADER
 
 
   /* The size of an `int' type.  */
-#if   FT_UINT_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)
-#elif FT_UINT_MAX == 0xFFFFU
+#if                                 FT_UINT_MAX == 0xFFFFUL
 #define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)
-#elif FT_UINT_MAX > 0xFFFFFFFFU && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFU
+#elif                               FT_UINT_MAX == 0xFFFFFFFFUL
+#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)
+#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
 #define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)
 #else
 #error "Unsupported size of `int' type!"
 #endif
 
-  /* The size of a `long' type.  */
-#if   FT_ULONG_MAX == 0xFFFFFFFFUL
+  /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */
+  /* DM642) is recognized but avoided.                                   */
+#if                                  FT_ULONG_MAX == 0xFFFFFFFFUL
+#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)
+#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
 #define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)
-#elif FT_ULONG_MAX > 0xFFFFFFFFU && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFU
+#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
 #define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)
 #else
 #error "Unsupported size of `long' type!"
index b996a7a..a6df10d 100644 (file)
@@ -18,6 +18,7 @@
 #ifndef __FT_HEADER_H__
 #define __FT_HEADER_H__
 
+
   /*@***********************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
@@ -92,6 +93,7 @@
   /*                                                                       */
   /*************************************************************************/
 
+
   /* configuration files */
 
   /*************************************************************************/
   /*                                                                       */
 #define FT_BDF_H  <freetype/ftbdf.h>
 
+
   /*************************************************************************/
   /*                                                                       */
   /* @macro:                                                               */
 #define FT_GLYPH_H  <freetype/ftglyph.h>
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* @macro:                                                               */
+  /*    FT_BITMAP_H                                                        */
+  /*                                                                       */
+  /* @description:                                                         */
+  /*    A macro used in #include statements to name the file containing    */
+  /*    the API of the optional bitmap conversion component.               */
+  /*                                                                       */
+#define FT_BITMAP_H  <freetype/ftbitmap.h>
+
+
   /*************************************************************************/
   /*                                                                       */
   /* @macro:                                                               */
   /*                                                                       */
 #define FT_SFNT_NAMES_H  <freetype/ftsnames.h>
 
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* @macro:                                                               */
+  /*    FT_OPENTYPE_VALIDATE_H                                             */
+  /*                                                                       */
+  /* @description:                                                         */
+  /*    A macro used in #include statements to name the file containing    */
+  /*    the optional FreeType 2 API used to validate OpenType tables       */
+  /*    (BASE, GDEF, GPOS, GSUB, JSTF).                                    */
+  /*                                                                       */
+#define FT_OPENTYPE_VALIDATE_H  <freetype/ftotval.h>
+
+
   /* */
 
 #define FT_TRIGONOMETRY_H       <freetype/fttrigon.h>
index c00a489..b8f67bb 100644 (file)
@@ -1,10 +1,12 @@
-FT_USE_MODULE(autohint_module_class)
+FT_USE_MODULE(autofit_module_class)
 FT_USE_MODULE(tt_driver_class)
 FT_USE_MODULE(t1_driver_class)
 FT_USE_MODULE(cff_driver_class)
 FT_USE_MODULE(t1cid_driver_class)
+FT_USE_MODULE(pfr_driver_class)
+FT_USE_MODULE(t42_driver_class)
+FT_USE_MODULE(winfnt_driver_class)
 FT_USE_MODULE(pcf_driver_class)
-FT_USE_MODULE(bdf_driver_class)
 FT_USE_MODULE(psaux_module_class)
 FT_USE_MODULE(psnames_module_class)
 FT_USE_MODULE(pshinter_module_class)
@@ -13,7 +15,5 @@ FT_USE_MODULE(sfnt_module_class)
 FT_USE_MODULE(ft_smooth_renderer_class)
 FT_USE_MODULE(ft_smooth_lcd_renderer_class)
 FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
-FT_USE_MODULE(t42_driver_class)
-FT_USE_MODULE(pfr_driver_class)
-FT_USE_MODULE(winfnt_driver_class)
-
+FT_USE_MODULE(otv_module_class)
+FT_USE_MODULE(bdf_driver_class)
index 028c6ea..e6f34b4 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    User-selectable configuration macros (specification only).           */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -436,7 +436,7 @@ FT_BEGIN_HEADER
   /*   Do not #undef this macro here, since the build system might         */
   /*   define it for certain configurations only.                          */
   /*                                                                       */
-/* #define  TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
 
   /*************************************************************************/
@@ -446,9 +446,9 @@ FT_BEGIN_HEADER
   /* work-around hinting system.  Note that for the moment, the algorithm  */
   /* is only used when selected at runtime through the parameter tag       */
   /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook               */
-  /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally actived                  */
+  /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally activated.               */
   /*                                                                       */
-#define TT_CONFIG_OPTION_UNPATENTED_HINTING
+//#define TT_CONFIG_OPTION_UNPATENTED_HINTING
 
 
   /*************************************************************************/
@@ -550,23 +550,11 @@ FT_BEGIN_HEADER
  /* */
 
 /*
- * The FT_CONFIG_OPTION_CHESTER_XXXX macros are used to toggle some recent
- * improvements to the auto-hinter contributed by David Chester.  They will
- * most likely disappear completely in the next release.  For now, you
- * should always keep them defined.
+ * This temporary macro is used to control various optimizations for
+ * reducing the heap footprint of memory-mapped TrueType files.
  *
  */
-#define  FT_CONFIG_OPTION_CHESTER_HINTS
-
-#ifdef   FT_CONFIG_OPTION_CHESTER_HINTS
-
-#define  FT_CONFIG_CHESTER_SMALL_F
-#define  FT_CONFIG_CHESTER_ASCENDER
-#define  FT_CONFIG_CHESTER_SERIF
-#define  FT_CONFIG_CHESTER_STEM
-#define  FT_CONFIG_CHESTER_BLUE_SCALE
-
-#endif /* FT_CONFIG_OPTION_CHESTER_HINTS */
+/* #define  FT_OPTIMIZE_MEMORY */
 
 FT_END_HEADER
 
index 297d6f0..4b9b398 100644 (file)
 #define __FTSTDLIB_H__
 
 
+#include <stddef.h>
+
+#define ft_ptrdiff_t  ptrdiff_t
+
+
   /**********************************************************************/
   /*                                                                    */
   /*                           integer limits                           */
@@ -61,6 +66,7 @@
 #include <limits.h>
 
 #define FT_UINT_MAX   UINT_MAX
+#define FT_INT_MAX    INT_MAX
 #define FT_ULONG_MAX  ULONG_MAX
 
 
index 3780a28..7b2a96c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType high-level API and common types (specification only).       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -44,7 +44,7 @@
   /*                                                                       */
 #define FREETYPE_MAJOR 2
 #define FREETYPE_MINOR 1
-#define FREETYPE_PATCH 9
+#define FREETYPE_PATCH 10
 
 
 #include <ft2build.h>
@@ -1912,8 +1912,8 @@ FT_BEGIN_HEADER
   /*    @FT_Open_Face can be used to determine and/or check the font       */
   /*    format of a given font resource.  If the `face_index' field is     */
   /*    negative, the function will _not_ return any face handle in        */
-  /*    `*face'; the return value is 0 if the font format is recognized,   */
-  /*    or non-zero otherwise.                                             */
+  /*    `*aface'; the function's return value is 0 if the font format is   */
+  /*    recognized, or non-zero otherwise.                                 */
   /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Open_Face( FT_Library           library,
@@ -2041,8 +2041,9 @@ FT_BEGIN_HEADER
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    When dealing with fixed-size faces (i.e., non-scalable formats),   */
-  /*    @FT_Set_Pixel_Sizes provides a more convenient interface.          */
+  /*    For BDF and PCF formats, this function uses the `PIXEL_SIZE'       */
+  /*    property of the bitmap font; the `char_width' parameter is         */
+  /*    ignored.                                                           */
   /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Set_Char_Size( FT_Face     face,
@@ -2095,6 +2096,9 @@ FT_BEGIN_HEADER
   /*    which contain a single bitmap strike only (BDF, PCF, FNT) ignore   */
   /*    `pixel_width'.                                                     */
   /*                                                                       */
+  /*    For BDF and PCF formats, this function uses the sum of the         */
+  /*    `FONT_ASCENT' and `FONT_DESCENT' properties of the bitmap font.    */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Set_Pixel_Sizes( FT_Face  face,
                       FT_UInt  pixel_width,
@@ -2272,9 +2276,11 @@ FT_BEGIN_HEADER
   *
   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
   *     Indicates that the glyph loader should ignore the global advance
-  *     width defined in the font.  As far as we know, this is only used by
-  *     the X-TrueType font server, in order to deal correctly with the
-  *     incorrect metrics contained in DynaLab's TrueType CJK fonts.
+  *     width defined in the font.  For historical reasons (to support
+  *     buggy CJK fonts), FreeType uses the value of the `advanceWidthMax'
+  *     field in the `htmx' table for all glyphs if the font is monospaced.
+  *     Activating this flags makes FreeType use the metric values given in
+  *     the `htmx' table.
   *
   *   FT_LOAD_NO_RECURSE ::
   *     This flag is only used internally.  It merely indicates that the
@@ -2364,8 +2370,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    A function used to set the transformation that is applied to glyph */
-  /*    images just before they are converted to bitmaps in a glyph slot   */
-  /*    when @FT_Render_Glyph is called.                                   */
+  /*    images when they are loaded into a glyph slot through              */
+  /*    @FT_Load_Glyph.                                                    */
   /*                                                                       */
   /* <InOut>                                                               */
   /*    face   :: A handle to the source face object.                      */
@@ -2579,9 +2585,9 @@ FT_BEGIN_HEADER
   /*                   kerning vector.                                     */
   /*                                                                       */
   /* <Output>                                                              */
-  /*    akerning    :: The kerning vector.  This is in font units for      */
-  /*                   scalable formats, and in pixels for fixed-sizes     */
-  /*                   formats.                                            */
+  /*    akerning    :: 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.              */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
@@ -2650,13 +2656,13 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Retrieves the ASCII Postscript name of a given face, if available. */
-  /*    This should only work with Postscript and TrueType fonts.          */
+  /*    This only works with Postscript and TrueType fonts.                */
   /*                                                                       */
   /* <Input>                                                               */
   /*    face :: A handle to the source face object.                        */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    A pointer to the face's Postscript name.  NULL if un-available.    */
+  /*    A pointer to the face's Postscript name.  NULL if unavailable.     */
   /*                                                                       */
   /* <Note>                                                                */
   /*    The returned pointer is owned by the face and will be destroyed    */
@@ -2883,7 +2889,7 @@ FT_BEGIN_HEADER
   /*    Computations                                                       */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    Crunching fixed numbers and vectors                                */
+  /*    Crunching fixed numbers and vectors.                               */
   /*                                                                       */
   /* <Description>                                                         */
   /*    This section contains various functions used to perform            */
@@ -3068,8 +3074,8 @@ FT_BEGIN_HEADER
   /*    The result is undefined if either `vector' or `matrix' is invalid. */
   /*                                                                       */
   FT_EXPORT( void )
-  FT_Vector_Transform( FT_Vector*  vec,
-                       FT_Matrix*  matrix );
+  FT_Vector_Transform( FT_Vector*        vec,
+                       const FT_Matrix*  matrix );
 
 
   /* */
index aa41144..493bca5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing BDF-specific strings (specification).     */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -38,13 +38,13 @@ FT_BEGIN_HEADER
   /*    bdf_fonts                                                          */
   /*                                                                       */
   /* <Title>                                                               */
-  /*    BDF Fonts                                                          */
+  /*    BDF Files                                                          */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    BDF-specific APIs                                                  */
+  /*    BDF specific API.                                                  */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    This section contains the declaration of BDF-specific functions.   */
+  /*    This section contains the declaration of BDF specific functions.   */
   /*                                                                       */
   /*************************************************************************/
 
diff --git a/reactos/lib/freetype/include/freetype/ftbitmap.h b/reactos/lib/freetype/include/freetype/ftbitmap.h
new file mode 100644 (file)
index 0000000..2868bb7
--- /dev/null
@@ -0,0 +1,206 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ftbitmap.h                                                             */\r
+/*                                                                         */\r
+/*    FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */\r
+/*    bitmaps into 8bpp format (specification).                            */  \r
+/*                                                                         */\r
+/*  Copyright 2004, 2005 by                                                */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __FTBITMAP_H__\r
+#define __FTBITMAP_H__\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_FREETYPE_H\r
+\r
+#ifdef FREETYPE_H\r
+#error "freetype.h of FreeType 1 has been loaded!"\r
+#error "Please fix the directory search order for header files"\r
+#error "so that freetype.h of FreeType 2 is found first."\r
+#endif\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* <Section>                                                             */\r
+  /*    bitmap_handling                                                    */\r
+  /*                                                                       */\r
+  /* <Title>                                                               */\r
+  /*    Bitmap Handling                                                    */\r
+  /*                                                                       */\r
+  /* <Abstract>                                                            */\r
+  /*    Handling FT_Bitmap objects.                                        */\r
+  /*                                                                       */\r
+  /* <Description>                                                         */\r
+  /*    This section contains functions for converting FT_Bitmap objects.  */\r
+  /*                                                                       */\r
+  /*************************************************************************/\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* <Function>                                                            */\r
+  /*    FT_Bitmap_New                                                      */\r
+  /*                                                                       */\r
+  /* <Description>                                                         */\r
+  /*    Initialize a pointer to an FT_Bitmap structure.                    */\r
+  /*                                                                       */\r
+  /* <InOut>                                                               */\r
+  /*    abitmap :: A pointer to the bitmap structure.                      */\r
+  /*                                                                       */\r
+  FT_EXPORT( void )\r
+  FT_Bitmap_New( FT_Bitmap  *abitmap );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* <Function>                                                            */\r
+  /*    FT_Bitmap_Copy                                                     */\r
+  /*                                                                       */\r
+  /* <Description>                                                         */\r
+  /*    Copies an bitmap into another one.                                 */\r
+  /*                                                                       */\r
+  /* <Input>                                                               */\r
+  /*    library :: A handle to a library object.                           */\r
+  /*                                                                       */\r
+  /*    source  :: A handle to the source bitmap.                          */\r
+  /*                                                                       */\r
+  /* <Output>                                                              */\r
+  /*    target  :: A handle to the target bitmap.                          */\r
+  /*                                                                       */\r
+  /* <Return>                                                              */\r
+  /*    FreeType error code.  0 means success.                             */\r
+  /*                                                                       */\r
+  FT_EXPORT_DEF( FT_Error )\r
+  FT_Bitmap_Copy( FT_Library        library,\r
+                  const FT_Bitmap  *source,\r
+                  FT_Bitmap        *target);\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* <Function>                                                            */\r
+  /*    FT_Bitmap_Embolden                                                 */\r
+  /*                                                                       */\r
+  /* <Description>                                                         */\r
+  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */\r
+  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */\r
+  /*    borders are kept unchanged.                                        */\r
+  /*                                                                       */\r
+  /* <Input>                                                               */\r
+  /*    library   :: A handle to a library object.                         */\r
+  /*                                                                       */\r
+  /*    xStrength :: How strong the glyph is emboldened horizontally.      */\r
+  /*                 Expressed in 26.6 pixel format.                       */\r
+  /*                                                                       */\r
+  /*    yStrength :: How strong the glyph is emboldened vertically.        */\r
+  /*                 Expressed in 26.6 pixel format.                       */\r
+  /*                                                                       */\r
+  /* <InOut>                                                               */\r
+  /*    bitmap    :: A handle to the target bitmap.                        */\r
+  /*                                                                       */\r
+  /* <Return>                                                              */\r
+  /*    FreeType error code.  0 means success.                             */\r
+  /*                                                                       */\r
+  /* <Note>                                                                */\r
+  /*    The current implementation restricts `xStrength' to be less than   */\r
+  /*    or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */\r
+  /*                                                                       */\r
+  /*    Don't embolden the bitmap owned by a @FT_GlyphSlot directly!  Call */\r
+  /*    @FT_Bitmap_Copy to get a copy and work on the copy instead.        */\r
+  /*                                                                       */\r
+  FT_EXPORT_DEF( FT_Error )\r
+  FT_Bitmap_Embolden( FT_Library  library,\r
+                      FT_Bitmap*  bitmap,\r
+                      FT_Pos      xStrength,\r
+                      FT_Pos      yStrength );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* <Function>                                                            */\r
+  /*    FT_Bitmap_Convert                                                  */\r
+  /*                                                                       */\r
+  /* <Description>                                                         */\r
+  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a  */\r
+  /*    bitmap object with depth 8bpp, making the number of used bytes per */\r
+  /*    line (a.k.a. the `pitch') a multiple of `alignment'.               */\r
+  /*                                                                       */\r
+  /* <Input>                                                               */\r
+  /*    library   :: A handle to a library object.                         */\r
+  /*                                                                       */\r
+  /*    source    :: The source bitmap.                                    */\r
+  /*                                                                       */\r
+  /*    alignment :: The pitch of the bitmap is a multiple of this         */\r
+  /*                 parameter.  Common values are 1, 2, or 4.             */\r
+  /*                                                                       */\r
+  /* <Output>                                                              */\r
+  /*    target    :: The target bitmap.                                    */\r
+  /*                                                                       */\r
+  /* <Return>                                                              */\r
+  /*    FreeType error code.  0 means success.                             */\r
+  /*                                                                       */\r
+  /* <Note>                                                                */\r
+  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */\r
+  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */\r
+  /*                                                                       */\r
+  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */\r
+  /*                                                                       */\r
+  /*    The `library' argument is taken to have access to FreeType's       */\r
+  /*    memory handling functions.                                         */\r
+  /*                                                                       */\r
+  FT_EXPORT( FT_Error )\r
+  FT_Bitmap_Convert( FT_Library        library,\r
+                     const FT_Bitmap  *source,\r
+                     FT_Bitmap        *target,\r
+                     FT_Int            alignment );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* <Function>                                                            */\r
+  /*    FT_Bitmap_Done                                                     */\r
+  /*                                                                       */\r
+  /* <Description>                                                         */\r
+  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */\r
+  /*                                                                       */\r
+  /* <Input>                                                               */\r
+  /*    library :: A handle to a library object.                           */\r
+  /*                                                                       */\r
+  /*    bitmap  :: The bitmap object to be freed.                          */\r
+  /*                                                                       */\r
+  /* <Return>                                                              */\r
+  /*    FreeType error code.  0 means success.                             */\r
+  /*                                                                       */\r
+  /* <Note>                                                                */\r
+  /*    The `library' argument is taken to have access to FreeType's       */\r
+  /*    memory handling functions.                                         */\r
+  /*                                                                       */\r
+  FT_EXPORT( FT_Error )\r
+  FT_Bitmap_Done( FT_Library  library,\r
+                  FT_Bitmap  *bitmap );\r
+\r
+\r
+  /* */\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __FTBITMAP_H__ */\r
+\r
+\r
+/* END */\r
index c26ce6b..985641c 100644 (file)
@@ -86,14 +86,6 @@ FT_BEGIN_HEADER
   /*   FTC_CMapCache_New                                                   */
   /*   FTC_CMapCache_Lookup                                                */
   /*                                                                       */
-  /*                                                                       */
-  /*   FTC_Image_Desc                                                      */
-  /*   FTC_Image_Cache                                                     */
-  /*   FTC_Image_Cache_Lookup                                              */
-  /*                                                                       */
-  /*   FTC_SBit_Cache                                                      */
-  /*   FTC_SBit_Cache_Lookup                                               */
-  /*                                                                       */
   /*************************************************************************/
 
 
index c134ec1..781160b 100644 (file)
@@ -1,3 +1,11 @@
+/***************************************************************************/
+/*                                                                         */
+/* This file defines the structure of the FreeType reference.              */
+/* It is used by the python script which generates the HTML files.         */
+/*                                                                         */
+/***************************************************************************/
+
+
 /***************************************************************************/
 /*                                                                         */
 /* <Chapter>                                                               */
@@ -31,6 +39,8 @@
 /*    sfnt_names                                                           */
 /*    bdf_fonts                                                            */
 /*    pfr_fonts                                                            */
+/*    winfnt_fonts                                                         */
+/*    ot_validation                                                        */
 /*                                                                         */
 /***************************************************************************/
 
 /*    computations                                                         */
 /*    list_processing                                                      */
 /*    outline_processing                                                   */
+/*    bitmap_handling                                                      */
 /*    raster                                                               */
+/*    glyph_stroker                                                        */
 /*    system_interface                                                     */
 /*    module_management                                                    */
+/*    gzip                                                                 */
+/*    lzw                                                                  */
 /*                                                                         */
 /***************************************************************************/
-
index 1def4f9..6a2bed0 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType error code handling (specification).                        */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   /* I - Error Formats                                                     */
   /* -----------------                                                     */
   /*                                                                       */
-  /*   Since release 2.1, the error constants have changed.  The lower     */
-  /*   byte of the error value gives the "generic" error code, while the   */
-  /*   higher byte indicates in which module the error occurred.           */
-  /*                                                                       */
-  /*   You can use the macro FT_ERROR_BASE(x) macro to extract the generic */
-  /*   error code from an FT_Error value.                                  */
-  /*                                                                       */
   /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */
-  /*   undefined in ftoption.h in order to make the higher byte always     */
-  /*   zero, in case you need to be compatible with previous versions of   */
-  /*   FreeType 2.                                                         */
+  /*   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.                                                     */
   /*                                                                       */
   /*                                                                       */
   /* II - Error Message strings                                            */
 #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 FT_Err_Ok, which must be 0! */
+  /* this is only used for <module>_Err_Ok, which must be 0! */
 #define FT_NOERRORDEF_( e, v, s ) \
           FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
 
 #endif
 
 
-  /* no include the error codes */
+  /* now include the error codes */
 #include FT_ERROR_DEFINITIONS_H
 
 
 #undef FT_NOERRORDEF_
 
 #undef FT_NEED_EXTERN_C
-#undef FT_ERR_PREFIX
-#undef FT_ERR_BASE
 #undef FT_ERR_CONCAT
+#undef FT_ERR_BASE
+
+  /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */
+#ifndef FT_KEEP_ERR_PREFIX
+#undef FT_ERR_PREFIX
+#endif
 
 #endif /* __FTERRORS_H__ */
 
index 5d7228b..ded96be 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Gzip-compressed stream support.                                      */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 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
   /*    GZIP Streams                                                       */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    Using gzip-compressed font files                                   */
+  /*    Using gzip-compressed font files.                                  */
   /*                                                                       */
   /* <Description>                                                         */
   /*    This section contains the declaration of Gzip-specific functions.  */
index 4682a4c..e92ace3 100644 (file)
@@ -5,7 +5,7 @@
 /*    FreeType glyph image formats and default raster interface            */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -264,25 +264,19 @@ FT_BEGIN_HEADER
   /*    pixel_mode   :: The pixel mode, i.e., how pixel bits are stored.   */
   /*                    See @FT_Pixel_Mode for possible values.            */
   /*                                                                       */
-  /*    palette_mode :: This field is only used with paletted pixel modes; */
-  /*                    it indicates how the palette is stored.            */
+  /*    palette_mode :: This field is intended for paletted pixel modes;   */
+  /*                    it indicates how the palette is stored.  Not       */
+  /*                    used currently.                                    */
   /*                                                                       */
-  /*    palette      :: A typeless pointer to the bitmap palette; only     */
-  /*                    used for paletted pixel modes.                     */
+  /*    palette      :: A typeless pointer to the bitmap palette; this     */
+  /*                    field is intended for paletted pixel modes.  Not   */
+  /*                    used currently.                                    */
   /*                                                                       */
   /* <Note>                                                                */
-  /*   For now, the only pixel mode supported by FreeType are mono and     */
+  /*   For now, the only pixel modes supported by FreeType are mono and    */
   /*   grays.  However, drivers might be added in the future to support    */
   /*   more `colorful' options.                                            */
   /*                                                                       */
-  /*   When using pixel modes pal2, pal4 and pal8 with a void `palette'    */
-  /*   field, a gray pixmap with respectively 4, 16, and 256 levels of     */
-  /*   gray is assumed.  This, in order to be compatible with some         */
-  /*   embedded bitmap formats defined in the TrueType specification.      */
-  /*                                                                       */
-  /*   Note that no font was found presenting such embedded bitmaps, so    */
-  /*   this is currently completely unhandled by the library.              */
-  /*                                                                       */
   typedef struct  FT_Bitmap_
   {
     int             rows;
@@ -772,7 +766,7 @@ FT_BEGIN_HEADER
   /*    raster                                                             */
   /*                                                                       */
   /* <Title>                                                               */
-  /*    Scanline converter                                                 */
+  /*    Scanline Converter                                                 */
   /*                                                                       */
   /* <Abstract>                                                            */
   /*    How vectorial outlines are converted into bitmaps and pixmaps.     */
@@ -1036,8 +1030,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  FT_Raster_Params_
   {
-    FT_Bitmap*              target;
-    void*                   source;
+    const FT_Bitmap*        target;
+    const void*             source;
     int                     flags;
     FT_SpanFunc             gray_spans;
     FT_SpanFunc             black_spans;
index a0a042e..2ebd500 100644 (file)
@@ -40,7 +40,7 @@ FT_BEGIN_HEADER
   /*    LZW Streams                                                        */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    Using LZW-compressed font files                                    */
+  /*    Using LZW-compressed font files.                                   */
   /*                                                                       */
   /* <Description>                                                         */
   /*    This section contains the declaration of LZW-specific functions.   */
index 78ed779..4ebf716 100644 (file)
@@ -41,7 +41,7 @@ FT_BEGIN_HEADER
   /*    mac_specific                                                       */
   /*                                                                       */
   /* <Title>                                                               */
-  /*    Mac-Specific Interface                                             */
+  /*    Mac Specific Interface                                             */
   /*                                                                       */
   /* <Abstract>                                                            */
   /*    Only available on the Macintosh.                                   */
index d190167..b0115dd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType module error offsets (specification).                       */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004 by                                    */
+/*  Copyright 2001, 2002, 2003, 2004, 2005 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 @@
   /* 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 0x1003, the error              */
-  /* `T1_Err_Invalid_File_Format' has value 0x1103, etc.                   */
+  /* `TT_Err_Invalid_File_Format' has value 0x1103, the error              */
+  /* `T1_Err_Invalid_File_Format' has value 0x1203, etc.                   */
   /*                                                                       */
   /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h   */
   /* to make the higher byte always zero (disabling the module error       */
 
 
   FT_MODERRDEF( Base,      0x000, "base module" )
-  FT_MODERRDEF( Autohint,  0x100, "autohinter module" )
+  FT_MODERRDEF( Autofit,   0x100, "autofitter module" )
   FT_MODERRDEF( BDF,       0x200, "BDF module" )
   FT_MODERRDEF( Cache,     0x300, "cache module" )
   FT_MODERRDEF( CFF,       0x400, "CFF module" )
   FT_MODERRDEF( CID,       0x500, "CID module" )
   FT_MODERRDEF( Gzip,      0x600, "Gzip module" )
   FT_MODERRDEF( LZW,       0x700, "LZW module" )
-  FT_MODERRDEF( PCF,       0x800, "PCF module" )
-  FT_MODERRDEF( PFR,       0x900, "PFR module" )
-  FT_MODERRDEF( PSaux,     0xA00, "PS auxiliary module" )
-  FT_MODERRDEF( PShinter,  0xB00, "PS hinter module" )
-  FT_MODERRDEF( PSnames,   0xC00, "PS names module" )
-  FT_MODERRDEF( Raster,    0xD00, "raster module" )
-  FT_MODERRDEF( SFNT,      0xE00, "SFNT module" )
-  FT_MODERRDEF( Smooth,    0xF00, "smooth raster module" )
-  FT_MODERRDEF( TrueType, 0x1000, "TrueType module" )
-  FT_MODERRDEF( Type1,    0x1100, "Type 1 module" )
-  FT_MODERRDEF( Type42,   0x1200, "Type 42 module" )
-  FT_MODERRDEF( Winfonts, 0x1300, "Windows FON/FNT module" )
+  FT_MODERRDEF( OTvalid,   0x800, "OpenType validation module" )
+  FT_MODERRDEF( PCF,       0x900, "PCF module" )
+  FT_MODERRDEF( PFR,       0xA00, "PFR module" )
+  FT_MODERRDEF( PSaux,     0xB00, "PS auxiliary module" )
+  FT_MODERRDEF( PShinter,  0xC00, "PS hinter module" )
+  FT_MODERRDEF( PSnames,   0xD00, "PS names module" )
+  FT_MODERRDEF( Raster,    0xE00, "raster module" )
+  FT_MODERRDEF( SFNT,      0xF00, "SFNT module" )
+  FT_MODERRDEF( Smooth,   0x1000, "smooth raster module" )
+  FT_MODERRDEF( TrueType, 0x1100, "TrueType module" )
+  FT_MODERRDEF( Type1,    0x1200, "Type 1 module" )
+  FT_MODERRDEF( Type42,   0x1300, "Type 42 module" )
+  FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" )
 
 
 #ifdef FT_MODERR_END_LIST
diff --git a/reactos/lib/freetype/include/freetype/ftotval.h b/reactos/lib/freetype/include/freetype/ftotval.h
new file mode 100644 (file)
index 0000000..abde366
--- /dev/null
@@ -0,0 +1,170 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ftotval.h                                                              */\r
+/*                                                                         */\r
+/*    FreeType API for validating OpenType tables (specification).         */\r
+/*                                                                         */\r
+/*  Copyright 2004, 2005 by                                                */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+/***************************************************************************/\r
+/*                                                                         */\r
+/*                                                                         */\r
+/* Warning: This module might be moved to a different library in the       */\r
+/*          future to avoid a tight dependency between FreeType and the    */\r
+/*          OpenType specification.                                        */\r
+/*                                                                         */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __FTOTVAL_H__\r
+#define __FTOTVAL_H__\r
+\r
+#include <ft2build.h>\r
+#include FT_FREETYPE_H\r
+\r
+#ifdef FREETYPE_H\r
+#error "freetype.h of FreeType 1 has been loaded!"\r
+#error "Please fix the directory search order for header files"\r
+#error "so that freetype.h of FreeType 2 is found first."\r
+#endif\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* <Section>                                                             */\r
+  /*    ot_validation                                                      */\r
+  /*                                                                       */\r
+  /* <Title>                                                               */\r
+  /*    OpenType Validation                                                */\r
+  /*                                                                       */\r
+  /* <Abstract>                                                            */\r
+  /*    An API to validate OpenType tables.                                */\r
+  /*                                                                       */\r
+  /* <Description>                                                         */\r
+  /*    This section contains the declaration of functions to validate     */\r
+  /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).               */\r
+  /*                                                                       */\r
+  /*************************************************************************/\r
+\r
+\r
+ /**********************************************************************\r
+  *\r
+  * @enum:\r
+  *    FT_VALIDATE_XXX\r
+  *\r
+  * @description:\r
+  *    A list of bit-field constants used with @FT_OpenType_Validate to\r
+  *    indicate which OpenType tables should be validated.\r
+  *\r
+  * @values:\r
+  *    FT_VALIDATE_BASE ::\r
+  *      Validate BASE table.\r
+  *\r
+  *    FT_VALIDATE_GDEF ::\r
+  *      Validate GDEF table.\r
+  *\r
+  *    FT_VALIDATE_GPOS ::\r
+  *      Validate GPOS table.\r
+  *\r
+  *    FT_VALIDATE_GSUB ::\r
+  *      Validate GSUB table.\r
+  *\r
+  *    FT_VALIDATE_JSTF ::\r
+  *      Validate JSTF table.\r
+  *\r
+  *    FT_VALIDATE_OT ::\r
+  *      Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).\r
+  *\r
+  */\r
+#define FT_VALIDATE_BASE  0x0100\r
+#define FT_VALIDATE_GDEF  0x0200\r
+#define FT_VALIDATE_GPOS  0x0400\r
+#define FT_VALIDATE_GSUB  0x0800\r
+#define FT_VALIDATE_JSTF  0x1000\r
+\r
+#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \\r
+                        FT_VALIDATE_GDEF | \\r
+                        FT_VALIDATE_GPOS | \\r
+                        FT_VALIDATE_GSUB | \\r
+                        FT_VALIDATE_JSTF\r
+\r
+  /* */\r
+\r
+ /**********************************************************************\r
+  *\r
+  * @function:\r
+  *    FT_OpenType_Validate\r
+  *\r
+  * @description:\r
+  *    Validate various OpenType tables to assure that all offsets and\r
+  *    indices are valid.  The idea is that a higher-level library which\r
+  *    actually does the text layout can access those tables without\r
+  *    error checking (which can be quite time consuming).\r
+  *\r
+  * @input:\r
+  *    face ::\r
+  *       A handle to the input face.\r
+  *\r
+  *    validation_flags ::\r
+  *       A bit field which specifies the tables to be validated.  See\r
+  *       @FT_VALIDATE_XXX for possible values.\r
+  *\r
+  * @output:\r
+  *    BASE_table ::\r
+  *       A pointer to the BASE table.\r
+  *\r
+  *    GDEF_table ::\r
+  *       A pointer to the GDEF table.\r
+  *\r
+  *    GPOS_table ::\r
+  *       A pointer to the GPOS table.\r
+  *\r
+  *    GSUB_table ::\r
+  *       A pointer to the GSUB table.\r
+  *\r
+  *    JSTF_table ::\r
+  *       A pointer to the JSTF table.\r
+  *\r
+  * @return:\r
+  *   FreeType error code.  0 means success.\r
+  *\r
+  * @note:\r
+  *   This function only works with OpenType fonts, returning an error\r
+  *   otherwise.\r
+  *\r
+  *   After use, the application should deallocate the five tables with\r
+  *   `free'.  A NULL value indicates that the table either doesn't exist\r
+  *   in the font, or the application hasn't asked for validation.\r
+  */\r
+  FT_EXPORT( FT_Error )\r
+  FT_OpenType_Validate( FT_Face    face,\r
+                        FT_UInt    validation_flags,\r
+                        FT_Bytes  *BASE_table, \r
+                        FT_Bytes  *GDEF_table, \r
+                        FT_Bytes  *GPOS_table, \r
+                        FT_Bytes  *GSUB_table, \r
+                        FT_Bytes  *JSTF_table );\r
+\r
+ /* */\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __FTOTVAL_H__ */\r
+\r
+\r
+/* END */\r
index 79ed35b..76ad60a 100644 (file)
@@ -5,7 +5,7 @@
 /*    Support for the FT_Outline type used to store glyph shapes of        */
 /*    most scalable font formats (specification).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -58,6 +58,7 @@ FT_BEGIN_HEADER
   /*    FT_Outline_Copy                                                    */
   /*    FT_Outline_Translate                                               */
   /*    FT_Outline_Transform                                               */
+  /*    FT_Outline_Embolden                                                */
   /*    FT_Outline_Reverse                                                 */
   /*    FT_Outline_Check                                                   */
   /*                                                                       */
@@ -229,8 +230,8 @@ FT_BEGIN_HEADER
   /*    acbox   :: The outline's control box.                              */
   /*                                                                       */
   FT_EXPORT( void )
-  FT_Outline_Get_CBox( FT_Outline*  outline,
-                       FT_BBox     *acbox );
+  FT_Outline_Get_CBox( const FT_Outline*  outline,
+                       FT_BBox           *acbox );
 
 
   /*************************************************************************/
@@ -250,9 +251,9 @@ FT_BEGIN_HEADER
   /*    yOffset :: The vertical offset.                                    */
   /*                                                                       */
   FT_EXPORT( void )
-  FT_Outline_Translate( FT_Outline*  outline,
-                        FT_Pos       xOffset,
-                        FT_Pos       yOffset );
+  FT_Outline_Translate( const FT_Outline*  outline,
+                        FT_Pos             xOffset,
+                        FT_Pos             yOffset );
 
 
   /*************************************************************************/
@@ -275,8 +276,8 @@ FT_BEGIN_HEADER
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_EXPORT( FT_Error )
-  FT_Outline_Copy( FT_Outline*  source,
-                   FT_Outline  *target );
+  FT_Outline_Copy( const FT_Outline*  source,
+                   FT_Outline        *target );
 
 
   /*************************************************************************/
@@ -299,8 +300,33 @@ FT_BEGIN_HEADER
   /*    outline's points.                                                  */
   /*                                                                       */
   FT_EXPORT( void )
-  FT_Outline_Transform( FT_Outline*  outline,
-                        FT_Matrix*   matrix );
+  FT_Outline_Transform( const FT_Outline*  outline,
+                        const FT_Matrix*   matrix );
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Outline_Embolden                                                */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Emboldens an outline.  The new outline will be at most 4 times     */
+  /*    `strength' pixels wider and higher.  You may think of the left and */
+  /*    bottom borders as unchanged.                                       */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    outline  :: A handle to the target outline.                        */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    strength :: How strong the glyph is emboldened.  Expressed in      */
+  /*                26.6 pixel format.                                     */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_EXPORT_DEF( FT_Error )
+  FT_Outline_Embolden( FT_Outline*  outline,
+                       FT_Pos       strength );
 
 
   /*************************************************************************/
@@ -353,9 +379,9 @@ FT_BEGIN_HEADER
   /*    It will use the raster correponding to the default glyph format.   */
   /*                                                                       */
   FT_EXPORT( FT_Error )
-  FT_Outline_Get_Bitmap( FT_Library   library,
-                         FT_Outline*  outline,
-                         FT_Bitmap   *abitmap );
+  FT_Outline_Get_Bitmap( FT_Library        library,
+                         FT_Outline*       outline,
+                         const FT_Bitmap  *abitmap );
 
 
   /*************************************************************************/
index c9a5675..2481659 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing PFR-specific data (specification only).   */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -41,7 +41,7 @@ FT_BEGIN_HEADER
   /*    PFR Fonts                                                          */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    PFR/TrueDoc specific APIs                                          */
+  /*    PFR/TrueDoc specific API.                                          */
   /*                                                                       */
   /* <Description>                                                         */
   /*    This section contains the declaration of PFR-specific functions.   */
@@ -166,7 +166,7 @@ FT_BEGIN_HEADER
 
 FT_END_HEADER
 
-#endif /* __FTBDF_H__ */
+#endif /* __FTPFR_H__ */
 
 
 /* END */
index db3ca94..21b051f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType renderer modules public interface (specification).          */
 /*                                                                         */
-/*  Copyright 1996-2001 by                                                 */
+/*  Copyright 1996-2001, 2005 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
index f0ec915..9abd94b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType size objects management (specification).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003 by                                           */
+/*  Copyright 1996-2001, 2003, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -48,10 +48,10 @@ FT_BEGIN_HEADER
   /*    sizes_management                                                   */
   /*                                                                       */
   /* <Title>                                                               */
-  /*    Size management                                                    */
+  /*    Size Management                                                    */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    Managing multiple sizes per face                                   */
+  /*    Managing multiple sizes per face.                                  */
   /*                                                                       */
   /* <Description>                                                         */
   /*    When creating a new face object (e.g. with @FT_New_Face), an       */
index a3052e8..c6c96de 100644 (file)
 #include FT_OUTLINE_H
 #include FT_GLYPH_H
 
+
 FT_BEGIN_HEADER
 
- /*@*************************************************************
+
+ /************************************************************************
+  *
+  * <Section>
+  *    glyph_stroker
+  *
+  * <Title>
+  *    Glyph Stroker
+  *
+  * <Abstract>
+  *    Generating bordered and stroked glyphs.
+  *
+  * <Description>
+  *    This component generates stroked outlines of a given vectorial
+  *    glyph.  It also allows you to retrieve the `outside' and/or the
+  *    `inside' borders of the stroke.
+  *
+  *    This can be useful to generate `bordered' glyph, i.e., glyphs
+  *    displayed with a coloured (and anti-aliased) border around their
+  *    shape.
+  */
+
+
+ /**************************************************************
   *
   * @type:
   *   FT_Stroker
@@ -36,7 +60,7 @@ FT_BEGIN_HEADER
   typedef struct FT_StrokerRec_*  FT_Stroker;
 
 
-  /*@*************************************************************
+  /**************************************************************
    *
    * @enum:
    *   FT_Stroker_LineJoin
@@ -69,7 +93,7 @@ FT_BEGIN_HEADER
   } FT_Stroker_LineJoin;
 
 
-  /*@*************************************************************
+  /**************************************************************
    *
    * @enum:
    *   FT_Stroker_LineCap
index 2782f74..7727ebb 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType simple types definitions (specification only).              */
 /*                                                                         */
-/*  Copyright 1996-2001 by                                                 */
+/*  Copyright 1996-2001, 2002, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -49,6 +49,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Order>                                                               */
   /*    FT_Byte                                                            */
+  /*    FT_Bytes                                                           */
   /*    FT_Char                                                            */
   /*    FT_Int                                                             */
   /*    FT_UInt                                                            */
@@ -60,6 +61,7 @@ FT_BEGIN_HEADER
   /*    FT_Offset                                                          */
   /*    FT_PtrDist                                                         */
   /*    FT_String                                                          */
+  /*    FT_Tag                                                             */
   /*    FT_Error                                                           */
   /*    FT_Fixed                                                           */
   /*    FT_Pointer                                                         */
@@ -143,6 +145,28 @@ FT_BEGIN_HEADER
   typedef unsigned char  FT_Byte;
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_Bytes                                                           */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A typedef for constant memory areas.                               */
+  /*                                                                       */
+  typedef const FT_Byte*  FT_Bytes;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_Tag                                                             */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A typedef for 32bit tags (as used in the SFNT format).             */
+  /*                                                                       */
+  typedef FT_UInt32  FT_Tag;
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Type>                                                                */
@@ -184,7 +208,7 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    A typedef for the int type.                                        */
   /*                                                                       */
-  typedef int  FT_Int;
+  typedef signed int  FT_Int;
 
 
   /*************************************************************************/
@@ -301,7 +325,7 @@ FT_BEGIN_HEADER
   /*    largest _signed_ integer type used to express the distance         */
   /*    between two pointers.                                              */
   /*                                                                       */
-  typedef size_t  FT_PtrDist;
+  typedef ft_ptrdiff_t  FT_PtrDist;
 
 
   /*************************************************************************/
index a19a12d..355b7e9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing Windows fnt-specific data.                */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -38,10 +38,10 @@ FT_BEGIN_HEADER
   /*    winfnt_fonts                                                       */
   /*                                                                       */
   /* <Title>                                                               */
-  /*    Window FNT Fonts                                                   */
+  /*    Window FNT Files                                                   */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    Windows FNT specific APIs                                          */
+  /*    Windows FNT specific API.                                          */
   /*                                                                       */
   /* <Description>                                                         */
   /*    This section contains the declaration of Windows FNT specific      */
index 7866c46..0df502c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Arithmetic computations (specification).                             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  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,       */
 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_EXPORT( FT_Int32 )
   FT_SqrtFixed( FT_Int32  x );
 
index ea9870f..d93a077 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType memory management macros (specification).               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004 by                                     */
+/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -43,6 +43,7 @@ FT_BEGIN_HEADER
           ( ( error = (expression) ) != 0 )
 
 
+
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -124,6 +125,28 @@ FT_BEGIN_HEADER
             void*     *P );
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_QAlloc                                                          */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Allocates a new block of memory.  The returned area is *not*       */
+  /*    zero-filled, making allocation quicker.                            */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    memory :: A handle to a given `memory object' which handles        */
+  /*              allocation.                                              */
+  /*                                                                       */
+  /*    size   :: The size in bytes of the block to allocate.              */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    P      :: A pointer to the fresh new block.  It should be set to   */
+  /*              NULL if `size' is 0, or in case of error.                */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
   FT_BASE( FT_Error )
   FT_QAlloc( FT_Memory  memory,
              FT_Long    size,
@@ -137,7 +160,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Reallocates a block of memory pointed to by `*P' to `Size' bytes   */
-  /*    from the heap, possibly changing `*P'.                             */
+  /*    from the heap, possibly changing `*P'.  The returned area is       */
+  /*    zero-filled.                                                       */
   /*                                                                       */
   /* <Input>                                                               */
   /*    memory  :: A handle to a given `memory object' which handles       */
@@ -165,6 +189,35 @@ FT_BEGIN_HEADER
               void*     *P );
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_QRealloc                                                        */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Reallocates a block of memory pointed to by `*P' to `Size' bytes   */
+  /*    from the heap, possibly changing `*P'.  The returned area is *not* */
+  /*    zero-filled, making reallocation quicker.                          */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    memory  :: A handle to a given `memory object' which handles       */
+  /*               reallocation.                                           */
+  /*                                                                       */
+  /*    current :: The current block size in bytes.                        */
+  /*                                                                       */
+  /*    size    :: The new block size in bytes.                            */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    P       :: A pointer to the fresh new block.  It should be set to  */
+  /*               NULL if `size' is 0, or in case of error.               */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    All callers of FT_Realloc() _must_ provide the current block size  */
+  /*    as well as the new one.                                            */
+  /*                                                                       */
   FT_BASE( FT_Error )
   FT_QRealloc( FT_Memory  memory,
                FT_Long    current,
@@ -208,11 +261,24 @@ FT_BEGIN_HEADER
 
 #define FT_ZERO( p )                FT_MEM_ZERO( p, sizeof ( *(p) ) )
 
-#define FT_ARRAY_COPY( dest, source, count )                       \
-          FT_MEM_COPY( dest, source, (count) * sizeof( *(dest) ) )
+#define FT_ARRAY_ZERO( dest, count )                        \
+          FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )
+
+#define FT_ARRAY_COPY( dest, source, count )                        \
+          FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )
+
+#define FT_ARRAY_MOVE( dest, source, count )                        \
+          FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )
 
-#define FT_ARRAY_MOVE( dest, source, count )                       \
-          FT_MEM_MOVE( dest, source, (count) * sizeof( *(dest) ) )
+
+  /*
+   *  Return the maximum number of adressable elements in an array.
+   *  We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid
+   *  any problems.
+   */
+#define FT_ARRAY_MAX( ptr )           ( FT_INT_MAX / sizeof ( *(ptr) ) )
+
+#define FT_ARRAY_CHECK( ptr, count )  ( (count) <= FT_ARRAY_MAX( ptr ) )
 
 
   /*************************************************************************/
@@ -224,43 +290,53 @@ FT_BEGIN_HEADER
 
 #ifdef FT_DEBUG_MEMORY
 
-#define FT_MEM_ALLOC( _pointer_, _size_ )                            \
-          FT_Alloc_Debug( memory, _size_,                            \
-                          (void**)&(_pointer_), __FILE__, __LINE__ )
+#define FT_MEM_ALLOC( _pointer_, _size_ )              \
+          FT_Alloc_Debug( memory, _size_,              \
+                          (void**)(void*)&(_pointer_), \
+                          __FILE__, __LINE__ )
 
-#define FT_MEM_REALLOC( _pointer_, _current_, _size_ )                 \
-          FT_Realloc_Debug( memory, _current_, _size_,                 \
-                            (void**)&(_pointer_), __FILE__, __LINE__ )
+#define FT_MEM_REALLOC( _pointer_, _current_, _size_ )   \
+          FT_Realloc_Debug( memory, _current_, _size_,   \
+                            (void**)(void*)&(_pointer_), \
+                            __FILE__, __LINE__ )
 
-#define FT_MEM_QALLOC( _pointer_, _size_ )                            \
-          FT_QAlloc_Debug( memory, _size_,                            \
-                           (void**)&(_pointer_), __FILE__, __LINE__ )
+#define FT_MEM_QALLOC( _pointer_, _size_ )              \
+          FT_QAlloc_Debug( memory, _size_,              \
+                           (void**)(void*)&(_pointer_), \
+                           __FILE__, __LINE__ )
 
-#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ )                 \
-          FT_QRealloc_Debug( memory, _current_, _size_,                 \
-                             (void**)&(_pointer_), __FILE__, __LINE__ )
+#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ )   \
+          FT_QRealloc_Debug( memory, _current_, _size_,   \
+                             (void**)(void*)&(_pointer_), \
+                             __FILE__, __LINE__ )
 
-#define FT_MEM_FREE( _pointer_ )                                            \
-          FT_Free_Debug( memory, (void**)&(_pointer_), __FILE__, __LINE__ )
+#define FT_MEM_FREE( _pointer_ )                              \
+          FT_Free_Debug( memory, (void**)(void*)&(_pointer_), \
+                         __FILE__, __LINE__ )
 
 
 #else  /* !FT_DEBUG_MEMORY */
 
 
-#define FT_MEM_ALLOC( _pointer_, _size_ )                  \
-          FT_Alloc( memory, _size_, (void**)&(_pointer_) )
+#define FT_MEM_ALLOC( _pointer_, _size_ )         \
+          FT_Alloc( memory, _size_,               \
+                    (void**)(void*)&(_pointer_) )
 
-#define FT_MEM_FREE( _pointer_ )                  \
-          FT_Free( memory, (void**)&(_pointer_) )
+#define FT_MEM_FREE( _pointer_ )                 \
+          FT_Free( memory,                       \
+                   (void**)(void*)&(_pointer_) )
 
-#define FT_MEM_REALLOC( _pointer_, _current_, _size_ )                  \
-          FT_Realloc( memory, _current_, _size_, (void**)&(_pointer_) )
+#define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \
+          FT_Realloc( memory, _current_, _size_,       \
+                      (void**)(void*)&(_pointer_) )
 
-#define FT_MEM_QALLOC( _pointer_, _size_ )                  \
-          FT_QAlloc( memory, _size_, (void**)&(_pointer_) )
+#define FT_MEM_QALLOC( _pointer_, _size_ )         \
+          FT_QAlloc( memory, _size_,               \
+                     (void**)(void*)&(_pointer_) )
 
-#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ )                  \
-          FT_QRealloc( memory, _current_, _size_, (void**)&(_pointer_) )
+#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \
+          FT_QRealloc( memory, _current_, _size_,       \
+          (void**)(void*)&(_pointer_) )
 
 #endif /* !FT_DEBUG_MEMORY */
 
@@ -271,7 +347,7 @@ FT_BEGIN_HEADER
   /* _typed_ in order to automatically compute array element sizes.        */
   /*                                                                       */
 
-#define FT_MEM_NEW( _pointer_ )                               \
+#define FT_MEM_NEW( _pointer_ )                              \
           FT_MEM_ALLOC( _pointer_, sizeof ( *(_pointer_) ) )
 
 #define FT_MEM_NEW_ARRAY( _pointer_, _count_ )                           \
@@ -281,7 +357,7 @@ FT_BEGIN_HEADER
           FT_MEM_REALLOC( _pointer_, (_old_) * sizeof ( *(_pointer_) ),  \
                                      (_new_) * sizeof ( *(_pointer_) ) )
 
-#define FT_MEM_QNEW( _pointer_ )                               \
+#define FT_MEM_QNEW( _pointer_ )                              \
           FT_MEM_QALLOC( _pointer_, sizeof ( *(_pointer_) ) )
 
 #define FT_MEM_QNEW_ARRAY( _pointer_, _count_ )                           \
@@ -318,9 +394,6 @@ FT_BEGIN_HEADER
 #define FT_REALLOC( _pointer_, _current_, _size_ )                       \
           FT_SET_ERROR( FT_MEM_REALLOC( _pointer_, _current_, _size_ ) )
 
-#define FT_FREE( _pointer_ )       \
-          FT_MEM_FREE( _pointer_ )
-
 #define FT_QALLOC( _pointer_, _size_ )                       \
           FT_SET_ERROR( FT_MEM_QALLOC( _pointer_, _size_ ) )
 
@@ -328,33 +401,38 @@ FT_BEGIN_HEADER
           FT_SET_ERROR( FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) )
 
 
-#define FT_NEW( _pointer_ )  \
-          FT_SET_ERROR( FT_MEM_NEW( _pointer_ ) )
+#define FT_FREE( _pointer_ )       \
+          FT_MEM_FREE( _pointer_ )
+
+
+#define FT_NEW( _pointer_ )                              \
+          FT_ALLOC( _pointer_, sizeof ( *(_pointer_) ) )
+
+#define FT_NEW_ARRAY( _pointer_, _count_ )                           \
+          FT_ALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_count_) )
 
-#define FT_NEW_ARRAY( _pointer_, _count_ )  \
-          FT_SET_ERROR( FT_MEM_NEW_ARRAY( _pointer_, _count_ ) )
+#define FT_RENEW_ARRAY( _pointer_, _old_, _new_ )                    \
+          FT_REALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_old_),  \
+                                 sizeof ( *(_pointer_) ) * (_new_) )
 
-#define FT_RENEW_ARRAY( _pointer_, _old_, _new_ )   \
-          FT_SET_ERROR( FT_MEM_RENEW_ARRAY( _pointer_, _old_, _new_ ) )
+#define FT_QNEW( _pointer_ )                              \
+          FT_QALLOC( _pointer_, sizeof ( *(_pointer_) ) )
 
-#define FT_QNEW( _pointer_ )  \
-          FT_SET_ERROR( FT_MEM_QNEW( _pointer_ ) )
+#define FT_QNEW_ARRAY( _pointer_, _count_ )                           \
+          FT_QALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_count_) )
 
-#define FT_QNEW_ARRAY( _pointer_, _count_ )  \
-          FT_SET_ERROR( FT_MEM_QNEW_ARRAY( _pointer_, _count_ ) )
+#define FT_QRENEW_ARRAY( _pointer_, _old_, _new_ )                    \
+          FT_QREALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_old_),  \
+                                  sizeof ( *(_pointer_) ) * (_new_) )
 
-#define FT_QRENEW_ARRAY( _pointer_, _old_, _new_ )   \
-          FT_SET_ERROR( FT_MEM_QRENEW_ARRAY( _pointer_, _old_, _new_ ) )
 
+#define FT_ALLOC_ARRAY( _pointer_, _count_, _type_ )           \
+          FT_ALLOC( _pointer_, (_count_) * sizeof ( _type_ ) )
 
-#define FT_ALLOC_ARRAY( _pointer_, _count_, _type_ )                    \
-          FT_SET_ERROR( FT_MEM_ALLOC( _pointer_,                        \
-                                      (_count_) * sizeof ( _type_ ) ) )
+#define FT_REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ )   \
+          FT_REALLOC( _pointer, (_old_) * sizeof ( _type_ ),  \
+                                (_new_) * sizeof ( _type_ ) )
 
-#define FT_REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ )             \
-          FT_SET_ERROR( FT_MEM_REALLOC( _pointer_,                      \
-                                        (_old_) * sizeof ( _type_ ),    \
-                                        (_new_) * sizeof ( _type_ ) ) )
 
  /* */
 
index 3a28119..e8e3ee7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType private base classes (specification).                   */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,7 +27,6 @@
 #define __FTOBJS_H__
 
 #include <ft2build.h>
-#include FT_CONFIG_STANDARD_LIBRARY_H   /* for ft_setjmp and ft_longjmp */
 #include FT_RENDER_H
 #include FT_SIZES_H
 #include FT_INTERNAL_MEMORY_H
@@ -81,109 +80,12 @@ FT_BEGIN_HEADER
 #define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )
 
 
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /****                    V A L I D A T I O N                          ****/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  /* handle to a validation object */
-  typedef struct FT_ValidatorRec_*  FT_Validator;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* There are three distinct validation levels defined here:              */
-  /*                                                                       */
-  /* FT_VALIDATE_DEFAULT ::                                                */
-  /*   A table that passes this validation level can be used reliably by   */
-  /*   FreeType.  It generally means that all offsets have been checked to */
-  /*   prevent out-of-bound reads, array counts are correct, etc.          */
-  /*                                                                       */
-  /* FT_VALIDATE_TIGHT ::                                                  */
-  /*   A table that passes this validation level can be used reliably and  */
-  /*   doesn't contain invalid data.  For example, a charmap table that    */
-  /*   returns invalid glyph indices will not pass, even though it can     */
-  /*   be used with FreeType in default mode (the library will simply      */
-  /*   return an error later when trying to load the glyph).               */
-  /*                                                                       */
-  /*   It also check that fields that must be a multiple of 2, 4, or 8     */
-  /*   don't have incorrect values, etc.                                   */
-  /*                                                                       */
-  /* FT_VALIDATE_PARANOID ::                                               */
-  /*   Only for font debugging.  Checks that a table follows the           */
-  /*   specification by 100%.  Very few fonts will be able to pass this    */
-  /*   level anyway but it can be useful for certain tools like font       */
-  /*   editors/converters.                                                 */
-  /*                                                                       */
-  typedef enum  FT_ValidationLevel_
-  {
-    FT_VALIDATE_DEFAULT = 0,
-    FT_VALIDATE_TIGHT,
-    FT_VALIDATE_PARANOID
-
-  } FT_ValidationLevel;
-
-
-  /* validator structure */
-  typedef struct  FT_ValidatorRec_
-  {
-    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;
-
-
-#define FT_VALIDATOR( x )  ((FT_Validator)( x ))
-
-
-  FT_BASE( void )
-  ft_validator_init( FT_Validator        valid,
-                     const FT_Byte*      base,
-                     const FT_Byte*      limit,
-                     FT_ValidationLevel  level );
-
-  FT_BASE( FT_Int )
-  ft_validator_run( FT_Validator  valid );
-
-  /* Sets the error field in a validator, then calls `longjmp' to return */
-  /* to high-level caller.  Using `setjmp/longjmp' avoids many stupid    */
-  /* error checks within the validation routines.                        */
-  /*                                                                     */
-  FT_BASE( void )
-  ft_validator_error( FT_Validator  valid,
-                      FT_Error      error );
-
-
-  /* Calls ft_validate_error.  Assumes that the `valid' local variable */
-  /* holds a pointer to the current validator object.                  */
-  /*                                                                   */
-#define FT_INVALID( _error )  ft_validator_error( valid, _error )
-
-  /* called when a broken table is detected */
-#define FT_INVALID_TOO_SHORT  FT_INVALID( FT_Err_Invalid_Table )
-
-  /* called when an invalid offset is detected */
-#define FT_INVALID_OFFSET     FT_INVALID( FT_Err_Invalid_Offset )
-
-  /* called when an invalid format/value is detected */
-#define FT_INVALID_FORMAT     FT_INVALID( FT_Err_Invalid_Table )
-
-  /* called when an invalid glyph index is detected */
-#define FT_INVALID_GLYPH_ID   FT_INVALID( FT_Err_Invalid_Glyph_Index )
-
-  /* called when an invalid field value is detected */
-#define FT_INVALID_DATA       FT_INVALID( FT_Err_Invalid_Table )
+  /*
+   *  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 );
 
 
   /*************************************************************************/
@@ -257,7 +159,7 @@ FT_BEGIN_HEADER
                FT_CharMap     charmap,
                FT_CMap       *acmap );
 
-  /* destroy a charmap (don't remove it from face's list though) */
+  /* destroy a charmap and remove it from face's list */
   FT_BASE( void )
   FT_CMap_Done( FT_CMap  cmap );
 
index e5ed889..0850f56 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType services (specification only).                          */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2004, 2005 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:
@@ -57,18 +64,33 @@ FT_BEGIN_HEADER
    *     A variable that receives the service pointer.  Will be NULL
    *     if not found.
    */
+#ifdef __cplusplus
+
 #define FT_FACE_FIND_SERVICE( face, ptr, id )                               \
   FT_BEGIN_STMNT                                                            \
-    FT_Module    module = FT_MODULE( FT_FACE(face)->driver );               \
-    /* the strange cast is to allow C++ compilation */                      \
-    FT_Pointer*  Pptr   = (FT_Pointer*) &(ptr);                             \
+    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );             \
+    FT_Pointer   _tmp_  = NULL;                                             \
+    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                              \
                                                                             \
                                                                             \
-    *Pptr = NULL;                                                           \
     if ( module->clazz->get_interface )                                     \
-      *Pptr = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
+      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
+    *_pptr_ = _tmp_;                                                        \
   FT_END_STMNT
 
+#else /* !C++ */
+
+#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \
+  FT_BEGIN_STMNT                                                            \
+    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );              \
+    FT_Pointer  _tmp_  = NULL;                                              \
+                                                                            \
+    if ( module->clazz->get_interface )                                     \
+      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
+    ptr = _tmp_;                                                            \
+  FT_END_STMNT
+
+#endif /* !C++ */
 
   /*
    * @macro:
@@ -92,16 +114,33 @@ FT_BEGIN_HEADER
    *     A variable that receives the service pointer.  Will be NULL
    *     if not found.
    */
+#ifdef __cplusplus
+
 #define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \
   FT_BEGIN_STMNT                                                   \
-    FT_Module    module = FT_MODULE( FT_FACE(face)->driver );      \
-    /* the strange cast is to allow C++ compilation */             \
-    FT_Pointer*  Pptr   = (FT_Pointer*) &(ptr);                    \
+    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );    \
+    FT_Pointer   _tmp_;                                            \
+    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                     \
                                                                    \
                                                                    \
-    *Pptr = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
+    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
+    *_pptr_ = _tmp_;                                               \
   FT_END_STMNT
 
+#else /* !C++ */
+
+#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \
+  FT_BEGIN_STMNT                                                   \
+    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );     \
+    FT_Pointer  _tmp_;                                             \
+                                                                   \
+                                                                   \
+    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
+    ptr   = _tmp_;                                                 \
+  FT_END_STMNT
+
+#endif /* !C++ */
+
 
   /*************************************************************************/
   /*************************************************************************/
@@ -199,27 +238,50 @@ FT_BEGIN_HEADER
    *   ptr ::
    *     A variable receiving the service data.  NULL if not available.
    */
-#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                  \
-  FT_BEGIN_STMNT                                                 \
-    /* the strange cast is to allow C++ compilation */           \
-    FT_Pointer*  pptr = (FT_Pointer*)&(ptr);                     \
-    FT_Pointer   svc;                                            \
-                                                                 \
-                                                                 \
-    svc = FT_FACE(face)->internal->services. service_ ## id ;    \
-    if ( svc == FT_SERVICE_UNAVAILABLE )                         \
-      svc = NULL;                                                \
-    else if ( svc == NULL )                                      \
-    {                                                            \
-      FT_FACE_FIND_SERVICE( face, svc, id );                     \
-                                                                 \
-      FT_FACE(face)->internal->services. service_ ## id =        \
-        (FT_Pointer)( svc != NULL ? svc                          \
-                                  : FT_SERVICE_UNAVAILABLE );    \
-    }                                                            \
-    *pptr = svc;                                                 \
+#ifdef __cplusplus
+
+#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \
+  FT_BEGIN_STMNT                                               \
+    FT_Pointer   svc;                                          \
+    FT_Pointer*  Pptr = (FT_Pointer*)&(ptr);                   \
+                                                               \
+                                                               \
+    svc = FT_FACE( face )->internal->services. service_ ## id; \
+    if ( svc == FT_SERVICE_UNAVAILABLE )                       \
+      svc = NULL;                                              \
+    else if ( svc == NULL )                                    \
+    {                                                          \
+      FT_FACE_FIND_SERVICE( face, svc, id );                   \
+                                                               \
+      FT_FACE( face )->internal->services. service_ ## id =    \
+        (FT_Pointer)( svc != NULL ? svc                        \
+                                  : FT_SERVICE_UNAVAILABLE );  \
+    }                                                          \
+    *Pptr = svc;                                               \
+  FT_END_STMNT
+
+#else /* !C++ */
+
+#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \
+  FT_BEGIN_STMNT                                               \
+    FT_Pointer  svc;                                           \
+                                                               \
+                                                               \
+    svc = FT_FACE( face )->internal->services. service_ ## id; \
+    if ( svc == FT_SERVICE_UNAVAILABLE )                       \
+      svc = NULL;                                              \
+    else if ( svc == NULL )                                    \
+    {                                                          \
+      FT_FACE_FIND_SERVICE( face, svc, id );                   \
+                                                               \
+      FT_FACE( face )->internal->services. service_ ## id =    \
+        (FT_Pointer)( svc != NULL ? svc                        \
+                                  : FT_SERVICE_UNAVAILABLE );  \
+    }                                                          \
+    ptr = svc;                                                 \
   FT_END_STMNT
 
+#endif /* !C++ */
 
   /*
    *  A macro used to define new service structure types.
@@ -238,17 +300,18 @@ FT_BEGIN_HEADER
    *  The header files containing the services.
    */
 
-#define FT_SERVICE_MULTIPLE_MASTERS_H  <freetype/internal/services/svmm.h>
-#define FT_SERVICE_POSTSCRIPT_NAME_H   <freetype/internal/services/svpostnm.h>
-#define FT_SERVICE_POSTSCRIPT_CMAPS_H  <freetype/internal/services/svpscmap.h>
-#define FT_SERVICE_POSTSCRIPT_INFO_H   <freetype/internal/services/svpsinfo.h>
-#define FT_SERVICE_GLYPH_DICT_H        <freetype/internal/services/svgldict.h>
-#define FT_SERVICE_BDF_H               <freetype/internal/services/svbdf.h>
-#define FT_SERVICE_XFREE86_NAME_H      <freetype/internal/services/svxf86nm.h>
-#define FT_SERVICE_SFNT_H              <freetype/internal/services/svsfnt.h>
-#define FT_SERVICE_PFR_H               <freetype/internal/services/svpfr.h>
-#define FT_SERVICE_WINFNT_H            <freetype/internal/services/svwinfnt.h>
-#define FT_SERVICE_TT_CMAP_H           <freetype/internal/services/svttcmap.h>
+#define FT_SERVICE_BDF_H                <freetype/internal/services/svbdf.h>
+#define FT_SERVICE_GLYPH_DICT_H         <freetype/internal/services/svgldict.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_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>
 
  /* */
 
index 9833cd0..1fa9db4 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Stream handling (specification).                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004 by                                     */
+/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -343,7 +343,7 @@ FT_BEGIN_HEADER
 
   /* free a stream */
   FT_BASE( void )
-  FT_Stream_Free( FT_Stream  stream,                    
+  FT_Stream_Free( FT_Stream  stream,
                   FT_Int     external );
 
   /* initialize a stream for reading in-memory data */
@@ -385,6 +385,13 @@ FT_BEGIN_HEADER
                     FT_Byte*   buffer,
                     FT_ULong   count );
 
+  /* try to read bytes at the end of a stream; return number of bytes */
+  /* really available                                                 */
+  FT_BASE( FT_ULong )
+  FT_Stream_TryRead( FT_Stream  stream,
+                     FT_Byte*   buffer,
+                     FT_ULong   count );
+
   /* Enter a frame of `count' consecutive bytes in a stream.  Returns an */
   /* error if the frame could not be read/accessed.  The caller can use  */
   /* the FT_Stream_Get_XXX functions to retrieve frame data without      */
index a9a15a2..1267e16 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Tracing handling (specification only).                               */
 /*                                                                         */
-/*  Copyright 2002, 2004 by                                                */
+/*  Copyright 2002, 2004, 2005 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -37,17 +37,18 @@ 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)  */
 
-/* Cache sub-system */
+  /* Cache sub-system */
 FT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */
 
-/* SFNT driver components */
+  /* SFNT driver components */
 FT_TRACE_DEF( sfobjs )    /* SFNT object handler     (sfobjs.c)   */
 FT_TRACE_DEF( ttcmap )    /* charmap handler         (ttcmap.c)   */
+FT_TRACE_DEF( ttkern )    /* kerning handler         (ttkern.c)   */
 FT_TRACE_DEF( ttload )    /* basic TrueType tables   (ttload.c)   */
 FT_TRACE_DEF( ttpost )    /* PS table processing     (ttpost.c)   */
 FT_TRACE_DEF( ttsbit )    /* TrueType sbit handling  (ttsbit.c)   */
 
-/* TrueType driver components */
+  /* TrueType driver components */
 FT_TRACE_DEF( ttdriver )  /* TT font driver          (ttdriver.c) */
 FT_TRACE_DEF( ttgload )   /* TT glyph loader         (ttgload.c)  */
 FT_TRACE_DEF( ttinterp )  /* bytecode interpreter    (ttinterp.c) */
@@ -55,7 +56,7 @@ FT_TRACE_DEF( ttobjs )    /* TT objects manager      (ttobjs.c)   */
 FT_TRACE_DEF( ttpload )   /* TT data/program loader  (ttpload.c)  */
 FT_TRACE_DEF( ttgxvar )   /* TrueType GX var handler (ttgxvar.c)  */
 
-/* Type 1 driver components */
+  /* Type 1 driver components */
 FT_TRACE_DEF( t1driver )
 FT_TRACE_DEF( t1gload )
 FT_TRACE_DEF( t1hint )
@@ -63,26 +64,26 @@ FT_TRACE_DEF( t1load )
 FT_TRACE_DEF( t1objs )
 FT_TRACE_DEF( t1parse )
 
-/* PostScript helper module `psaux' */
+  /* PostScript helper module `psaux' */
 FT_TRACE_DEF( t1decode )
 FT_TRACE_DEF( psobjs )
 
-/* PostScript hinting module `pshinter' */
+  /* PostScript hinting module `pshinter' */
 FT_TRACE_DEF( pshrec )
 FT_TRACE_DEF( pshalgo1 )
 FT_TRACE_DEF( pshalgo2 )
 
-/* Type 2 driver components */
+  /* Type 2 driver components */
 FT_TRACE_DEF( cffdriver )
 FT_TRACE_DEF( cffgload )
 FT_TRACE_DEF( cffload )
 FT_TRACE_DEF( cffobjs )
 FT_TRACE_DEF( cffparse )
 
-/* Type 42 driver component */
+  /* Type 42 driver component */
 FT_TRACE_DEF( t42 )
 
-/* CID driver components */
+  /* CID driver components */
 FT_TRACE_DEF( cidafm )
 FT_TRACE_DEF( ciddriver )
 FT_TRACE_DEF( cidgload )
@@ -90,19 +91,28 @@ FT_TRACE_DEF( cidload )
 FT_TRACE_DEF( cidobjs )
 FT_TRACE_DEF( cidparse )
 
-/* Windows fonts component */
+  /* Windows font component */
 FT_TRACE_DEF( winfnt )
 
-/* PCF fonts components */
+  /* PCF font components */
 FT_TRACE_DEF( pcfdriver )
 FT_TRACE_DEF( pcfread )
 
-/* BDF fonts component */
+  /* BDF font components */
 FT_TRACE_DEF( bdfdriver )
 FT_TRACE_DEF( bdflib )
 
-/* PFR fonts component */
+  /* PFR font component */
 FT_TRACE_DEF( pfr )
 
+  /* OpenType validation components */
+FT_TRACE_DEF( otvmodule )
+FT_TRACE_DEF( otvcommon )
+FT_TRACE_DEF( otvbase )
+FT_TRACE_DEF( otvgdef )
+FT_TRACE_DEF( otvgpos )
+FT_TRACE_DEF( otvgsub )
+FT_TRACE_DEF( otvjstf )
+
 
 /* END */
diff --git a/reactos/lib/freetype/include/freetype/internal/ftvalid.h b/reactos/lib/freetype/include/freetype/internal/ftvalid.h
new file mode 100644 (file)
index 0000000..3f31849
--- /dev/null
@@ -0,0 +1,148 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ftvalid.h                                                              */\r
+/*                                                                         */\r
+/*    FreeType validation support (specification).                         */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __FTVALID_H__\r
+#define __FTVALID_H__\r
+\r
+#include <ft2build.h>\r
+#include FT_CONFIG_STANDARD_LIBRARY_H   /* for ft_setjmp and ft_longjmp */\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /****                                                                 ****/\r
+  /****                                                                 ****/\r
+  /****                    V A L I D A T I O N                          ****/\r
+  /****                                                                 ****/\r
+  /****                                                                 ****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* handle to a validation object */\r
+  typedef struct FT_ValidatorRec_*  FT_Validator;\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* There are three distinct validation levels defined here:              */\r
+  /*                                                                       */\r
+  /* FT_VALIDATE_DEFAULT ::                                                */\r
+  /*   A table that passes this validation level can be used reliably by   */\r
+  /*   FreeType.  It generally means that all offsets have been checked to */\r
+  /*   prevent out-of-bound reads, that array counts are correct, etc.     */\r
+  /*                                                                       */\r
+  /* FT_VALIDATE_TIGHT ::                                                  */\r
+  /*   A table that passes this validation level can be used reliably and  */\r
+  /*   doesn't contain invalid data.  For example, a charmap table that    */\r
+  /*   returns invalid glyph indices will not pass, even though it can     */\r
+  /*   be used with FreeType in default mode (the library will simply      */\r
+  /*   return an error later when trying to load the glyph).               */\r
+  /*                                                                       */\r
+  /*   It also checks that fields which must be a multiple of 2, 4, or 8,  */\r
+  /*   don't have incorrect values, etc.                                   */\r
+  /*                                                                       */\r
+  /* FT_VALIDATE_PARANOID ::                                               */\r
+  /*   Only for font debugging.  Checks that a table follows the           */\r
+  /*   specification by 100%.  Very few fonts will be able to pass this    */\r
+  /*   level anyway but it can be useful for certain tools like font       */\r
+  /*   editors/converters.                                                 */\r
+  /*                                                                       */\r
+  typedef enum  FT_ValidationLevel_\r
+  {\r
+    FT_VALIDATE_DEFAULT = 0,\r
+    FT_VALIDATE_TIGHT,\r
+    FT_VALIDATE_PARANOID\r
+\r
+  } FT_ValidationLevel;\r
+\r
+\r
+  /* validator structure */\r
+  typedef struct  FT_ValidatorRec_\r
+  {\r
+    const FT_Byte*      base;        /* address of table in memory       */\r
+    const FT_Byte*      limit;       /* `base' + sizeof(table) in memory */\r
+    FT_ValidationLevel  level;       /* validation level                 */\r
+    FT_Error            error;       /* error returned. 0 means success  */\r
+\r
+    ft_jmp_buf          jump_buffer; /* used for exception handling      */\r
+\r
+  } FT_ValidatorRec;\r
+\r
+\r
+#define FT_VALIDATOR( x )  ((FT_Validator)( x ))\r
+\r
+\r
+  FT_BASE( void )\r
+  ft_validator_init( FT_Validator        valid,\r
+                     const FT_Byte*      base,\r
+                     const FT_Byte*      limit,\r
+                     FT_ValidationLevel  level );\r
+\r
+  FT_BASE( FT_Int )\r
+  ft_validator_run( FT_Validator  valid );\r
+\r
+  /* Sets the error field in a validator, then calls `longjmp' to return */\r
+  /* to high-level caller.  Using `setjmp/longjmp' avoids many stupid    */\r
+  /* error checks within the validation routines.                        */\r
+  /*                                                                     */\r
+  FT_BASE( void )\r
+  ft_validator_error( FT_Validator  valid,\r
+                      FT_Error      error );\r
+\r
+\r
+  /* Calls ft_validate_error.  Assumes that the `valid' local variable */\r
+  /* holds a pointer to the current validator object.                  */\r
+  /*                                                                   */\r
+  /* Use preprocessor prescan to pass FT_ERR_PREFIX.                   */\r
+  /*                                                                   */\r
+#define FT_INVALID( _prefix, _error )  FT_INVALID_( _prefix, _error )\r
+#define FT_INVALID_( _prefix, _error ) \\r
+          ft_validator_error( valid, _prefix ## _error )\r
+\r
+  /* called when a broken table is detected */\r
+#define FT_INVALID_TOO_SHORT \\r
+          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\r
+\r
+  /* called when an invalid offset is detected */\r
+#define FT_INVALID_OFFSET \\r
+          FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )\r
+\r
+  /* called when an invalid format/value is detected */\r
+#define FT_INVALID_FORMAT \\r
+          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\r
+\r
+  /* called when an invalid glyph index is detected */\r
+#define FT_INVALID_GLYPH_ID \\r
+          FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )\r
+\r
+  /* called when an invalid field value is detected */\r
+#define FT_INVALID_DATA \\r
+          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __FTVALID_H__ */\r
+\r
+\r
+/* END */\r
index 1e5ac44..27d5dc5 100644 (file)
@@ -35,6 +35,7 @@
 #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>
diff --git a/reactos/lib/freetype/include/freetype/internal/services/svotval.h b/reactos/lib/freetype/include/freetype/internal/services/svotval.h
new file mode 100644 (file)
index 0000000..44c2a20
--- /dev/null
@@ -0,0 +1,53 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  svotval.h                                                              */\r
+/*                                                                         */\r
+/*    The FreeType OpenType validation service (specification).            */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __SVOTVAL_H__\r
+#define __SVOTVAL_H__\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+#define FT_SERVICE_ID_OPENTYPE_VALIDATE  "opentype-validate"\r
+\r
+\r
+  typedef FT_Error\r
+  (*otv_validate_func)( FT_Face    face,\r
+                        FT_UInt    ot_flags,\r
+                        FT_Bytes  *base,\r
+                        FT_Bytes  *gdef,\r
+                        FT_Bytes  *gpos,\r
+                        FT_Bytes  *gsub,\r
+                        FT_Bytes  *jstf );\r
+\r
+\r
+  FT_DEFINE_SERVICE( OTvalidate )\r
+  {\r
+    otv_validate_func  validate;\r
+  };\r
+\r
+  /* */\r
+\r
+\r
+FT_END_HEADER\r
+\r
+\r
+#endif /* __SVOTVAL_H__ */\r
+\r
+\r
+/* END */\r
index 73c02cd..63f5db9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType PostScript info service (specification).                */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -36,11 +36,16 @@ FT_BEGIN_HEADER
   typedef FT_Int
   (*PS_HasGlyphNamesFunc)( FT_Face   face );
 
+  typedef FT_Error
+  (*PS_GetFontPrivateFunc)( FT_Face         face,
+                            PS_PrivateRec*  afont_private );
+
 
   FT_DEFINE_SERVICE( PsInfo )
   {
-    PS_GetFontInfoFunc    ps_get_font_info;
-    PS_HasGlyphNamesFunc  ps_has_glyph_names;
+    PS_GetFontInfoFunc     ps_get_font_info;
+    PS_HasGlyphNamesFunc   ps_has_glyph_names;
+    PS_GetFontPrivateFunc  ps_get_font_private;
   };
 
   /* */
index 06a5b1c..87346c6 100644 (file)
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  svsfnt.h                                                               */
 /*                                                                         */
-/*    The FreeType PostScript name services (specification).               */
+/*    The FreeType SFNT table loading service (specification).             */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -50,11 +50,22 @@ FT_BEGIN_HEADER
   (*FT_SFNT_TableGetFunc)( FT_Face      face,
                            FT_Sfnt_Tag  tag );
 
+
+  /*
+   * Used to implement FT_Sfnt_Table_Info().
+   */
+  typedef FT_Error
+  (*FT_SFNT_TableInfoFunc)( FT_Face    face,
+                            FT_UInt    idx,
+                            FT_ULong  *tag,
+                            FT_ULong  *length );
+
+
   FT_DEFINE_SERVICE( SFNT_Table )
   {
     FT_SFNT_TableLoadFunc  load_table;
     FT_SFNT_TableGetFunc   get_table;
+    FT_SFNT_TableInfoFunc  table_info;
   };
 
   /* */
index 9a23b1f..7b58263 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level `sfnt' driver interface (specification).                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -478,6 +478,27 @@ FT_BEGIN_HEADER
   (*TT_Free_Table_Func)( TT_Face  face );
 
 
+  /*
+   * @functype:
+   *    TT_Face_GetKerningFunc
+   *
+   * @description:
+   *    Return the horizontal kerning value between two glyphs.
+   *
+   * @input:
+   *    face        :: A handle to the source face object.
+   *    left_glyph  :: The left glyph index.
+   *    right_glyph :: The right glyph index.
+   *
+   * @return:
+   *    The kerning value in font units.
+   */
+  typedef FT_Int
+  (*TT_Face_GetKerningFunc)( TT_Face  face,
+                             FT_UInt  left_glyph,
+                             FT_UInt  right_glyph );
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
@@ -534,6 +555,9 @@ FT_BEGIN_HEADER
     TT_Load_SBit_Image_Func      load_sbit_image;
     TT_Free_Table_Func           free_sbits;
 
+    /* see `ttkern.h' */
+    TT_Face_GetKerningFunc       get_kerning;
+    
     /* see `ttpost.h' */
     TT_Get_PS_Name_Func          get_psname;
     TT_Free_Table_Func           free_psnames;
index 4a3aab1..7f8335f 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic SFNT/TrueType type definitions and interface (specification    */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004 by                                     */
+/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -311,6 +311,8 @@ FT_BEGIN_HEADER
   } TT_GaspRec;
 
 
+#ifndef FT_OPTIMIZE_MEMORY
+
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
@@ -387,6 +389,8 @@ FT_BEGIN_HEADER
 
   } TT_Kern0_PairRec, *TT_Kern0_Pair;
 
+#endif /* !OPTIMIZE_MEMORY */
+
 
   /*************************************************************************/
   /*************************************************************************/
@@ -1132,6 +1136,9 @@ FT_BEGIN_HEADER
   /*                            glyph data within the `glyf' table.        */
   /*                            Ignored for Type 2 font faces.             */
   /*                                                                       */
+  /*    glyf_len             :: The length of the `glyf' table.  Needed    */
+  /*                            for malformed `loca' tables.               */
+  /*                                                                       */
   /*    font_program_size    :: Size in bytecodes of the face's font       */
   /*                            program.  0 if none defined.  Ignored for  */
   /*                            Type 2 fonts.                              */
@@ -1198,12 +1205,20 @@ FT_BEGIN_HEADER
 
     TT_Header             header;       /* TrueType header table          */
     TT_HoriHeader         horizontal;   /* TrueType horizontal header     */
+#ifdef FT_OPTIMIZE_MEMORY
+    FT_Byte*              horz_metrics;
+    FT_ULong              horz_metrics_size;
+#endif
 
     TT_MaxProfile         max_profile;
     FT_ULong              max_components;
 
     FT_Bool               vertical_info;
     TT_VertHeader         vertical;     /* TT Vertical header, if present */
+#ifdef FT_OPTIMIZE_MEMORY
+    FT_Byte*              vert_metrics;
+    FT_ULong              vert_metrics_size;
+#endif
 
     FT_UShort             num_names;    /* number of name records  */
     TT_NameTableRec       name_table;   /* name table              */
@@ -1238,7 +1253,15 @@ FT_BEGIN_HEADER
     /***********************************************************************/
 
     /* horizontal device metrics */
+#ifdef FT_OPTIMIZE_MEMORY
+    FT_Byte*              hdmx_table;
+    FT_ULong              hdmx_table_size;
+    FT_UInt               hdmx_record_count;
+    FT_ULong              hdmx_record_size;
+    FT_Byte*              hdmx_record_sizes;
+#else
     TT_HdmxRec            hdmx;
+#endif
 
     /* grid-fitting and scaling table */
     TT_GaspRec            gasp;                 /* the `gasp' table */
@@ -1247,8 +1270,14 @@ FT_BEGIN_HEADER
     TT_PCLT               pclt;
 
     /* embedded bitmaps support */
+#ifdef FT_OPTIMIZE_MEMORY
+    FT_Byte*              sbit_table;
+    FT_ULong              sbit_table_size;
+    FT_UInt               sbit_num_strikes;
+#else
     FT_ULong              num_sbit_strikes;
     TT_SBit_Strike        sbit_strikes;
+#endif
 
     FT_ULong              num_sbit_scales;
     TT_SBit_Scale         sbit_scales;
@@ -1264,8 +1293,15 @@ FT_BEGIN_HEADER
     /***********************************************************************/
 
     /* the glyph locations */
+#ifdef FT_OPTIMIZE_MEMORY
+    FT_UInt               num_locations;
+    FT_Byte*              glyph_locations;
+#else
     FT_UShort             num_locations;
     FT_Long*              glyph_locations;
+#endif
+
+    FT_ULong              glyf_len;
 
     /* the font program, if any */
     FT_ULong              font_program_size;
@@ -1279,10 +1315,18 @@ FT_BEGIN_HEADER
     FT_ULong              cvt_size;
     FT_Short*             cvt;
 
+#ifdef FT_OPTIMIZE_MEMORY
+    FT_Byte*              kern_table;
+    FT_ULong              kern_table_size;
+    FT_UInt               num_kern_tables;
+    FT_UInt32             kern_avail_bits;
+    FT_UInt32             kern_order_bits;
+#else
     /* 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.        */
@@ -1297,7 +1341,7 @@ FT_BEGIN_HEADER
     FT_Bool               doblend;
     GX_Blend              blend;
 #endif
-    
+
     /***********************************************************************/
     /*                                                                     */
     /* Other tables or fields. This is used by derivative formats like     */
index 60938aa..5ae12b8 100644 (file)
@@ -387,6 +387,38 @@ FT_BEGIN_HEADER
   FT_Get_PS_Font_Info( FT_Face          face,
                        PS_FontInfoRec  *afont_info );
 
+
+ /************************************************************************
+  *
+  * @function:
+  *    FT_Get_PS_Font_Private
+  *
+  * @description:
+  *    Retrieve the @PS_PrivateRec structure corresponding to a given
+  *    Postscript font.
+  *
+  * @input:
+  *    face ::
+  *       Postscript face handle.
+  *
+  * @output:
+  *    afont_private ::
+  *       Output private dictionary structure pointer.
+  *
+  * @return:
+  *    FreeType error code.  0 means success.
+  *
+  * @note:
+  *    The string pointers within the font info structure are owned by
+  *    the face and don't need to be freed by the caller.
+  *
+  *    If the font's format is not Postscript-based, this function will
+  *    return the FT_Err_Invalid_Argument error code.
+  */
+  FT_EXPORT( FT_Error )
+  FT_Get_PS_Font_Private( FT_Face         face,
+                          PS_PrivateRec  *afont_private );
+
  /* */
 
 
index 848374f..2e7f110 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType name ID definitions (specification only).                   */
 /*                                                                         */
-/*  Copyright 1996-2002, 2003 by                                           */
+/*  Copyright 1996-2002, 2003, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -443,15 +443,23 @@ 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 used to be at         */
+  /* The canonical source for the MS assigned LCID's (seems to) be at      */
   /*                                                                       */
-  /*   http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt              */
+  /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */
   /*                                                                       */
-  /* Now (2002-11-15), the Microsoft site directs to                       */
+  /* 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
@@ -470,18 +478,23 @@ FT_BEGIN_HEADER
 #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_SINGAPORE                 0x1004
 
-#if 1  /* this used to be this value (and it still is in many places) */
+#if 1  /* this looks like the correct value */
 #define TT_MS_LANGID_CHINESE_MACAU                     0x1404
 #else  /* but beware, Microsoft may change its mind...
           the most recent Word reference has the following: */
 #define TT_MS_LANGID_CHINESE_MACAU  TT_MS_LANGID_CHINESE_HONG_KONG
 #endif
 
+#if 0  /* used only with .NET "cultures"; commented out */
+#define TT_MS_LANGID_CHINESE_TRADITIONAL               0x7C04
+#endif
+
 #define TT_MS_LANGID_CZECH_CZECH_REPUBLIC              0x0405
 #define TT_MS_LANGID_DANISH_DENMARK                    0x0406
 #define TT_MS_LANGID_GERMAN_GERMANY                    0x0407
@@ -490,6 +503,13 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007
 #define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407
 #define TT_MS_LANGID_GREEK_GREECE                      0x0408
+
+  /* don't ask what this one means... It is commented out currently. */
+#if 0
+#define TT_MS_LANGID_GREEK_GREECE2                     0x2008
+#endif
+
+#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
@@ -503,6 +523,11 @@ FT_BEGIN_HEADER
 #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_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
@@ -523,6 +548,10 @@ FT_BEGIN_HEADER
 #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
@@ -530,6 +559,19 @@ FT_BEGIN_HEADER
 #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
@@ -553,6 +595,18 @@ FT_BEGIN_HEADER
 #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
+#else  /* current sources say */
+#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 signifiant within 40 chars. */
+#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
@@ -560,6 +614,7 @@ FT_BEGIN_HEADER
 #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
 #define TT_MS_LANGID_UKRAINIAN_UKRAINE                 0x0422
 #define TT_MS_LANGID_BELARUSIAN_BELARUS                0x0423
@@ -568,11 +623,7 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_LATVIAN_LATVIA                    0x0426
 #define TT_MS_LANGID_LITHUANIAN_LITHUANIA              0x0427
 #define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827
-
-#if 0  /* this seems to be an error that have been dropped */
-#define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0428
-#endif
-
+#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
@@ -592,6 +643,17 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438
 #define TT_MS_LANGID_HINDI_INDIA                       0x0439
 #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
+  /* ... and we also keep our old identifier... */
 #define TT_MS_LANGID_SAAMI_LAPONIA                     0x043b
 
 #if 0 /* this seems to be a previous invertion */
@@ -602,15 +664,24 @@ FT_BEGIN_HEADER
 #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_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
+  /* alias declared in Windows 2000 */
+#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
+          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN
+
 #define TT_MS_LANGID_SWAHILI_KENYA                     0x0441
+#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442
 #define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN            0x0443
 #define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC         0x0843
 #define TT_MS_LANGID_TATAR_TATARSTAN                   0x0444
 #define TT_MS_LANGID_BENGALI_INDIA                     0x0445
+#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845
 #define TT_MS_LANGID_PUNJABI_INDIA                     0x0446
+#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846
 #define TT_MS_LANGID_GUJARATI_INDIA                    0x0447
 #define TT_MS_LANGID_ORIYA_INDIA                       0x0448
 #define TT_MS_LANGID_TAMIL_INDIA                       0x0449
@@ -620,107 +691,72 @@ FT_BEGIN_HEADER
 #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_KONKANI_INDIA                     0x0457
-
-  /* new as of 2001-01-01 */
-#define TT_MS_LANGID_ARABIC_GENERAL                    0x0001
-#define TT_MS_LANGID_CHINESE_GENERAL                   0x0004
-#define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009
-#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_BOSNIAN_BOSNIA_HERZEGOVINA        0x101a
-#define TT_MS_LANGID_URDU_INDIA                        0x0820
-#define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428
-#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043d
-#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN               0x0440
-  /* alias declared in Windows 2000 */
-#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
-          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN
-
-#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442
 #define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
-
-  /* the following seems to be inconsistent;
-     here is the current "official" way: */
-#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451
-  /* and here is what is used by Passport SDK */
+#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850
 #define TT_MS_LANGID_TIBETAN_CHINA                     0x0451
 #define TT_MS_LANGID_DZONGHKA_BHUTAN                   0x0851
-  /* end of inconsistency */
+
+#if 0
+  /* the following used to be defined */
+#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451
+  /* ... but it was changed; */
+#else
+  /* So we will continue to #define it, but with the correct value */
+#define TT_MS_LANGID_TIBETAN_BHUTAN   TT_MS_LANGID_DZONGHKA_BHUTAN
+#endif
 
 #define TT_MS_LANGID_WELSH_WALES                       0x0452
 #define TT_MS_LANGID_KHMER_CAMBODIA                    0x0453
 #define TT_MS_LANGID_LAO_LAOS                          0x0454
 #define TT_MS_LANGID_BURMESE_MYANMAR                   0x0455
 #define TT_MS_LANGID_GALICIAN_SPAIN                    0x0456
-#define TT_MS_LANGID_MANIPURI_INDIA                    0x0458
-#define TT_MS_LANGID_SINDHI_INDIA                      0x0459
-  /* the following one is only encountered in Microsoft RTF specification */
-#define TT_MS_LANGID_KASHMIRI_PAKISTAN                 0x0460
-  /* the following one is not in the Passport list, looks like an omission */
-#define TT_MS_LANGID_KASHMIRI_INDIA                    0x0860
-#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461
-#define TT_MS_LANGID_NEPALI_INDIA                      0x0861
-#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462
-
-  /* new as of 2001-03-01 (from Office Xp) */
-#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_KONKANI_INDIA                     0x0457
+#define TT_MS_LANGID_MANIPURI_INDIA  /* Bengali */     0x0458
+#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                 0x045f
+#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) */
+  /* script is yet unclear... might be Arabic, Nagari or Sharada */
+#define TT_MS_LANGID_KASHMIRI_SASIA                    0x0860
+  /* ... and aliased (by MS) for compatibility reasons. */
+#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA
+#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461
+#define TT_MS_LANGID_NEPALI_INDIA                      0x0861
+#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462
 #define TT_MS_LANGID_PASHTO_AFGHANISTAN                0x0463
 #define TT_MS_LANGID_FILIPINO_PHILIPPINES              0x0464
 #define TT_MS_LANGID_DHIVEHI_MALDIVES                  0x0465
   /* alias declared in Windows 2000 */
 #define TT_MS_LANGID_DIVEHI_MALDIVES  TT_MS_LANGID_DHIVEHI_MALDIVES
-  /* for language codes from 0x0466 to 0x0471 see below */
-#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472
-#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473
-#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873
-  /* also spelled in the `Passport SDK' list as: */
-#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA
-
-  /* New additions from Windows Xp/Passport SDK 2001-11-10. */
-
-  /* don't ask what this one means... It is commented out currently. */
-#if 0
-#define TT_MS_LANGID_GREEK_GREECE2                     0x2008
-#endif
-
-#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540a
-  /* The following two IDs blatantly violate MS specs by using a */
-  /* sublanguage > 0x1F.                                         */
-#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40aU
-#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40cU
-
-#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380c
-#define TT_MS_LANGID_FRENCH_HAITI                      0x3c0c
-#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845
-#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846
-#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850
 #define TT_MS_LANGID_EDO_NIGERIA                       0x0466
 #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
-  /* language codes from 0x046b to 0x046f are (still) unknown. */
+#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. */
 #define TT_MS_LANGID_IGBO_NIGERIA                      0x0470
 #define TT_MS_LANGID_KANURI_NIGERIA                    0x0471
+#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472
+#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473
+#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873
+  /* also spelled in the `Passport SDK' list as: */
+#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA
 #define TT_MS_LANGID_GUARANI_PARAGUAY                  0x0474
 #define TT_MS_LANGID_HAWAIIAN_UNITED_STATES            0x0475
 #define TT_MS_LANGID_LATIN                             0x0476
@@ -730,6 +766,13 @@ 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. */
+#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
+#endif
 
 
   /*************************************************************************/
index 26e66b9..051c1ea 100644 (file)
@@ -42,7 +42,7 @@ FT_BEGIN_HEADER
   /*    TrueType Tables                                                    */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    TrueType-specific table types and functions.                       */
+  /*    TrueType specific table types and functions.                       */
   /*                                                                       */
   /* <Description>                                                         */
   /*    This section contains the definition of TrueType-specific tables   */
@@ -651,7 +651,7 @@ FT_BEGIN_HEADER
   *     buffer = malloc( length );
   *     if ( buffer == NULL ) { ... not enough memory ... }
   *
-  *     error = FT_Load_Sfnt_Table( face,tag, 0, buffer, &length );
+  *     error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
   *     if ( error ) { ... could not load table ... }
   *   }
   */
@@ -663,6 +663,43 @@ FT_BEGIN_HEADER
                       FT_ULong*  length );
 
 
+ /**************************************************************************
+  *
+  * <Function>
+  *    FT_Sfnt_Table_Info
+  *
+  * <Description>
+  *   Returns information on an SFNT table.
+  *
+  * <Input>
+  *   face ::
+  *     A handle to the source face.
+  *
+  *   table_index ::
+  *     The index of an SFNT table.  The function returns
+  *     FT_Err_Table_Missing for an invalid value.
+  *
+  * <Output>
+  *   tag ::
+  *     The name tag of the SFNT table.
+  *
+  *   length ::
+  *     The length of the SFNT table.
+  *
+  * <Return>
+  *   FreeType error code.  0 means success.
+  *
+  * <Note>
+  *   SFNT tables with length zero are treated as missing by Windows.
+  *
+  */
+  FT_EXPORT( FT_Error )
+  FT_Sfnt_Table_Info( FT_Face    face,
+                      FT_UInt    table_index,
+                      FT_ULong  *tag,
+                      FT_ULong  *length );
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
index a6876d4..9fee71b 100644 (file)
@@ -2,7 +2,7 @@
 /*                                                                         */
 /*  tttags.h                                                               */
 /*                                                                         */
-/*    Tags for TrueType tables (specification only).                       */
+/*    Tags for TrueType and OpenType tables (specification only).          */
 /*                                                                         */
 /*  Copyright 1996-2001, 2004 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
@@ -34,6 +34,7 @@ FT_BEGIN_HEADER
 
 
 #define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
+#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
 #define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )
 #define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
 #define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
@@ -48,13 +49,16 @@ FT_BEGIN_HEADER
 #define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
 #define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
 #define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )
+#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )
 #define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
+#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
 #define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
 #define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
 #define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
 #define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
 #define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
 #define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )
+#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
 #define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
 #define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
 #define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
index e4d3575..76ee0f4 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src Jamfile (c) 2001, 2002 David Turner
+# FreeType 2 src Jamfile
 #
+# Copyright 2001, 2002 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) ;
 
index 3063f23..c353781 100644 (file)
@@ -1,3 +1,14 @@
+# FreeType 2 src/autofit Jamfile
+#
+# Copyright 2003, 2004, 2005 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
 SubDir FT2_TOP src autofit ;
 
 {
@@ -15,4 +26,4 @@ SubDir FT2_TOP src autofit ;
   Library  $(FT2_LIB) : $(_sources).c ;
 }
 
-# end of src/autofir Jamfile
+# end of src/autofit Jamfile
index e42c962..7411be7 100644 (file)
@@ -1,35 +1,54 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afangles.c                                                             */
+/*                                                                         */
+/*    Routines used to compute vector angles with limited accuracy         */
+/*    and very high speed.  It also contains sorting routines (body).      */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "aftypes.h"
 
+
 /*
  * a python script used to generate the following table
  *
 
 import sys, math
 
-units  = 256
-scale  = units/math.pi
-comma  = ""
+units = 256
+scale = units/math.pi
+comma = ""
 
 print ""
-print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units"
+print "table of arctan( 1/2^n ) for PI = " + repr( units / 65536.0 ) + " units"
 
-r = [-1] + range(32)
+r = [-1] + range( 32 )
 
 for n in r:
-
     if n >= 0:
-        x = 1.0/(2.0**n)    # tangent value
+        x = 1.0 / ( 2.0 ** n )   # tangent value
     else:
-        x = 2.0**(-n)
+        x = 2.0 ** ( -n )
 
-    angle  = math.atan(x)    # arctangent
-    angle2 = angle*scale     # arctangent in FT_Angle units
+    angle  = math.atan( x )      # arctangent
+    angle2 = angle * scale       # arctangent in FT_Angle units
 
     # determine which integer value for angle gives the best tangent
-    lo  = int(angle2)
+    lo  = int( angle2 )
     hi  = lo + 1
-    tlo = math.tan(lo/scale)
-    thi = math.tan(hi/scale)
+    tlo = math.tan( lo / scale )
+    thi = math.tan( hi / scale )
 
     errlo = abs( tlo - x )
     errhi = abs( thi - x )
@@ -41,7 +60,7 @@ for n in r:
     if angle2 <= 0:
         break
 
-    sys.stdout.write( comma + repr( int(angle2) ) )
+    sys.stdout.write( comma + repr( int( angle2 ) ) )
     comma = ", "
 
 *
@@ -122,7 +141,7 @@ for n in r:
     }
 
     if ( y > 0 )
-      theta = - theta;
+      theta = -theta;
 
     arctanptr = af_angle_arctan_table;
 
@@ -167,9 +186,9 @@ for n in r:
 #if 0
     /* round theta */
     if ( theta >= 0 )
-      theta =   FT_PAD_ROUND( theta, 2 );
+      theta =  FT_PAD_ROUND( theta, 2 );
     else
-      theta = - FT_PAD_ROUND( -theta, 2 );
+      theta = -FT_PAD_ROUND( -theta, 2 );
 #endif
 
     vec->x = x;
@@ -177,7 +196,7 @@ for n in r:
   }
 
 
-  /* documentation is in fttrigon.h */
+  /* cf. documentation in fttrigon.h */
 
   FT_LOCAL_DEF( AF_Angle )
   af_angle_atan( FT_Fixed  dx,
@@ -198,13 +217,13 @@ for n in r:
   }
 
 
-
   FT_LOCAL_DEF( AF_Angle )
   af_angle_diff( AF_Angle  angle1,
                  AF_Angle  angle2 )
   {
     AF_Angle  delta = angle2 - angle1;
 
+
     delta %= AF_ANGLE_2PI;
     if ( delta < 0 )
       delta += AF_ANGLE_2PI;
@@ -216,12 +235,9 @@ for n in r:
   }
 
 
- /* well, this needs to be somewhere, right :-)
-  */
-
   FT_LOCAL_DEF( void )
-  af_sort_pos( FT_UInt   count,
-               FT_Pos*   table )
+  af_sort_pos( FT_UInt  count,
+               FT_Pos*  table )
   {
     FT_UInt  i, j;
     FT_Pos   swap;
@@ -266,6 +282,7 @@ for n in r:
 
 
 #ifdef TEST
+
 #include <stdio.h>
 #include <math.h>
 
@@ -274,19 +291,21 @@ int main( void )
   int  angle;
   int  dist;
 
+
   for ( dist = 100; dist < 1000; dist++ )
   {
-    for ( angle = AF_ANGLE_PI; angle < AF_ANGLE_2PI*4; angle++ )
+    for ( angle = AF_ANGLE_PI; angle < AF_ANGLE_2PI * 4; angle++ )
     {
-      double a = (angle*3.1415926535)/(1.0*AF_ANGLE_PI);
-      int    dx, dy, angle1, angle2, delta;
+      double  a = ( angle * 3.1415926535 ) / ( 1.0 * AF_ANGLE_PI );
+      int     dx, dy, angle1, angle2, delta;
 
-      dx = dist * cos(a);
-      dy = dist * sin(a);
 
-      angle1  = ((atan2(dy,dx)*AF_ANGLE_PI)/3.1415926535);
-      angle2  = af_angle_atan( dx, dy );
-      delta   = (angle2 - angle1) % AF_ANGLE_2PI;
+      dx = dist * cos( a );
+      dy = dist * sin( a );
+
+      angle1 = ( ( atan2( dy, dx ) * AF_ANGLE_PI ) / 3.1415926535 );
+      angle2 = af_angle_atan( dx, dy );
+      delta  = ( angle2 - angle1 ) % AF_ANGLE_2PI;
       if ( delta < 0 )
         delta = -delta;
 
@@ -299,4 +318,8 @@ int main( void )
   }
   return 0;
 }
-#endif
+
+#endif /* TEST */
+
+
+/* END */
diff --git a/reactos/lib/freetype/src/autofit/afangles.h b/reactos/lib/freetype/src/autofit/afangles.h
new file mode 100644 (file)
index 0000000..59f42d8
--- /dev/null
@@ -0,0 +1,7 @@
+/*\r
+ *  afangles.h\r
+ *\r
+ *  This is a dummy file, used to please the build system.  It is never\r
+ *  included by the auto-fitter sources.\r
+ *\r
+ */\r
index 2d5f898..ed96e96 100644 (file)
@@ -1,3 +1,22 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afdummy.c                                                              */
+/*                                                                         */
+/*    Auto-fitter dummy routines to be used if no hinting should be        */
+/*    performed (body).                                                    */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "afdummy.h"
 #include "afhints.h"
 
@@ -11,6 +30,7 @@
     return 0;
   }
 
+
   static FT_Error
   af_dummy_hints_apply( AF_GlyphHints  hints,
                         FT_Outline*    outline )
   }
 
 
-  FT_LOCAL_DEF( const AF_ScriptClassRec )  af_dummy_script_class =
+  FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec
+  af_dummy_script_class =
   {
     AF_SCRIPT_NONE,
     NULL,
 
     sizeof( AF_ScriptMetricsRec ),
-    (AF_Script_InitMetricsFunc)  NULL,
-    (AF_Script_ScaleMetricsFunc) NULL,
-    (AF_Script_DoneMetricsFunc)  NULL,
 
-    (AF_Script_InitHintsFunc)    af_dummy_hints_init,
-    (AF_Script_ApplyHintsFunc)   af_dummy_hints_apply
+    (AF_Script_InitMetricsFunc) NULL,
+    (AF_Script_ScaleMetricsFunc)NULL,
+    (AF_Script_DoneMetricsFunc) NULL,
+
+    (AF_Script_InitHintsFunc)   af_dummy_hints_init,
+    (AF_Script_ApplyHintsFunc)  af_dummy_hints_apply
   };
+
+
+/* END */
index f4594c0..2a5faf8 100644 (file)
@@ -1,18 +1,43 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afdummy.h                                                              */
+/*                                                                         */
+/*    Auto-fitter dummy routines to be used if no hinting should be        */
+/*    performed (specification).                                           */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #ifndef __AFDUMMY_H__
 #define __AFDUMMY_H__
 
 #include "aftypes.h"
 
+
 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 script metrics class used when no hinting should
+  *  be performed.  This is the default for non-latin glyphs!
   */
 
-  FT_LOCAL( const AF_ScriptClassRec )    af_dummy_script_class;
+  FT_CALLBACK_TABLE const AF_ScriptClassRec
+  af_dummy_script_class;
 
 /* */
 
 FT_END_HEADER
 
+
 #endif /* __AFDUMMY_H__ */
+
+
+/* END */
similarity index 77%
rename from reactos/lib/freetype/src/autohint/aherrors.h
rename to reactos/lib/freetype/src/autofit/aferrors.h
index bce6107..a2e2a00 100644 (file)
@@ -1,40 +1,40 @@
-/***************************************************************************/
-/*                                                                         */
-/*  aherrors.h                                                             */
-/*                                                                         */
-/*    Autohinter error codes (specification only).                         */
-/*                                                                         */
-/*  Copyright 2001 by                                                      */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* This file is used to define the Autohinter error enumeration          */
-  /* constants.                                                            */
-  /*                                                                       */
-  /*************************************************************************/
-
-#ifndef __AHERRORS_H__
-#define __AHERRORS_H__
-
-#include FT_MODULE_ERRORS_H
-
-#undef __FTERRORS_H__
-
-#define FT_ERR_PREFIX  AH_Err_
-#define FT_ERR_BASE    FT_Mod_Err_Autohint
-
-#include FT_ERRORS_H
-
-#endif /* __AHERRORS_H__ */
-
-/* END */
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  aferrors.h                                                             */\r
+/*                                                                         */\r
+/*    Autofitter error codes (specification only).                         */\r
+/*                                                                         */\r
+/*  Copyright 2005 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* This file is used to define the Autofitter error enumeration          */\r
+  /* constants.                                                            */\r
+  /*                                                                       */\r
+  /*************************************************************************/\r
+\r
+#ifndef __AFERRORS_H__\r
+#define __AFERRORS_H__\r
+\r
+#include FT_MODULE_ERRORS_H\r
+\r
+#undef __FTERRORS_H__\r
+\r
+#define FT_ERR_PREFIX  AF_Err_\r
+#define FT_ERR_BASE    FT_Mod_Err_Autofit\r
+\r
+#include FT_ERRORS_H\r
+\r
+#endif /* __AFERRORS_H__ */\r
+\r
+/* END */\r
index 54852ab..e28673b 100644 (file)
@@ -1,52 +1,71 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afglobal.c                                                             */
+/*                                                                         */
+/*    Auto-fitter routines to compute global hinting values (body).        */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "afglobal.h"
 #include "afdummy.h"
 #include "aflatin.h"
+#include "aferrors.h"
+
 
- /* populate this list when you add new scripts
-  */
-  static AF_ScriptClass const   af_script_classes[] =
+  /* populate this list when you add new scripts */
+  static AF_ScriptClass const  af_script_classes[] =
   {
-    & af_dummy_script_class,
-    & af_latin_script_class,
+    &af_dummy_script_class,
+    &af_latin_script_class,
 
     NULL  /* do not remove */
   };
 
-#define AF_SCRIPT_LIST_DEFAULT   1    /* index of default script in 'af_script_classes' */
-#define AF_SCRIPT_LIST_NONE      255  /* indicates an uncovered glyph                      */
+  /* index of default script in `af_script_classes' */
+#define AF_SCRIPT_LIST_DEFAULT  1
+  /* indicates an uncovered glyph                   */
+#define AF_SCRIPT_LIST_NONE   255
 
- /*
-  *  note that glyph_scripts[] is used to map each glyph into
-  *  an index into the 'af_script_classes' array.
-  *
-  */
-  typedef struct AF_FaceGlobalsRec_
+
+  /*
+   *  Note that glyph_scripts[] is used to map each glyph into
+   *  an index into the `af_script_classes' array.
+   *
+   */
+  typedef struct  AF_FaceGlobalsRec_
   {
-    FT_Face            face;
-    FT_UInt            glyph_count;    /* same as face->num_glyphs     */
-    FT_Byte*           glyph_scripts;
+    FT_Face           face;
+    FT_UInt           glyph_count;    /* same as face->num_glyphs */
+    FT_Byte*          glyph_scripts;
 
-    AF_ScriptMetrics   metrics[ AF_SCRIPT_MAX ];
+    AF_ScriptMetrics  metrics[AF_SCRIPT_MAX];
 
   } AF_FaceGlobalsRec;
 
 
+  /* Compute the script index of each glyph within a given face. */
 
-
- /* this function is used to compute the script index of each glyph
-  * within a given face
-  */
   static FT_Error
   af_face_globals_compute_script_coverage( AF_FaceGlobals  globals )
   {
-    FT_Error    error       = 0;
+    FT_Error    error       = AF_Err_Ok;
     FT_Face     face        = globals->face;
     FT_CharMap  old_charmap = face->charmap;
     FT_Byte*    gscripts    = globals->glyph_scripts;
     FT_UInt     ss;
 
-   /* the value 255 means "uncovered glyph"
-    */
+
+    /* the value 255 means `uncovered glyph' */
     FT_MEM_SET( globals->glyph_scripts,
                 AF_SCRIPT_LIST_NONE,
                 globals->glyph_count );
     error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
     if ( error )
     {
-     /* ignore this error, we'll simply use Latin as the standard
-      * script. XXX: Shouldn't we rather disable hinting ??
+     /*
+      *  Ignore this error; we simply use Latin as the standard
+      *  script.  XXX: Shouldn't we rather disable hinting?
       */
-      error = 0;
+      error = AF_Err_Ok;
       goto Exit;
     }
 
-   /* scan each script in a Unicode charmap
-    */
+    /* scan each script in a Unicode charmap */
     for ( ss = 0; af_script_classes[ss]; ss++ )
     {
       AF_ScriptClass      clazz = af_script_classes[ss];
       AF_Script_UniRange  range;
 
+
       if ( clazz->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 script index.
+       */
       for ( range = clazz->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 < globals->glyph_count             &&
-             gscripts[ gindex ] == AF_SCRIPT_LIST_NONE )
+        if ( gindex != 0                             &&
+             gindex < globals->glyph_count           &&
+             gscripts[gindex] == AF_SCRIPT_LIST_NONE )
         {
-          gscripts[ gindex ] = (FT_Byte) ss;
+          gscripts[gindex] = (FT_Byte)ss;
         }
+
         for (;;)
         {
           charcode = FT_Get_Next_Char( face, charcode, &gindex );
           if ( gindex == 0 || charcode > range->last )
             break;
 
-          if ( gindex < globals->glyph_count       &&
-               gscripts[ gindex ] == AF_SCRIPT_LIST_NONE )
+          if ( gindex < globals->glyph_count           &&
+               gscripts[gindex] == AF_SCRIPT_LIST_NONE )
           {
-            gscripts[ gindex ] = (FT_Byte) ss;
+            gscripts[gindex] = (FT_Byte)ss;
           }
         }
       }
     }
 
   Exit:
-   /* by default, all uncovered glyphs are set to the latin script
-    * XXX: shouldnt' we disable hinting or do something similar ?
-    */
+    /*
+     *  By default, all uncovered glyphs are set to the latin script.
+     *  XXX: Shouldnt' we disable hinting or do something similar?
+     */
     {
       FT_UInt  nn;
 
+
       for ( nn = 0; nn < globals->glyph_count; nn++ )
       {
-        if ( gscripts[ nn ] == AF_SCRIPT_LIST_NONE )
-          gscripts[ nn ] = AF_SCRIPT_LIST_DEFAULT;
+        if ( gscripts[nn] == AF_SCRIPT_LIST_NONE )
+          gscripts[nn] = AF_SCRIPT_LIST_DEFAULT;
       }
     }
 
   }
 
 
-
   FT_LOCAL_DEF( FT_Error )
   af_face_globals_new( FT_Face          face,
                        AF_FaceGlobals  *aglobals )
     FT_Memory       memory;
     AF_FaceGlobals  globals;
 
+
     memory = face->memory;
 
-    if ( !FT_ALLOC( globals, sizeof(*globals) +
-                             face->num_glyphs*sizeof(FT_Byte) ) )
+    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 );
+      globals->glyph_scripts = (FT_Byte*)( globals + 1 );
 
       error = af_face_globals_compute_script_coverage( globals );
       if ( error )
       FT_Memory  memory = globals->face->memory;
       FT_UInt    nn;
 
+
       for ( nn = 0; nn < AF_SCRIPT_MAX; nn++ )
       {
         if ( globals->metrics[nn] )
         {
           AF_ScriptClass  clazz = af_script_classes[nn];
 
+
           FT_ASSERT( globals->metrics[nn]->clazz == clazz );
 
           if ( clazz->script_metrics_done )
       }
 
       globals->glyph_count   = 0;
-      globals->glyph_scripts = NULL;  /* no need to free this one !! */
+      globals->glyph_scripts = NULL;  /* no need to free this one! */
       globals->face          = NULL;
+
       FT_FREE( globals );
     }
   }
                                AF_ScriptMetrics  *ametrics )
   {
     AF_ScriptMetrics  metrics = NULL;
-    FT_UInt           index;
+    FT_UInt           gidx;
     AF_ScriptClass    clazz;
-    FT_Error          error = 0;
+    FT_Error          error = AF_Err_Ok;
+
 
     if ( gindex >= globals->glyph_count )
     {
-      error = FT_Err_Invalid_Argument;
+      error = AF_Err_Invalid_Argument;
       goto Exit;
     }
 
-    index   = globals->glyph_scripts[ gindex ];
-    clazz   = af_script_classes[ index ];
-    metrics = globals->metrics[ clazz->script ];
+    gidx    = globals->glyph_scripts[gindex];
+    clazz   = af_script_classes[gidx];
+    metrics = globals->metrics[clazz->script];
     if ( metrics == NULL )
     {
-     /* create the global metrics object when needed
-      */
+      /* create the global metrics object when needed */
       FT_Memory  memory = globals->face->memory;
 
+
       if ( FT_ALLOC( metrics, clazz->script_metrics_size ) )
         goto Exit;
 
         }
       }
 
-      globals->metrics[ clazz->script ] = metrics;
+      globals->metrics[clazz->script] = metrics;
     }
 
   Exit:
     *ametrics = metrics;
+
     return error;
   }
+
+
+/* END */
index 64f35c3..95a9251 100644 (file)
@@ -1,24 +1,45 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afglobal.h                                                             */
+/*                                                                         */
+/*    Auto-fitter routines to compute global hinting values                */
+/*    (specification).                                                     */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #ifndef __AF_GLOBAL_H__
 #define __AF_GLOBAL_H__
 
+
 #include "aftypes.h"
 
+
 FT_BEGIN_HEADER
 
- /**************************************************************************/
- /**************************************************************************/
- /*****                                                                *****/
- /*****                F A C E   G L O B A L S                         *****/
- /*****                                                                *****/
- /**************************************************************************/
- /**************************************************************************/
 
+  /************************************************************************/
+  /************************************************************************/
+  /*****                                                              *****/
+  /*****                  F A C E   G L O B A L S                     *****/
+  /*****                                                              *****/
+  /************************************************************************/
+  /************************************************************************/
 
- /*
-  *  models the global hints data for a given face, decomposed into
-  *  script-specific items..
-  *
-  */
+
+  /*
+   *  model the global hints data for a given face, decomposed into
+   *  script-specific items
+   */
   typedef struct AF_FaceGlobalsRec_*   AF_FaceGlobals;
 
 
@@ -36,6 +57,10 @@ FT_BEGIN_HEADER
 
  /* */
 
+
 FT_END_HEADER
 
 #endif /* __AF_GLOBALS_H__ */
+
+
+/* END */
index a1a50dc..a3095ee 100644 (file)
+/***************************************************************************/
+/*                                                                         */
+/*  afhints.c                                                              */
+/*                                                                         */
+/*    Auto-fitter hinting routines (body).                                 */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "afhints.h"
+#include "aferrors.h"
+
+
+  FT_LOCAL_DEF( FT_Error )
+  af_axis_hints_new_segment( AF_AxisHints  axis,
+                             FT_Memory     memory,
+                             AF_Segment   *asegment )
+  {
+    FT_Error    error   = AF_Err_Ok;
+    AF_Segment  segment = NULL;
+
+
+    if ( axis->num_segments >= axis->max_segments )
+    {
+      FT_Int  old_max = axis->max_segments;
+      FT_Int  new_max = old_max;
+      FT_Int  big_max = FT_INT_MAX / sizeof ( *segment );
+
+
+      if ( old_max >= big_max )
+      {
+        error = AF_Err_Out_Of_Memory;
+        goto Exit;
+      }
+
+      new_max += ( new_max >> 2 ) + 4;
+      if ( new_max < old_max || new_max > big_max )
+        new_max = big_max;
+
+      if ( FT_RENEW_ARRAY( axis->segments, old_max, new_max ) )
+        goto Exit;
+
+      axis->max_segments = new_max;
+    }
+
+    segment = axis->segments + axis->num_segments++;
+    FT_ZERO( segment );
+
+  Exit:
+    *asegment = segment;
+    return error;
+  }
+
+
+  FT_LOCAL( FT_Error )
+  af_axis_hints_new_edge( AF_AxisHints  axis,
+                          FT_Int        fpos,
+                          FT_Memory     memory,
+                          AF_Edge      *aedge )
+  {
+    FT_Error  error = AF_Err_Ok;
+    AF_Edge   edge  = NULL;
+    AF_Edge   edges;
+
+
+    if ( axis->num_edges >= axis->max_edges )
+    {
+      FT_Int  old_max = axis->max_edges;
+      FT_Int  new_max = old_max;
+      FT_Int  big_max = FT_INT_MAX / sizeof ( *edge );
+
+
+      if ( old_max >= big_max )
+      {
+        error = AF_Err_Out_Of_Memory;
+        goto Exit;
+      }
+
+      new_max += ( new_max >> 2 ) + 4;
+      if ( new_max < old_max || new_max > big_max )
+        new_max = big_max;
+
+      if ( FT_RENEW_ARRAY( axis->edges, old_max, new_max ) )
+        goto Exit;
+
+      axis->max_edges = new_max;
+    }
+
+    edges = axis->edges;
+    edge  = edges + axis->num_edges;
+
+    while ( edge > edges && edge[-1].fpos > fpos )
+    {
+      edge[0] = edge[-1];
+      edge--;
+    }
+
+    axis->num_edges++;
+
+    FT_ZERO( edge );
+    edge->fpos = (FT_Short)fpos;
+
+  Exit:
+    *aedge = edge;
+    return error;
+  }
+
 
 #ifdef AF_DEBUG
 
 #include <stdio.h>
 
-  static const char* af_dir_str( AF_Direction  dir )
+  static const char*
+  af_dir_str( AF_Direction  dir )
   {
     const char*  result;
 
-    switch (dir)
+
+    switch ( dir )
     {
-     case AF_DIR_UP:    result = "up";    break;
-     case AF_DIR_DOWN:  result = "down";  break;
-     case AF_DIR_LEFT:  result = "left";  break;
-     case AF_DIR_RIGHT: result = "right"; break;
-     default:           result = "none";
+    case AF_DIR_UP:
+      result = "up";
+      break;
+    case AF_DIR_DOWN:
+      result = "down";
+      break;
+    case AF_DIR_LEFT:
+      result = "left";
+      break;
+    case AF_DIR_RIGHT:
+      result = "right";
+      break;
+    default:
+      result = "none";
     }
+
     return result;
   }
 
-#define  AF_INDEX_NUM(ptr,base)  ( (ptr) ? ((ptr)-(base)) : -1 )
+
+#define AF_INDEX_NUM( ptr, base )  ( (ptr) ? ( (ptr) - (base) ) : -1 )
+
 
   void
   af_glyph_hints_dump_points( AF_GlyphHints  hints )
     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" );
+    printf(   "  [ index |  xorg |  yorg |  xscale |  yscale "
+              "|  xfit  |  yfit  |  flags ]\n" );
+
     for ( point = points; point < limit; point++ )
     {
-      printf( "  [ %5d | %5d | %5d | %-5.2f | %-5.2f | %-5.2f | %-5.2f | %c%c%c%c%c%c ]\n",
+      printf( "  [ %5d | %5d | %5d | %-5.2f | %-5.2f "
+              "| %-5.2f | %-5.2f | %c%c%c%c%c%c ]\n",
               point - points,
               point->fx,
               point->fy,
               point->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' : ' '
-            );
+              ( 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" );
   }
 
 
-  /* A function used to dump the array of linked segments */
+  /* A function to dump the array of linked segments. */
   void
   af_glyph_hints_dump_segments( AF_GlyphHints  hints )
   {
-    AF_Point    points = hints->points;
-    FT_Int      dimension;
+    AF_Point  points = hints->points;
+    FT_Int    dimension;
+
 
     for ( dimension = 1; dimension >= 0; dimension-- )
     {
-      AF_AxisHints  axis = &hints->axis[dimension];
+      AF_AxisHints  axis     = &hints->axis[dimension];
       AF_Segment    segments = axis->segments;
       AF_Segment    limit    = segments + axis->num_segments;
       AF_Segment    seg;
   void
   af_glyph_hints_dump_edges( AF_GlyphHints  hints )
   {
-    FT_Int      dimension;
+    FT_Int  dimension;
+
 
     for ( dimension = 1; dimension >= 0; dimension-- )
     {
-      AF_AxisHints  axis  = &hints->axis[ dimension ];
+      AF_AxisHints  axis  = &hints->axis[dimension];
       AF_Edge       edges = axis->edges;
       AF_Edge       limit = edges + axis->num_edges;
       AF_Edge       edge;
 
-     /* note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
-      * since they have constant X coordinate
-      */
+
+      /*
+       *  note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
+       *        since they have constant a X coordinate.
+       */
       printf ( "Table of %s edges:\n",
                dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" );
       printf ( "  [ index |  pos |  dir  | link |"
 
       for ( edge = edges; edge < limit; edge++ )
       {
-        printf ( "  [ %5d | %4d | %5s | %4d | %5d |   %c  | %5.2f | %5.2f ]\n",
+        printf ( "  [ %5d | %4d | %5s | %4d |"
+                 " %5d |   %c  | %5.2f | %5.2f ]\n",
                  edge - edges,
                  (int)edge->fpos,
                  af_dir_str( edge->dir ),
                  edge->opos / 64.0,
                  edge->pos / 64.0 );
       }
-
       printf( "\n" );
     }
   }
 
-
-
 #endif /* AF_DEBUG */
 
 
     /* do each contour separately */
     for ( ; contour < contour_limit; contour++ )
     {
-      AF_Point   point = contour[0];
-      AF_Point   first = point;
-      AF_Point   start = point;
-      AF_Point   end   = point;
-      AF_Point   before;
-      AF_Point   after;
-      AF_Angle   angle_in, angle_seg, angle_out;
-      AF_Angle   diff_in, diff_out;
-      FT_Int     finished = 0;
+      AF_Point  point = contour[0];
+      AF_Point  first = point;
+      AF_Point  start = point;
+      AF_Point  end   = point;
+      AF_Point  before;
+      AF_Point  after;
+      AF_Angle  angle_in, angle_seg, angle_out;
+      AF_Angle  diff_in, diff_out;
+      FT_Int    finished = 0;
 
 
       /* compute first segment in contour */
   }
 
 
-
   FT_LOCAL_DEF( void )
   af_glyph_hints_init( AF_GlyphHints  hints,
                        FT_Memory      memory )
   }
 
 
-
   FT_LOCAL_DEF( void )
   af_glyph_hints_done( AF_GlyphHints  hints )
   {
     if ( hints && hints->memory )
     {
-      FT_Memory     memory = hints->memory;
-      AF_Dimension  dim;
+      FT_Memory  memory = hints->memory;
+      int        dim;
 
-     /* note that we don't need to free the segment and edge
-      * buffers, since they're really within the hints->points array
-      */
-      for ( dim = 0; dim < 2; 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 ];
+        AF_AxisHints  axis = &hints->axis[dim];
+
 
         axis->num_segments = 0;
+        axis->max_segments = 0;
+        FT_FREE( axis->segments );
+
         axis->num_edges    = 0;
-        axis->segments     = NULL;
-        axis->edges        = NULL;
+        axis->max_edges    = 0;
+        FT_FREE( axis->edges );
       }
 
       FT_FREE( hints->contours );
   }
 
 
-
   FT_LOCAL_DEF( void )
   af_glyph_hints_rescale( AF_GlyphHints     hints,
                           AF_ScriptMetrics  metrics )
 
 
   FT_LOCAL_DEF( FT_Error )
-  af_glyph_hints_reload( AF_GlyphHints     hints,
-                         FT_Outline*       outline )
+  af_glyph_hints_reload( AF_GlyphHints  hints,
+                         FT_Outline*    outline )
   {
-    FT_Error     error        = FT_Err_Ok;
-    AF_Point     points;
-    FT_UInt      old_max, new_max;
-    AF_Scaler    scaler  = &hints->metrics->scaler;
-    FT_Fixed     x_scale = hints->x_scale;
-    FT_Fixed     y_scale = hints->y_scale;
-    FT_Pos       x_delta = hints->x_delta;
-    FT_Pos       y_delta = hints->y_delta;
-    FT_Memory    memory  = hints->memory;
-
-    hints->scaler_flags  = scaler->flags;
-    hints->num_points    = 0;
-    hints->num_contours  = 0;
+    FT_Error   error   = AF_Err_Ok;
+    AF_Point   points;
+    FT_UInt    old_max, new_max;
+    AF_Scaler  scaler  = &hints->metrics->scaler;
+    FT_Fixed   x_scale = hints->x_scale;
+    FT_Fixed   y_scale = hints->y_scale;
+    FT_Pos     x_delta = hints->x_delta;
+    FT_Pos     y_delta = hints->y_delta;
+    FT_Memory  memory  = hints->memory;
+
+
+    hints->scaler_flags = scaler->flags;
+    hints->num_points   = 0;
+    hints->num_contours = 0;
 
     hints->axis[0].num_segments = 0;
     hints->axis[0].num_edges    = 0;
     hints->axis[1].num_segments = 0;
     hints->axis[1].num_edges    = 0;
 
-   /* first of all, reallocate the contours array when necessary
-    */
-    new_max = (FT_UInt) outline->n_contours;
+    /* first of all, reallocate the contours array when necessary */
+    new_max = (FT_UInt)outline->n_contours;
     old_max = hints->max_contours;
     if ( new_max > old_max )
     {
-      new_max = (new_max + 3) & ~3;
+      new_max = ( new_max + 3 ) & ~3;
 
       if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) )
         goto Exit;
       hints->max_contours = new_max;
     }
 
-   /* then, reallocate the points, segments & edges arrays if needed --
-    * note that we reserved two additional point positions, used to
-    * hint metrics appropriately
-    */
+    /*
+     *  then reallocate the points arrays if necessary --
+     *  note that we reserve two additional point positions, used to
+     *  hint metrics appropriately
+     */
     new_max = (FT_UInt)( outline->n_points + 2 );
     old_max = hints->max_points;
     if ( new_max > old_max )
     {
-      FT_Byte*    items;
-      FT_ULong    off1, off2, off3;
-
-     /* we store in a single buffer the following arrays:
-      *
-      *  - an array of   N  AF_PointRec   items
-      *  - an array of 2*N  AF_SegmentRec items
-      *  - an array of 2*N  AF_EdgeRec    items
-      *
-      */
-
       new_max = ( new_max + 2 + 7 ) & ~7;
 
-#define OFF_PAD2(x,y)   (((x)+(y)-1) & ~((y)-1))
-#define OFF_PADX(x,y)   ((((x)+(y)-1)/(y))*(y))
-#define OFF_PAD(x,y)    ( ((y) & ((y)-1)) ? OFF_PADX(x,y) : OFF_PAD2(x,y) )
-
-#undef  OFF_INCREMENT
-#define OFF_INCREMENT( _off, _type, _count )   \
-     ( OFF_PAD( _off, sizeof(_type) ) + (_count)*sizeof(_type))
-
-      off1 = OFF_INCREMENT( 0, AF_PointRec, new_max );
-      off2 = OFF_INCREMENT( off1, AF_SegmentRec, new_max*2 );
-      off3 = OFF_INCREMENT( off2, AF_EdgeRec, new_max*2 );
-
-      FT_FREE( hints->points );
-
-      if ( FT_ALLOC( items, off3 ) )
-      {
-        hints->max_points       = 0;
-        hints->axis[0].segments = NULL;
-        hints->axis[0].edges    = NULL;
-        hints->axis[1].segments = NULL;
-        hints->axis[1].edges    = NULL;
+      if ( FT_RENEW_ARRAY( hints->points, old_max, new_max ) )
         goto Exit;
-      }
 
-     /* readjust some pointers
-      */
-      hints->max_points       = new_max;
-      hints->points           = (AF_Point) items;
-
-      hints->axis[0].segments = (AF_Segment)( items + off1 );
-      hints->axis[1].segments = hints->axis[0].segments + new_max;
-
-      hints->axis[0].edges    = (AF_Edge)   ( items + off2 );
-      hints->axis[1].edges    = hints->axis[0].edges + new_max;
+      hints->max_points = new_max;
     }
 
     hints->num_points   = outline->n_points;
     hints->num_contours = outline->n_contours;
 
-
-    /* We can't rely on the value of `FT_Outline.flags' to know the fill  */
-    /* direction used for a glyph, given that some fonts are broken (e.g. */
-    /* the Arphic ones).  We thus recompute it each time we need to.      */
-    /*                                                                    */
-    hints->axis[ AF_DIMENSION_HORZ ].major_dir = AF_DIR_UP;
-    hints->axis[ AF_DIMENSION_VERT ].major_dir = AF_DIR_LEFT;
+    /* We can't rely on the value of `FT_Outline.flags' to know the fill   */
+    /* direction used for a glyph, given that some fonts are broken (e.g., */
+    /* the Arphic ones).  We thus recompute it each time we need to.       */
+    /*                                                                     */
+    hints->axis[AF_DIMENSION_HORZ].major_dir = AF_DIR_UP;
+    hints->axis[AF_DIMENSION_VERT].major_dir = AF_DIR_LEFT;
 
     if ( FT_Outline_Get_Orientation( outline ) == FT_ORIENTATION_POSTSCRIPT )
     {
-      hints->axis[ AF_DIMENSION_HORZ ].major_dir = AF_DIR_DOWN;
-      hints->axis[ AF_DIMENSION_VERT ].major_dir = AF_DIR_RIGHT;
+      hints->axis[AF_DIMENSION_HORZ].major_dir = AF_DIR_DOWN;
+      hints->axis[AF_DIMENSION_VERT].major_dir = AF_DIR_RIGHT;
     }
 
     hints->x_scale = x_scale;
       AF_Point  point_limit = points + hints->num_points;
 
 
-      /* compute coordinates & bezier flags */
+      /* compute coordinates & Bezier flags */
       {
         FT_Vector*  vec = outline->points;
         char*       tag = outline->tags;
 
         for ( point = points; point < point_limit; point++, vec++, tag++ )
         {
-          point->fx = vec->x;
-          point->fy = vec->y;
+          point->fx = (FT_Short)vec->x;
+          point->fy = (FT_Short)vec->y;
           point->ox = point->x = FT_MulFix( vec->x, x_scale ) + x_delta;
           point->oy = point->y = FT_MulFix( vec->y, y_scale ) + y_delta;
 
             break;
           default:
             point->flags = 0;
-            ;
           }
         }
       }
       {
         for ( point = points; point < point_limit; point++ )
         {
-          AF_Point   prev;
-          AF_Point   next;
-          FT_Pos     in_x, in_y, out_x, out_y;
+          AF_Point  prev;
+          AF_Point  next;
+          FT_Pos    in_x, in_y, out_x, out_y;
 
 
           prev   = point->prev;
           in_x   = point->fx - prev->fx;
           in_y   = point->fy - prev->fy;
 
-          point->in_dir = af_direction_compute( in_x, in_y );
+          point->in_dir = (FT_Char)af_direction_compute( in_x, in_y );
 
           next   = point->next;
           out_x  = next->fx - point->fx;
           out_y  = next->fy - point->fy;
 
-          point->out_dir = af_direction_compute( out_x, out_y );
+          point->out_dir = (FT_Char)af_direction_compute( out_x, out_y );
 
           if ( point->flags & ( AF_FLAG_CONIC | AF_FLAG_CUBIC ) )
           {
       }
     }
 
-   /* compute inflection points
-    */
+    /* compute inflection points */
     af_glyph_hints_compute_inflections( hints );
 
   Exit:
 
 
   FT_LOCAL_DEF( void )
-  af_glyph_hints_save( AF_GlyphHints   hints,
-                       FT_Outline*     outline )
+  af_glyph_hints_save( AF_GlyphHints  hints,
+                       FT_Outline*    outline )
   {
     AF_Point    point = hints->points;
     AF_Point    limit = point + hints->num_points;
     FT_Vector*  vec   = outline->points;
     char*       tag   = outline->tags;
 
+
     for ( ; point < limit; point++, vec++, tag++ )
     {
-      vec->x = (FT_Pos) point->x;
-      vec->y = (FT_Pos) point->y;
+      vec->x = point->x;
+      vec->y = point->y;
 
       if ( point->flags & AF_FLAG_CONIC )
         tag[0] = FT_CURVE_TAG_CONIC;
   }
 
 
/*
-  *
-  *  E D G E   P O I N T   G R I D - F I T T I N G
-  *
-  */
 /****************************************************************
+   *
+   *                     EDGE POINT GRID-FITTING
+   *
+   ****************************************************************/
 
 
   FT_LOCAL_DEF( void )
   af_glyph_hints_align_edge_points( AF_GlyphHints  hints,
                                     AF_Dimension   dim )
   {
-    AF_AxisHints  axis       = & hints->axis[ dim ];
+    AF_AxisHints  axis       = & hints->axis[dim];
     AF_Edge       edges      = axis->edges;
     AF_Edge       edge_limit = edges + axis->num_edges;
     AF_Edge       edge;
 
+
     for ( edge = edges; edge < edge_limit; edge++ )
     {
       /* move the points of each segment     */
   }
 
 
/*
-  *
-  *  S T R O N G   P O I N T   I N T E R P O L A T I O N
-  *
-  */
 /****************************************************************
+   *
+   *                    STRONG POINT INTERPOLATION
+   *
+   ****************************************************************/
 
 
   /* hint the strong points -- this is equivalent to the TrueType `IP' */
   /* hinting instruction                                               */
+
   FT_LOCAL_DEF( void )
   af_glyph_hints_align_strong_points( AF_GlyphHints  hints,
                                       AF_Dimension   dim )
       AF_Point  point;
       AF_Edge   edge;
 
+
       for ( point = points; point < point_limit; point++ )
       {
         FT_Pos  u, ou, fu;  /* point position */
         if ( point->flags & touch_flag )
           continue;
 
-        /* if this point is candidate to weak interpolation, we will  */
+        /* 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 )         )
           continue;
           }
         }
 
-
       Store_Point:
-
         /* save the point position */
         if ( dim == AF_DIMENSION_HORZ )
           point->x = u;
   }
 
 
- /*
-  *
-  *  W E A K   P O I N T   I N T E R P O L A T I O N
-  *
-  */
+  /****************************************************************
+   *
+   *                    WEAK POINT INTERPOLATION
+   *
+   ****************************************************************/
+
 
   static void
   af_iup_shift( AF_Point  p1,
   af_glyph_hints_align_weak_points( AF_GlyphHints  hints,
                                     AF_Dimension   dim )
   {
-    AF_Point    points        = hints->points;
-    AF_Point    point_limit   = points + hints->num_points;
-    AF_Point*   contour       = hints->contours;
-    AF_Point*   contour_limit = contour + hints->num_contours;
-    AF_Flags    touch_flag;
-    AF_Point    point;
-    AF_Point    end_point;
-    AF_Point    first_point;
+    AF_Point   points        = hints->points;
+    AF_Point   point_limit   = points + hints->num_points;
+    AF_Point*  contour       = hints->contours;
+    AF_Point*  contour_limit = contour + hints->num_contours;
+    AF_Flags   touch_flag;
+    AF_Point   point;
+    AF_Point   end_point;
+    AF_Point   first_point;
 
 
     /* PASS 1: Move segment points to edge positions */
       }
     }
 
-    point   = points;
+    point = points;
 
     for ( ; contour < contour_limit; contour++ )
     {
         point->y = point->u;
     }
   }
+
+
+/* END */
index 40fd613..6f1a8a5 100644 (file)
@@ -1,20 +1,40 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afhints.h                                                              */
+/*                                                                         */
+/*    Auto-fitter hinting routines (specification).                        */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #ifndef __AFHINTS_H__
 #define __AFHINTS_H__
 
 #include "aftypes.h"
 
+
 FT_BEGIN_HEADER
 
  /*
-  *  The definition of outline glyph hints. These are shared by all
-  *  script analysis routines (until now)
-  *
+  *  The definition of outline glyph hints.  These are shared by all
+  *  script analysis routines (until now).
   */
 
   typedef enum
   {
-    AF_DIMENSION_HORZ = 0,  /* x coordinates, i.e. vertical segments & edges   */
-    AF_DIMENSION_VERT = 1,  /* y coordinates, i.e. horizontal segments & edges */
+    AF_DIMENSION_HORZ = 0,  /* x coordinates,                    */
+                            /* i.e., vertical segments & edges   */
+    AF_DIMENSION_VERT = 1,  /* y coordinates,                    */
+                            /* i.e., horizontal segments & edges */
 
     AF_DIMENSION_MAX  /* do not remove */
 
@@ -22,7 +42,7 @@ FT_BEGIN_HEADER
 
 
   /* hint directions -- the values are computed so that two vectors are */
-  /* in opposite directions iff `dir1+dir2 == 0'                        */
+  /* in opposite directions iff `dir1 + dir2 == 0'                      */
   typedef enum
   {
     AF_DIR_NONE  =  4,
@@ -37,30 +57,30 @@ FT_BEGIN_HEADER
   /* point hint flags */
   typedef enum
   {
-    AF_FLAG_NONE    = 0,
+    AF_FLAG_NONE = 0,
 
-   /* point type flags */
-    AF_FLAG_CONIC   = (1 << 0),
-    AF_FLAG_CUBIC   = (1 << 1),
+    /* point type flags */
+    AF_FLAG_CONIC   = 1 << 0,
+    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 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 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),
+    /* point touch flags */
+    AF_FLAG_TOUCH_X = 1 << 6,
+    AF_FLAG_TOUCH_Y = 1 << 7,
 
-   /* candidates for weak interpolation have this flag set */
-    AF_FLAG_WEAK_INTERPOLATION = (1 << 8),
+    /* 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)
+    /* all inflection points in the outline have this flag set */
+    AF_FLAG_INFLECTION = 1 << 9
 
   } AF_Flags;
 
@@ -69,14 +89,13 @@ FT_BEGIN_HEADER
   typedef enum
   {
     AF_EDGE_NORMAL = 0,
-    AF_EDGE_ROUND  = (1 << 0),
-    AF_EDGE_SERIF  = (1 << 1),
-    AF_EDGE_DONE   = (1 << 2)
+    AF_EDGE_ROUND  = 1 << 0,
+    AF_EDGE_SERIF  = 1 << 1,
+    AF_EDGE_DONE   = 1 << 2
 
   } AF_Edge_Flags;
 
 
-
   typedef struct AF_PointRec_*    AF_Point;
   typedef struct AF_SegmentRec_*  AF_Segment;
   typedef struct AF_EdgeRec_*     AF_Edge;
@@ -84,73 +103,75 @@ FT_BEGIN_HEADER
 
   typedef struct  AF_PointRec_
   {
-    AF_Flags      flags;    /* point flags used by hinter */
-    FT_Pos        ox, oy;   /* original, scaled position  */
-    FT_Pos        fx, fy;   /* original, unscaled position (font units) */
-    FT_Pos        x,  y;    /* current position */
-    FT_Pos        u,  v;    /* current (x,y) or (y,x) depending on context */
+    FT_UShort  flags;    /* point flags used by hinter   */
+    FT_Char    in_dir;   /* direction of inwards vector  */
+    FT_Char    out_dir;  /* direction of outwards vector */
 
-    AF_Direction  in_dir;   /* direction of inwards vector  */
-    AF_Direction  out_dir;  /* direction of outwards vector */
+    FT_Pos     ox, oy;   /* original, scaled position                   */
+    FT_Short   fx, fy;   /* original, unscaled position (font units)    */
+    FT_Pos     x, y;     /* current position                            */
+    FT_Pos     u, v;     /* current (x,y) or (y,x) depending on context */
 
-    AF_Point      next;     /* next point in contour     */
-    AF_Point      prev;     /* previous point in contour */
+    AF_Point   next;     /* next point in contour     */
+    AF_Point   prev;     /* previous point in contour */
 
   } AF_PointRec;
 
 
   typedef struct  AF_SegmentRec_
   {
-    AF_Edge_Flags  flags;       /* edge/segment flags for this segment */
-    AF_Direction   dir;         /* segment direction                   */
-    FT_Pos         pos;         /* position of segment                 */
-    FT_Pos         min_coord;   /* minimum coordinate of segment       */
-    FT_Pos         max_coord;   /* maximum coordinate of segment       */
+    FT_Byte     flags;       /* edge/segment flags for this segment */
+    FT_Char     dir;         /* segment direction                   */
+    FT_Short    pos;         /* position of segment                 */
+    FT_Short    min_coord;   /* minimum coordinate of segment       */
+    FT_Short    max_coord;   /* maximum coordinate of segment       */
 
-    AF_Edge        edge;        /* the segment's parent edge */
-    AF_Segment     edge_next;   /* link to next segment in parent edge */
+    AF_Edge     edge;        /* the segment's parent edge           */
+    AF_Segment  edge_next;   /* link to next segment in parent edge */
 
-    AF_Segment     link;        /* (stem) link segment        */
-    AF_Segment     serif;       /* primary segment for serifs */
-    FT_Pos         num_linked;  /* number of linked segments  */
-    FT_Pos         score;       /* used during stem matching  */
+    AF_Segment  link;        /* (stem) link segment        */
+    AF_Segment  serif;       /* primary segment for serifs */
+    FT_Pos      num_linked;  /* number of linked segments  */
+    FT_Pos      score;       /* used during stem matching  */
 
-    AF_Point       first;       /* first point in edge segment             */
-    AF_Point       last;        /* last point in edge segment              */
-    AF_Point*      contour;     /* ptr to first point of segment's contour */
+    AF_Point    first;       /* first point in edge segment             */
+    AF_Point    last;        /* last point in edge segment              */
+    AF_Point*   contour;     /* ptr to first point of segment's contour */
 
   } AF_SegmentRec;
 
 
   typedef struct  AF_EdgeRec_
   {
-    FT_Pos         fpos;       /* original, unscaled position (font units) */
-    FT_Pos         opos;       /* original, scaled position                */
-    FT_Pos         pos;        /* current position                         */
+    FT_Short    fpos;       /* original, unscaled position (font units) */
+    FT_Pos      opos;       /* original, scaled position                */
+    FT_Pos      pos;        /* current position                         */
 
-    AF_Edge_Flags  flags;      /* edge flags */
-    AF_Direction   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              */
+    FT_Byte     flags;      /* edge flags                                   */
+    FT_Char     dir;        /* edge direction                               */
+    FT_Fixed    scale;      /* used to speed up interpolation between edges */
+    AF_Width    blue_edge;  /* non-NULL if this is a blue edge              */
 
-    AF_Edge        link;
-    AF_Edge        serif;
-    FT_Int         num_linked;
+    AF_Edge     link;
+    AF_Edge     serif;
+    FT_Short    num_linked;
 
-    FT_Int         score;
+    FT_Int      score;
 
-    AF_Segment     first;
-    AF_Segment     last;
+    AF_Segment  first;
+    AF_Segment  last;
 
   } AF_EdgeRec;
 
 
-  typedef struct AF_AxisHintsRec_
+  typedef struct  AF_AxisHintsRec_
   {
     FT_Int        num_segments;
+    FT_Int        max_segments;
     AF_Segment    segments;
 
     FT_Int        num_edges;
+    FT_Int        max_edges;
     AF_Edge       edges;
 
     AF_Direction  major_dir;
@@ -158,46 +179,47 @@ FT_BEGIN_HEADER
   } AF_AxisHintsRec, *AF_AxisHints;
 
 
-  typedef struct AF_GlyphHintsRec_
+  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_Pos            edge_distance_threshold;
 
-    FT_Pos        edge_distance_threshold;
+    FT_Int            max_points;
+    FT_Int            num_points;
+    AF_Point          points;
 
-    FT_Int        max_points;
-    FT_Int        num_points;
-    AF_Point      points;
+    FT_Int            max_contours;
+    FT_Int            num_contours;
+    AF_Point*         contours;
 
-    FT_Int        max_contours;
-    FT_Int        num_contours;
-    AF_Point*     contours;
+    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 */
+    FT_UInt32         scaler_flags;  /* copy of scaler flags     */
+    FT_UInt32         other_flags;   /* free for script-specific */
+                                     /* implementations          */
     AF_ScriptMetrics  metrics;
 
   } AF_GlyphHintsRec;
 
 
-#define  AF_HINTS_TEST_SCALER(h,f)  ( (h)->scaler_flags & (f) )
-#define  AF_HINTS_TEST_OTHER(h,f)   ( (h)->other_flags  & (f) )
+#define AF_HINTS_TEST_SCALER( h, f )  ( (h)->scaler_flags & (f) )
+#define AF_HINTS_TEST_OTHER( h, f )   ( (h)->other_flags  & (f) )
 
-#define  AF_HINTS_DO_HORIZONTAL(h)  \
-            !AF_HINTS_TEST_SCALER(h,AF_SCALER_FLAG_NO_HORIZONTAL)
+#define AF_HINTS_DO_HORIZONTAL( h )                                \
+          !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL )
 
-#define  AF_HINTS_DO_VERTICAL(h)    \
-            !AF_HINTS_TEST_SCALER(h,AF_SCALER_FLAG_NO_VERTICAL)
+#define AF_HINTS_DO_VERTICAL( h )                                \
+          !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL )
 
-#define  AF_HINTS_DO_ADVANCE(h)     \
-            !AF_HINTS_TEST_SCALER(h,AF_SCALER_FLAG_NO_ADVANCE)
+#define AF_HINTS_DO_ADVANCE( h )                                \
+          !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
 
 
   FT_LOCAL( AF_Direction )
@@ -205,26 +227,38 @@ FT_BEGIN_HEADER
                         FT_Pos  dy );
 
 
+  FT_LOCAL( FT_Error )
+  af_axis_hints_new_segment( AF_AxisHints  axis,
+                             FT_Memory     memory,
+                             AF_Segment   *asegment );
+
+  FT_LOCAL( FT_Error)
+  af_axis_hints_new_edge( AF_AxisHints  axis,
+                          FT_Int        fpos,
+                          FT_Memory     memory,
+                          AF_Edge      *edge );
+
   FT_LOCAL( void )
   af_glyph_hints_init( AF_GlyphHints  hints,
                        FT_Memory      memory );
 
 
 
- /*  recomputes all AF_Point in a AF_GlyphHints from the definitions
-  *  in a source outline
-  */
+  /*
+   *  recompute all AF_Point in a AF_GlyphHints from the definitions
+   *  in a source outline
+   */
   FT_LOCAL( void )
   af_glyph_hints_rescale( AF_GlyphHints     hints,
                           AF_ScriptMetrics  metrics );
 
   FT_LOCAL( FT_Error )
-  af_glyph_hints_reload( AF_GlyphHints     hints,
-                         FT_Outline*       outline );
+  af_glyph_hints_reload( AF_GlyphHints  hints,
+                         FT_Outline*    outline );
 
   FT_LOCAL( void )
-  af_glyph_hints_save( AF_GlyphHints   hints,
-                       FT_Outline*     outline );
+  af_glyph_hints_save( AF_GlyphHints  hints,
+                       FT_Outline*    outline );
 
   FT_LOCAL( void )
   af_glyph_hints_align_edge_points( AF_GlyphHints  hints,
@@ -243,6 +277,10 @@ FT_BEGIN_HEADER
 
 /* */
 
+
 FT_END_HEADER
 
 #endif /* __AFHINTS_H__ */
+
+
+/* END */
index ce0f8c9..35dfe29 100644 (file)
@@ -1,12 +1,32 @@
+/***************************************************************************/
+/*                                                                         */
+/*  aflatin.c                                                              */
+/*                                                                         */
+/*    Auto-fitter hinting routines for latin script (body).                */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "aflatin.h"
+#include "aferrors.h"
+
 
/***************************************************************************/
/***************************************************************************/
/*****                                                                 *****/
/*****       L A T I N   G L O B A L   M E T R I C S                   *****/
/*****                                                                 *****/
/***************************************************************************/
/***************************************************************************/
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****            L A T I N   G L O B A L   M E T R I C S            *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
 
   static void
   af_latin_metrics_init_widths( AF_LatinMetrics  metrics,
     /* scan the array of segments in each direction */
     AF_GlyphHintsRec  hints[1];
 
+
     af_glyph_hints_init( hints, face->memory );
 
-    metrics->axis[ AF_DIMENSION_HORZ ].width_count = 0;
-    metrics->axis[ AF_DIMENSION_VERT ].width_count = 0;
+    metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
+    metrics->axis[AF_DIMENSION_VERT].width_count = 0;
 
-    /* For now, compute the standard width and height from the `o' */
+    /* For now, compute the standard width and height from the `o'. */
     {
-      FT_Error      error;
-      FT_UInt       glyph_index;
-      AF_Dimension  dim;
+      FT_Error             error;
+      FT_UInt              glyph_index;
+      int                  dim;
       AF_ScriptMetricsRec  dummy[1];
       AF_Scaler            scaler = &dummy->scaler;
 
+
       glyph_index = FT_Get_Char_Index( face, 'o' );
       if ( glyph_index == 0 )
         goto Exit;
@@ -41,7 +63,7 @@
       scaler->x_scale     = scaler->y_scale = 0x10000L;
       scaler->x_delta     = scaler->y_delta = 0;
       scaler->face        = face;
-      scaler->render_mode = 0;
+      scaler->render_mode = FT_RENDER_MODE_NORMAL;
       scaler->flags       = 0;
 
       af_glyph_hints_rescale( hints, dummy );
 
       for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
       {
-        AF_LatinAxis  axis    = & metrics->axis[ dim ];
-        AF_AxisHints  axhints = & hints->axis[ dim ];
+        AF_LatinAxis  axis    = &metrics->axis[dim];
+        AF_AxisHints  axhints = &hints->axis[dim];
         AF_Segment    seg, limit, link;
-        FT_UInt       num_widths = 0;
+
+        FT_UInt       num_widths              = 0;
         FT_Pos        edge_distance_threshold = 32000;
 
-        af_latin_hints_compute_segments( hints, dim );
-        af_latin_hints_link_segments   ( hints, dim );
+
+        error = af_latin_hints_compute_segments( hints,
+                                                 (AF_Dimension)dim );
+        if ( error )
+          goto Exit;
+
+        af_latin_hints_link_segments( hints,
+                                      (AF_Dimension)dim );
 
         seg   = axhints->segments;
         limit = seg + axhints->num_segments;
@@ -67,6 +96,7 @@
         for ( ; seg < limit; seg++ )
         {
           link = seg->link;
+
           /* we only consider stem segments there! */
           if ( link && link->link == seg && link > seg )
           {
           edge_distance_threshold = axis->widths[0].org;
 
         /* Now, compute the edge distance threshold as a fraction of the */
-        /* smallest width in the font. Set it in `hinter->glyph' too!    */
+        /* smallest width in the font.  Set it in `hinter->glyph' too!   */
         if ( edge_distance_threshold == 32000 )
           edge_distance_threshold = 50;
 
 #define AF_LATIN_MAX_TEST_CHARACTERS  12
 
 
-  static  const char* const  af_latin_blue_chars[ AF_LATIN_MAX_BLUES ] =
+  static const char* const  af_latin_blue_chars[AF_LATIN_MAX_BLUES] =
   {
     "THEZOCQS",
     "HEZLOCUS",
   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_LATIN_MAX_TEST_CHARACTERS];
+    FT_Pos        rounds[AF_LATIN_MAX_TEST_CHARACTERS];
     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 ];
+    AF_LatinAxis  axis  = &metrics->axis[AF_DIMENSION_VERT];
     FT_GlyphSlot  glyph = face->glyph;
 
+
     /* we compute the blues simply by loading each character from the    */
     /* 'af_latin_blue_chars[blues]' string, then compute its top-most or */
     /* bottom-most points (depending on `AF_IS_TOP_BLUE')                */
       FT_Pos*      blue_ref;
       FT_Pos*      blue_shoot;
 
+
       AF_LOG(( "blue %3d: ", bb ));
 
       num_flats  = 0;
 
       if ( num_flats == 0 && num_rounds == 0 )
       {
-       /* we couldn't find a single glyph to compute this blue zone,
-        * we will simply ignore it then
-        */
-        AF_LOG(( "empty !!\n" ));
+        /*
+         *  we couldn't find a single glyph to compute this blue zone,
+         *  we will simply ignore it then
+         */
+        AF_LOG(( "empty!\n" ));
         continue;
       }
 
       af_sort_pos( num_rounds, rounds );
       af_sort_pos( num_flats,  flats );
 
-      blue       = & axis->blues[ axis->blue_count ];
+      blue       = & axis->blues[axis->blue_count];
       blue_ref   = & blue->ref.org;
       blue_shoot = & blue->shoot.org;
 
-      axis->blue_count ++;
+      axis->blue_count++;
 
       if ( num_flats == 0 )
       {
-        *blue_ref    =
+        *blue_ref   =
         *blue_shoot = rounds[num_rounds / 2];
       }
       else if ( num_rounds == 0 )
       }
 
       blue->flags = 0;
-      if ( AF_LATIN_IS_TOP_BLUE(bb) )
+      if ( AF_LATIN_IS_TOP_BLUE( bb ) )
         blue->flags |= AF_LATIN_BLUE_TOP;
 
-     /* the following flags is used later to adjust the y and x scales
-      * in order to optimize the pixel grid alignment of the top of small
-      * letters.
-      */
+      /*
+       * The following flags 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 )
         blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
 
   af_latin_metrics_init( AF_LatinMetrics  metrics,
                          FT_Face          face )
   {
-    FT_Error      error;
-    FT_CharMap    oldmap = face->charmap;
+    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 */
+    };
 
-    /* do we have a Unicode charmap in there? */
-    error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
-    if ( error ) goto Exit;
 
     metrics->units_per_em = face->units_per_EM;
 
-    af_latin_metrics_init_widths( metrics, face );
-    af_latin_metrics_init_blues( metrics, face );
+    /* 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 )
+    {
+      af_latin_metrics_init_widths( metrics, face );
+      af_latin_metrics_init_blues( metrics, face );
+    }
 
-  Exit:
     FT_Set_Charmap( face, oldmap );
-    return error;
+    return AF_Err_Ok;
   }
 
 
   static void
-  af_latin_metrics_scale_dim( AF_LatinMetrics   metrics,
-                              AF_Scaler         scaler,
-                              AF_Dimension      dim )
+  af_latin_metrics_scale_dim( AF_LatinMetrics  metrics,
+                              AF_Scaler        scaler,
+                              AF_Dimension     dim )
   {
     FT_Fixed      scale;
     FT_Pos        delta;
     AF_LatinAxis  axis;
     FT_UInt       nn;
 
+
     if ( dim == AF_DIMENSION_HORZ )
     {
       scale = scaler->x_scale;
       delta = scaler->y_delta;
     }
 
-    axis = & metrics->axis[ dim ];
+    axis = &metrics->axis[dim];
 
     if ( axis->org_scale == scale && axis->org_delta == delta )
       return;
     axis->org_scale = scale;
     axis->org_delta = delta;
 
-   /* correct X and Y scale to optimize the alignment of the top of small
-    * letters to the pixel grid
-    */
+    /*
+     * correct X and Y scale to optimize the alignment of the top of small
+     * letters to the pixel grid
+     */
     {
-      AF_LatinAxis  axis  = &metrics->axis[ AF_DIMENSION_VERT ];
-      AF_LatinBlue  blue  = NULL;
-      FT_UInt       nn;
+      AF_LatinAxis  Axis = &metrics->axis[AF_DIMENSION_VERT];
+      AF_LatinBlue  blue = NULL;
 
-      for ( nn = 0; nn < axis->blue_count; nn++ )
+
+      for ( nn = 0; nn < Axis->blue_count; nn++ )
       {
-        if ( axis->blues[nn].flags & AF_LATIN_BLUE_ADJUSTMENT )
+        if ( Axis->blues[nn].flags & AF_LATIN_BLUE_ADJUSTMENT )
         {
-          blue = &axis->blues[nn];
+          blue = &Axis->blues[nn];
           break;
         }
       }
       metrics->root.scaler.y_delta = delta;
     }
 
-   /* scale the standard widths
-    */
+    /* scale the standard widths */
     for ( nn = 0; nn < axis->width_count; nn++ )
     {
       AF_Width  width = axis->widths + nn;
 
+
       width->cur = FT_MulFix( width->org, scale );
       width->fit = width->cur;
     }
 
     if ( dim == AF_DIMENSION_VERT )
     {
-     /* scale the blue zones
-      */
+      /* scale the blue zones */
       for ( nn = 0; nn < axis->blue_count; nn++ )
       {
-        AF_LatinBlue  blue  = & axis->blues[nn];
+        AF_LatinBlue  blue = &axis->blues[nn];
         FT_Pos        dist;
 
+
         blue->ref.cur   = FT_MulFix( blue->ref.org, scale ) + delta;
         blue->ref.fit   = blue->ref.cur;
         blue->shoot.cur = FT_MulFix( blue->shoot.org, scale ) + delta;
         blue->shoot.fit = blue->shoot.cur;
         blue->flags    &= ~AF_LATIN_BLUE_ACTIVE;
 
-       /* a blue zone is only active when it is less than 3/4 pixels tall
-        */
+        /* a blue zone is only active if it is less than 3/4 pixels tall */
         dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );
         if ( dist <= 48 && dist >= -48 )
         {
-          FT_Pos  delta, delta2;
+          FT_Pos  delta1, delta2;
 
-          delta  = blue->shoot.org - blue->ref.org;
-          delta2 = delta;
-          if ( delta < 0 )
+
+          delta1 = blue->shoot.org - blue->ref.org;
+          delta2 = delta1;
+          if ( delta1 < 0 )
             delta2 = -delta2;
 
           delta2 = FT_MulFix( delta2, scale );
           else
             delta2 = FT_PIX_ROUND( delta2 );
 
-          if ( delta < 0 )
+          if ( delta1 < 0 )
             delta2 = -delta2;
 
           blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );
   af_latin_metrics_scale( AF_LatinMetrics  metrics,
                           AF_Scaler        scaler )
   {
-    if ( AF_SCALER_EQUAL_SCALES( scaler, &metrics->root.scaler ) )
-      return;
-
     af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
     af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
   }
 
 
/***************************************************************************/
/***************************************************************************/
/*****                                                                 *****/
/*****            L A T I N   G L Y P H   A N A L Y S I S              *****/
/*****                                                                 *****/
/***************************************************************************/
/***************************************************************************/
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****           L A T I N   G L Y P H   A N A L Y S I S             *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
 
-  FT_LOCAL_DEF( void )
+  FT_LOCAL_DEF( FT_Error )
   af_latin_hints_compute_segments( AF_GlyphHints  hints,
                                    AF_Dimension   dim )
   {
-    AF_AxisHints  axis = &hints->axis[dim];
-    AF_Segment    segments = axis->segments;
-    AF_Segment    segment       =  segments;
-    FT_Int        num_segments  =  0;
-    AF_Point*     contour       =  hints->contours;
-    AF_Point*     contour_limit =  contour + hints->num_contours;
+    AF_AxisHints  axis          = &hints->axis[dim];
+    FT_Memory     memory        = hints->memory;
+    FT_Error      error         = AF_Err_Ok;
+    AF_Segment    segment       = NULL;
+    AF_Point*     contour       = hints->contours;
+    AF_Point*     contour_limit = contour + hints->num_contours;
     AF_Direction  major_dir, segment_dir;
 
 #ifdef AF_HINT_METRICS
-    AF_Point    min_point     =  0;
-    AF_Point    max_point     =  0;
-    FT_Pos      min_coord     =  32000;
-    FT_Pos      max_coord     = -32000;
+    AF_Point  min_point =  0;
+    AF_Point  max_point =  0;
+    FT_Pos    min_coord =  32000;
+    FT_Pos    max_coord = -32000;
 #endif
 
-    major_dir   = FT_ABS( axis->major_dir );
+    major_dir   = (AF_Direction)FT_ABS( axis->major_dir );
     segment_dir = major_dir;
 
+    axis->num_segments = 0;
+
     /* set up (u,v) in each point */
     if ( dim == AF_DIMENSION_HORZ )
     {
       AF_Point  point = hints->points;
       AF_Point  limit = point + hints->num_points;
 
+
       for ( ; point < limit; point++ )
       {
         point->u = point->fx;
       AF_Point  point = hints->points;
       AF_Point  limit = point + hints->num_points;
 
+
       for ( ; point < limit; point++ )
       {
         point->u = point->fy;
       }
     }
 
-
     /* do each contour separately */
     for ( ; contour < contour_limit; contour++ )
     {
           {
             /* we are just leaving an edge; record a new segment! */
             segment->last = point;
-            segment->pos  = ( min_pos + max_pos ) >> 1;
+            segment->pos  = (FT_Short)( ( min_pos + max_pos ) >> 1 );
 
             /* a segment is round if either its first or last point */
             /* is a control point                                   */
             if ( v > max_pos )
               max_pos = v;
 
-            segment->min_coord = min_pos;
-            segment->max_coord = max_pos;
+            segment->min_coord = (FT_Short)min_pos;
+            segment->max_coord = (FT_Short)max_pos;
 
             on_edge = 0;
-            num_segments++;
-            segment++;
+            segment = NULL;
             /* fallthrough */
           }
         }
         if ( !on_edge && FT_ABS( point->out_dir ) == major_dir )
         {
           /* this is the start of a new segment! */
-          segment_dir = point->out_dir;
+          segment_dir = (AF_Direction)point->out_dir;
 
           /* clear all segment fields */
-          FT_ZERO( segment );
+          error = af_axis_hints_new_segment( axis, memory, &segment );
+          if ( error )
+            goto Exit;
 
-          segment->dir      = segment_dir;
+          segment->dir      = (FT_Char)segment_dir;
           segment->flags    = AF_EDGE_NORMAL;
           min_pos = max_pos = point->u;
           segment->first    = point;
     /* we need to ensure that there are edges on the left-most and  */
     /* right-most points of the glyph in order to hint the metrics; */
     /* we do this by inserting fake segments when needed            */
+
     if ( dim == AF_DIMENSION_HORZ )
     {
       AF_Point  point       = hints->points;
       if ( min_point )
       {
         /* clear all segment fields */
-        FT_ZERO( segment );
+        error = af_axis_hints_new_segment( axis, memory, &segment );
+        if ( error )
+          goto Exit;
 
         segment->dir   = segment_dir;
         segment->flags = AF_EDGE_NORMAL;
         segment->score = 32000;
         segment->link  = NULL;
 
-        num_segments++;
-        segment++;
+        segment = NULL;
       }
 
       /* insert maximum segment */
       if ( max_point )
       {
         /* clear all segment fields */
-        FT_ZERO( segment );
+        error = af_axis_hints_new_segment( axis, memory, &segment );
+        if ( error )
+          goto Exit;
 
         segment->dir   = segment_dir;
         segment->flags = AF_EDGE_NORMAL;
         segment->score = 32000;
         segment->link  = NULL;
 
-        num_segments++;
-        segment++;
+        segment = NULL;
       }
     }
 #endif /* AF_HINT_METRICS */
 
-    axis->num_segments = num_segments;
+  Exit:
+    return error;
   }
 
 
     AF_Direction  major_dir     = axis->major_dir;
     AF_Segment    seg1, seg2;
 
+  
     /* now compare each segment to the others */
     for ( seg1 = segments; seg1 < segment_limit; seg1++ )
     {
   }
 
 
-  FT_LOCAL_DEF( void )
+  FT_LOCAL_DEF( FT_Error )
   af_latin_hints_compute_edges( AF_GlyphHints  hints,
                                 AF_Dimension   dim )
   {
-    AF_AxisHints  axis = &hints->axis[dim];
-    AF_LatinAxis  laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim];
-    AF_Edge       edges = axis->edges;
-    AF_Edge       edge, edge_limit;
+    AF_AxisHints  axis   = &hints->axis[dim];
+    FT_Error      error  = AF_Err_Ok;
+    FT_Memory     memory = hints->memory;
+    AF_LatinAxis  laxis  = &((AF_LatinMetrics)hints->metrics)->axis[dim];
 
-    AF_Segment    segments = axis->segments;
+    AF_Segment    segments      = axis->segments;
     AF_Segment    segment_limit = segments + axis->num_segments;
     AF_Segment    seg;
 
     FT_Pos        edge_distance_threshold;
 
 
+    axis->num_edges = 0;
+
     scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale
                                          : hints->y_scale;
 
     edge_distance_threshold = FT_DivFix( edge_distance_threshold,
                                          scale );
 
-    edge_limit = edges;
     for ( seg = segments; seg < segment_limit; seg++ )
     {
       AF_Edge  found = 0;
+      FT_Int   ee;
 
 
       /* look for an edge corresponding to the segment */
-      for ( edge = edges; edge < edge_limit; edge++ )
+      for ( ee = 0; ee < axis->num_edges; ee++ )
       {
-        FT_Pos  dist;
+        AF_Edge  edge = axis->edges + ee;
+        FT_Pos   dist;
 
 
         dist = seg->pos - edge->fpos;
 
       if ( !found )
       {
+        AF_Edge   edge;
+
+
         /* insert a new edge in the list and */
         /* sort according to the position    */
-        while ( edge > edges && edge[-1].fpos > seg->pos )
-        {
-          edge[0] = edge[-1];
-          edge--;
-        }
-        edge_limit++;
+        error = af_axis_hints_new_edge( axis, seg->pos, memory, &edge );
+        if ( error )
+          goto Exit;
 
-        /* clear all edge fields */
+        /* add the segment to the new edge's list */
         FT_ZERO( edge );
 
-        /* add the segment to the new edge's list */
         edge->first    = seg;
         edge->last     = seg;
         edge->fpos     = seg->pos;
       {
         /* if an edge was found, simply add the segment to the edge's */
         /* list                                                       */
-        seg->edge_next        = edge->first;
-        edge->last->edge_next = seg;
-        edge->last            = seg;
+        seg->edge_next         = found->first;
+        found->last->edge_next = seg;
+        found->last            = seg;
       }
     }
-    axis->num_edges = (FT_Int)( edge_limit - edges );
 
 
     /*********************************************************************/
     /* first of all, set the `edge' field in each segment -- this is */
     /* required in order to compute edge links                       */
 
-    /* Note that I've tried to remove this loop, setting
-     * the "edge" field of each segment directly in the
-     * code above.  For some reason, it slows down execution
-     * speed -- on a Sun.
+    /*
+     * 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.
      */
-    for ( edge = edges; edge < edge_limit; edge++ )
     {
-      seg = edge->first;
-      if ( seg )
-        do
-        {
-          seg->edge = edge;
-          seg       = seg->edge_next;
-        }
-        while ( seg != edge->first );
-    }
+      AF_Edge  edges      = axis->edges;
+      AF_Edge  edge_limit = edges + axis->num_edges;
+      AF_Edge  edge;
 
-    /* now, compute each edge properties */
-    for ( edge = edges; edge < edge_limit; edge++ )
-    {
-      FT_Int  is_round    = 0;  /* does it contain round segments?    */
-      FT_Int  is_straight = 0;  /* does it contain straight segments? */
-      FT_Pos  ups         = 0;  /* number of upwards segments         */
-      FT_Pos  downs       = 0;  /* number of downwards segments       */
 
+      for ( edge = edges; edge < edge_limit; edge++ )
+      {
+        seg = edge->first;
+        if ( seg )
+          do
+          {
+            seg->edge = edge;
+            seg       = seg->edge_next;
 
-      seg = edge->first;
+          } while ( seg != edge->first );
+      }
 
-      do
+      /* now, compute each edge properties */
+      for ( edge = edges; edge < edge_limit; edge++ )
       {
-        FT_Bool  is_serif;
+        FT_Int  is_round    = 0;  /* does it contain round segments?    */
+        FT_Int  is_straight = 0;  /* does it contain straight segments? */
+        FT_Pos  ups         = 0;  /* number of upwards segments         */
+        FT_Pos  downs       = 0;  /* number of downwards segments       */
 
 
-        /* check for roundness of segment */
-        if ( seg->flags & AF_EDGE_ROUND )
-          is_round++;
-        else
-          is_straight++;
+        seg = edge->first;
 
-        /* check for segment direction */
-        if ( seg->dir == up_dir )
-          ups   += seg->max_coord-seg->min_coord;
-        else
-          downs += seg->max_coord-seg->min_coord;
+        do
+        {
+          FT_Bool  is_serif;
 
-        /* check for links -- if seg->serif is set, then seg->link must */
-        /* be ignored                                                   */
-        is_serif = (FT_Bool)( seg->serif && seg->serif->edge != edge );
 
-        if ( seg->link || is_serif )
-        {
-          AF_Edge     edge2;
-          AF_Segment  seg2;
+          /* check for roundness of segment */
+          if ( seg->flags & AF_EDGE_ROUND )
+            is_round++;
+          else
+            is_straight++;
 
+          /* check for segment direction */
+          if ( seg->dir == up_dir )
+            ups   += seg->max_coord-seg->min_coord;
+          else
+            downs += seg->max_coord-seg->min_coord;
 
-          edge2 = edge->link;
-          seg2  = seg->link;
+          /* check for links -- if seg->serif is set, then seg->link must */
+          /* be ignored                                                   */
+          is_serif = (FT_Bool)( seg->serif && seg->serif->edge != edge );
 
-          if ( is_serif )
+          if ( seg->link || is_serif )
           {
-            seg2  = seg->serif;
-            edge2 = edge->serif;
-          }
+            AF_Edge     edge2;
+            AF_Segment  seg2;
 
-          if ( edge2 )
-          {
-            FT_Pos  edge_delta;
-            FT_Pos  seg_delta;
+
+            edge2 = edge->link;
+            seg2  = seg->link;
+
+            if ( is_serif )
+            {
+              seg2  = seg->serif;
+              edge2 = edge->serif;
+            }
+
+            if ( edge2 )
+            {
+              FT_Pos  edge_delta;
+              FT_Pos  seg_delta;
 
 
-            edge_delta = edge->fpos - edge2->fpos;
-            if ( edge_delta < 0 )
-              edge_delta = -edge_delta;
+              edge_delta = edge->fpos - edge2->fpos;
+              if ( edge_delta < 0 )
+                edge_delta = -edge_delta;
 
-            seg_delta = seg->pos - seg2->pos;
-            if ( seg_delta < 0 )
-              seg_delta = -seg_delta;
+              seg_delta = seg->pos - seg2->pos;
+              if ( seg_delta < 0 )
+                seg_delta = -seg_delta;
 
-            if ( seg_delta < edge_delta )
+              if ( seg_delta < edge_delta )
+                edge2 = seg2->edge;
+            }
+            else
               edge2 = seg2->edge;
-          }
-          else
-            edge2 = seg2->edge;
 
-          if ( is_serif )
-          {
-            edge->serif   = edge2;
-            edge2->flags |= AF_EDGE_SERIF;
+            if ( is_serif )
+            {
+              edge->serif   = edge2;
+              edge2->flags |= AF_EDGE_SERIF;
+            }
+            else
+              edge->link  = edge2;
           }
-          else
-            edge->link  = edge2;
-        }
 
-        seg = seg->edge_next;
+          seg = seg->edge_next;
 
-      } while ( seg != edge->first );
+        } while ( seg != edge->first );
 
-      /* set the round/straight flags */
-      edge->flags = AF_EDGE_NORMAL;
+        /* set the round/straight flags */
+        edge->flags = AF_EDGE_NORMAL;
 
-      if ( is_round > 0 && is_round >= is_straight )
-        edge->flags |= AF_EDGE_ROUND;
+        if ( is_round > 0 && is_round >= is_straight )
+          edge->flags |= AF_EDGE_ROUND;
 
-      /* set the edge's main direction */
-      edge->dir = AF_DIR_NONE;
+        /* set the edge's main direction */
+        edge->dir = AF_DIR_NONE;
 
-      if ( ups > downs )
-        edge->dir = up_dir;
+        if ( ups > downs )
+          edge->dir = (FT_Char)up_dir;
 
-      else if ( ups < downs )
-        edge->dir = -up_dir;
+        else if ( ups < downs )
+          edge->dir = (FT_Char)-up_dir;
 
-      else if ( ups == downs )
-        edge->dir = 0;  /* both up and down! */
+        else if ( ups == downs )
+          edge->dir = 0;  /* both up and down! */
 
-      /* gets rid of serifs if link is set                */
-      /* XXX: This gets rid of many unpleasant artefacts! */
-      /*      Example: the `c' in cour.pfa at size 13     */
+        /* gets rid of serifs if link is set                */
+        /* XXX: This gets rid of many unpleasant artefacts! */
+        /*      Example: the `c' in cour.pfa at size 13     */
 
-      if ( edge->serif && edge->link )
-        edge->serif = 0;
+        if ( edge->serif && edge->link )
+          edge->serif = 0;
+      }
     }
+
+  Exit:
+    return error;
   }
 
 
-  FT_LOCAL_DEF( void )
+  FT_LOCAL_DEF( FT_Error )
   af_latin_hints_detect_features( AF_GlyphHints  hints,
                                   AF_Dimension   dim )
   {
-    af_latin_hints_compute_segments( hints, dim );
-    af_latin_hints_link_segments   ( hints, dim );
-    af_latin_hints_compute_edges   ( hints, dim );
+    FT_Error  error;
+
+
+    error = af_latin_hints_compute_segments( hints, dim );
+    if ( !error )
+    {
+      af_latin_hints_link_segments( hints, dim );
+
+      error = af_latin_hints_compute_edges( hints, dim );
+    }
+    return error;
   }
 
 
     /* compute which blue zones are active, i.e. have their scaled */
     /* size < 3/4 pixels                                           */
 
-   /* for each horizontal edge search the blue zone which is closest */
+    /* 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_Int    bb;
+      AF_Width  best_blue = NULL;
+      FT_Pos    best_dist;  /* initial threshold */
 
 
       /* compute the initial threshold as a fraction of the EM size */
         AF_LatinBlue  blue = latin->blues + bb;
         FT_Bool       is_top_blue, is_major_dir;
 
-       /* skip inactive blue zones (i.e. those that are too small
-        */
-        if ( !(blue->flags & AF_LATIN_BLUE_ACTIVE) )
+
+        /* skip inactive blue zones (i.e., those that are too small) */
+        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  = (blue->flags & AF_LATIN_BLUE_TOP) != 0;
+        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 ( is_top_blue ^ is_major_dir )
         {
-          FT_Pos   dist;
+          FT_Pos  dist;
 
 
           /* first of all, compare it to the reference position */
   {
     FT_Render_Mode  mode;
 
+
     af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
 
-   /* correct x_scale and y_scale when needed, since they may have
-    * been modified af_latin_scale_dim above
-    */
-    hints->x_scale = metrics->axis[ AF_DIMENSION_HORZ ].scale;
-    hints->x_delta = metrics->axis[ AF_DIMENSION_HORZ ].delta;
-    hints->y_scale = metrics->axis[ AF_DIMENSION_VERT ].scale;
-    hints->y_delta = metrics->axis[ AF_DIMENSION_VERT ].delta;
+    /*
+     *  correct x_scale and y_scale when needed, since they may have
+     *  been modified af_latin_scale_dim above
+     */
+    hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
+    hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
+    hints->y_scale = metrics->axis[AF_DIMENSION_VERT].scale;
+    hints->y_delta = metrics->axis[AF_DIMENSION_VERT].delta;
 
-   /* compute flags depending on render mode, etc...
-    */
+    /* compute flags depending on render mode, etc... */
 
     mode = metrics->root.scaler.render_mode;
 
-   /* we snap the width of vertical stems for the monochrome and
-    * horizontal LCD rendering targets only.
-    */
+    /*
+     *  We snap the width of vertical stems for the monochrome and
+     *  horizontal LCD rendering targets only.
+     */
     if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
       hints->other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
 
-   /* we snap the width of horizontal stems for the monochrome and
-    * vertical LCD rendering targets only.
-    */
+    /*
+     *  We snap the width of horizontal stems for the monochrome and
+     *  vertical LCD rendering targets only.
+     */
     if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
       hints->other_flags |= AF_LATIN_HINTS_VERT_SNAP;
 
-   /* XXX
-    */
+    /*
+     *  We adjust stems to full pixels only if we don't use the `light' mode.
+     */
     if ( mode != FT_RENDER_MODE_LIGHT )
       hints->other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
 
   }
 
 
-
- /***************************************************************************/
- /***************************************************************************/
- /*****                                                                 *****/
- /*****         L A T I N   G L Y P H   G R I D - F I T T I N G         *****/
- /*****                                                                 *****/
- /***************************************************************************/
- /***************************************************************************/
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****        L A T I N   G L Y P H   G R I D - F I T T I N G        *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
 
   /* snap a given width in scaled coordinates to one of the */
   /* current standard widths                                */
+
   static FT_Pos
   af_latin_snap_width( AF_Width  widths,
                        FT_Int    count,
                                AF_Edge_Flags  stem_flags )
   {
     AF_LatinMetrics  metrics  = (AF_LatinMetrics) hints->metrics;
-    AF_LatinAxis     axis     = & metrics->axis[ dim ];
+    AF_LatinAxis     axis     = & metrics->axis[dim];
     FT_Pos           dist     = width;
     FT_Int           sign     = 0;
     FT_Int           vertical = AF_HINTS_DO_VERTICAL( hints );
          ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) )
     {
       /* smooth hinting process: very lightly quantize the stem width */
-      /*                                                              */
 
       /* leave the widths of serifs alone */
 
       {
         FT_Pos  delta;
 
-       /* compare to standard width
-        */
+
+        /* compare to standard width */
         if ( axis->width_count > 0 )
         {
           delta = dist - axis->widths[0].cur;
 
           if ( delta < 40 )
           {
-            dist = axis->widths[ 0 ].cur;
+            dist = axis->widths[0].cur;
             if ( dist < 48 )
               dist = 48;
 
     else
     {
       /* strong hinting process: snap the stem width to integer pixels */
-      /*                                                               */
+
       dist = af_latin_snap_width( axis->widths, axis->width_count, dist );
 
       if ( vertical )
       {
         /* in the case of vertical hinting, always round */
         /* the stem heights to integer pixels            */
+
         if ( dist >= 64 )
           dist = ( dist + 16 ) & ~63;
         else
         {
           /* monochrome horizontal hinting: snap widths to integer pixels */
           /* with a different threshold                                   */
+
           if ( dist < 64 )
             dist = 64;
           else
           /* for horizontal anti-aliased hinting, we adopt a more subtle */
           /* approach: we strengthen small stems, round stems whose size */
           /* is between 1 and 2 pixels to an integer, otherwise nothing  */
+
           if ( dist < 48 )
             dist = ( dist + 64 ) >> 1;
 
   }
 
 
-
   /* align one stem edge relative to the previous stem edge */
+
   static void
   af_latin_align_linked_edge( AF_GlyphHints  hints,
                               AF_Dimension   dim,
   {
     FT_Pos  dist = stem_edge->opos - base_edge->opos;
 
-    FT_Pos  fitted_width = af_latin_compute_stem_width( hints,
-                                                        dim,
-                                                        dist,
-                                                        base_edge->flags,
-                                                        stem_edge->flags );
+    FT_Pos  fitted_width = af_latin_compute_stem_width(
+                             hints, dim, dist,
+                             (AF_Edge_Flags)base_edge->flags,
+                             (AF_Edge_Flags)stem_edge->flags );
+
 
     stem_edge->pos = base_edge->pos + fitted_width;
   }
     serif->pos = base->pos + (serif->opos - base->opos);
   }
 
+
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
-  /****       E D G E   H I N T I N G                                   ****/
+  /****                    E D G E   H I N T I N G                      ****/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
 
 
   FT_LOCAL_DEF( void )
-  af_latin_hint_edges( AF_GlyphHints   hints,
-                       AF_Dimension    dim )
+  af_latin_hint_edges( AF_GlyphHints  hints,
+                       AF_Dimension   dim )
   {
-    AF_AxisHints  axis = & hints->axis[dim];
-    AF_Edge       edges = axis->edges;
+    AF_AxisHints  axis       = &hints->axis[dim];
+    AF_Edge       edges      = axis->edges;
     AF_Edge       edge_limit = edges + axis->num_edges;
     FT_Int        n_edges;
     AF_Edge       edge;
-    AF_Edge       anchor = 0;
+    AF_Edge       anchor     = 0;
     FT_Int        has_serifs = 0;
 
 
     /* we begin by aligning all stems relative to the blue zone */
     /* if needed -- that's only for horizontal edges            */
+
     if ( dim == AF_DIMENSION_VERT )
     {
       for ( edge = edges; edge < edge_limit; edge++ )
 
 
         org_len = edge2->opos - edge->opos;
-        cur_len = af_latin_compute_stem_width( hints, dim, org_len,
-                                               edge->flags, edge2->flags );
+        cur_len = af_latin_compute_stem_width(
+                    hints, dim, org_len,
+                    (AF_Edge_Flags)edge->flags,
+                    (AF_Edge_Flags)edge2->flags );
         if ( cur_len <= 64 )
           u_off = d_off = 32;
         else
         org_len    = edge2->opos - edge->opos;
         org_center = org_pos + ( org_len >> 1 );
 
-        cur_len = af_latin_compute_stem_width( hints, dim, org_len,
-                                               edge->flags, edge2->flags  );
+        cur_len = af_latin_compute_stem_width(
+                   hints, dim, org_len,
+                   (AF_Edge_Flags)edge->flags,
+                   (AF_Edge_Flags)edge2->flags );
 
         if ( cur_len < 96 )
         {
           org_len    = edge2->opos - edge->opos;
           org_center = org_pos + ( org_len >> 1 );
 
-          cur_len    = af_latin_compute_stem_width( hints, dim, org_len,
-                                                    edge->flags, edge2->flags );
+          cur_len    = af_latin_compute_stem_width(
+                         hints, dim, org_len,
+                         (AF_Edge_Flags)edge->flags,
+                         (AF_Edge_Flags)edge2->flags );
 
           cur_pos1   = FT_PIX_ROUND( org_pos );
-          delta1     = ( cur_pos1 + ( cur_len >> 1 ) - org_center );
+          delta1     = cur_pos1 + ( cur_len >> 1 ) - org_center;
           if ( delta1 < 0 )
             delta1 = -delta1;
 
           cur_pos2   = FT_PIX_ROUND( org_pos + org_len ) - cur_len;
-          delta2     = ( cur_pos2 + ( cur_len >> 1 ) - org_center );
+          delta2     = cur_pos2 + ( cur_len >> 1 ) - org_center;
           if ( delta2 < 0 )
             delta2 = -delta2;
 
     /* make sure that lowercase m's maintain their symmetry */
 
     /* In general, lowercase m's have six vertical edges if they are sans */
-    /* serif, or twelve if they are avec serif.  This implementation is   */
+    /* serif, or twelve if they are with serifs.  This implementation is  */
     /* based on that assumption, and seems to work very well with most    */
     /* faces.  However, if for a certain face this assumption is not      */
     /* true, the m is just rendered like before.  In addition, any stem   */
 
     if ( has_serifs || !anchor )
     {
-     /* now hint the remaining edges (serifs and single) in order
-      * to complete our processing
-      */
+      /*
+       *  now hint the remaining edges (serifs and single) in order
+       *  to complete our processing
+       */
       for ( edge = edges; edge < edge_limit; edge++ )
       {
         if ( edge->flags & AF_EDGE_DONE )
                         FT_Outline*      outline,
                         AF_LatinMetrics  metrics )
   {
-    FT_Error      error;
-    AF_Dimension  dim;
+    FT_Error  error;
+    int       dim;
+
 
     error = af_glyph_hints_reload( hints, outline );
     if ( error )
       goto Exit;
 
-   /* analyze glyph outline
-    */
-    if ( AF_HINTS_DO_HORIZONTAL(hints) )
-      af_latin_hints_detect_features( hints, AF_DIMENSION_HORZ );
+    /* analyze glyph outline */
+    if ( AF_HINTS_DO_HORIZONTAL( hints ) )
+    {
+      error = af_latin_hints_detect_features( hints, AF_DIMENSION_HORZ );
+      if ( error )
+        goto Exit;
+    }
 
-    if ( AF_HINTS_DO_VERTICAL(hints) )
+    if ( AF_HINTS_DO_VERTICAL( hints ) )
     {
-      af_latin_hints_detect_features( hints, AF_DIMENSION_VERT );
+      error = af_latin_hints_detect_features( hints, AF_DIMENSION_VERT );
+      if ( error )
+        goto Exit;
+
       af_latin_hints_compute_blue_edges( hints, metrics );
     }
 
-   /* grid-fit the outline
-    */
+    /* grid-fit the outline */
     for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
     {
-      if ( (dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL(hints)) ||
-           (dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL(hints))   )
+      if ( ( dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL( hints ) ) ||
+           ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) )   )
       {
-        af_latin_hint_edges( hints, dim );
-        af_glyph_hints_align_edge_points( hints, dim );
-        af_glyph_hints_align_strong_points( hints, dim );
-        af_glyph_hints_align_weak_points( hints, dim );
+        af_latin_hint_edges( hints, (AF_Dimension)dim );
+        af_glyph_hints_align_edge_points( hints, (AF_Dimension)dim );
+        af_glyph_hints_align_strong_points( hints, (AF_Dimension)dim );
+        af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim );
       }
     }
     af_glyph_hints_save( hints, outline );
     return error;
   }
 
- /***************************************************************************/
- /***************************************************************************/
- /*****                                                                 *****/
- /*****      L A T I N   S C R I P T   C L A S S                        *****/
- /*****                                                                 *****/
- /***************************************************************************/
- /***************************************************************************/
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****              L A T I N   S C R I P T   C L A S S              *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
 
   static const AF_Script_UniRangeRec  af_latin_uniranges[] =
   {
-    { 32,  127 },    /* XXX: TODO: Add new Unicode ranges here !! */
+    { 32,  127 },    /* XXX: TODO: Add new Unicode ranges here! */
     { 160, 255 },
     { 0,   0 }
   };
 
 
-  FT_LOCAL_DEF( const AF_ScriptClassRec )  af_latin_script_class =
+  FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec
+  af_latin_script_class =
   {
     AF_SCRIPT_LATIN,
     af_latin_uniranges,
 
     sizeof( AF_LatinMetricsRec ),
-    (AF_Script_InitMetricsFunc)  af_latin_metrics_init,
-    (AF_Script_ScaleMetricsFunc) af_latin_metrics_scale,
-    (AF_Script_DoneMetricsFunc)  NULL,
 
-    (AF_Script_InitHintsFunc)    af_latin_hints_init,
-    (AF_Script_ApplyHintsFunc)   af_latin_hints_apply
+    (AF_Script_InitMetricsFunc) af_latin_metrics_init,
+    (AF_Script_ScaleMetricsFunc)af_latin_metrics_scale,
+    (AF_Script_DoneMetricsFunc) NULL,
+
+    (AF_Script_InitHintsFunc)   af_latin_hints_init,
+    (AF_Script_ApplyHintsFunc)  af_latin_hints_apply
   };
 
+
+/* END */
index e7e8e48..bc63c02 100644 (file)
@@ -1,34 +1,53 @@
+/***************************************************************************/
+/*                                                                         */
+/*  aflatin.h                                                              */
+/*                                                                         */
+/*    Auto-fitter hinting routines for latin script (specification).       */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #ifndef __AFLATIN_H__
 #define __AFLATIN_H__
 
 #include "afhints.h"
 
+
 FT_BEGIN_HEADER
 
- /*
-  * the latin-specific script class
-  *
-  */
-  FT_LOCAL( const AF_ScriptClassRec )    af_latin_script_class;
-
- /***************************************************************************/
/***************************************************************************/
/*****                                                                 *****/
/*****       L A T I N   G L O B A L   M E T R I C S                   *****/
/*****                                                                 *****/
/***************************************************************************/
/***************************************************************************/
-
- /*
-  * the following declarations could be embedded in the file "aflatin.c"
-  * they've been made semi-public to allow alternate script hinters to
-  * re-use some of them
-  */
-
- /*
-  *  Latin (global) metrics management
-  *
-  */
+
+  /* the latin-specific script class */
+
+  FT_CALLBACK_TABLE const AF_ScriptClassRec
+  af_latin_script_class;
+
+
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****            L A T I N   G L O B A L   M E T R I C S            *****/
 /*****                                                               *****/
 /*************************************************************************/
+  /*************************************************************************/
+
+
+  /*
+   *  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.
+   */
+
+
+  /* Latin (global) metrics management */
 
   enum
   {
@@ -42,45 +61,47 @@ FT_BEGIN_HEADER
     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_MAX_WIDTHS     16
-#define  AF_LATIN_MAX_BLUES      AF_LATIN_BLUE_MAX
+#define AF_LATIN_MAX_WIDTHS  16
+#define AF_LATIN_MAX_BLUES   AF_LATIN_BLUE_MAX
+
 
   enum
   {
-    AF_LATIN_BLUE_ACTIVE     = (1 << 0),
-    AF_LATIN_BLUE_TOP        = (1 << 1),
-    AF_LATIN_BLUE_ADJUSTMENT = (1 << 2),  /* used for scale adjustment */
-                                          /* optimization              */
+    AF_LATIN_BLUE_ACTIVE     = 1 << 0,
+    AF_LATIN_BLUE_TOP        = 1 << 1,
+    AF_LATIN_BLUE_ADJUSTMENT = 1 << 2,  /* used for scale adjustment */
+                                        /* optimization              */
     AF_LATIN_BLUE_FLAG_MAX
   };
 
 
-  typedef struct AF_LatinBlueRec_
+  typedef struct  AF_LatinBlueRec_
   {
-    AF_WidthRec   ref;
-    AF_WidthRec   shoot;
-    FT_UInt       flags;
+    AF_WidthRec  ref;
+    AF_WidthRec  shoot;
+    FT_UInt      flags;
 
   } AF_LatinBlueRec, *AF_LatinBlue;
 
 
-  typedef struct AF_LatinAxisRec_
+  typedef struct  AF_LatinAxisRec_
   {
     FT_Fixed         scale;
     FT_Pos           delta;
 
     FT_UInt          width_count;
-    AF_WidthRec      widths[ AF_LATIN_MAX_WIDTHS ];
+    AF_WidthRec      widths[AF_LATIN_MAX_WIDTHS];
     FT_Pos           edge_distance_threshold;
 
-   /* ignored for horizontal metrics */
+    /* ignored for horizontal metrics */
     FT_Bool          control_overshoot;
     FT_UInt          blue_count;
-    AF_LatinBlueRec  blues[ AF_LATIN_BLUE_MAX ];
+    AF_LatinBlueRec  blues[AF_LATIN_BLUE_MAX];
 
     FT_Fixed         org_scale;
     FT_Pos           org_delta;
@@ -88,16 +109,15 @@ FT_BEGIN_HEADER
   } AF_LatinAxisRec, *AF_LatinAxis;
 
 
-  typedef struct AF_LatinMetricsRec_
+  typedef struct  AF_LatinMetricsRec_
   {
-    AF_ScriptMetricsRec   root;
-    FT_UInt               units_per_em;
-    AF_LatinAxisRec       axis[ AF_DIMENSION_MAX ];
+    AF_ScriptMetricsRec  root;
+    FT_UInt              units_per_em;
+    AF_LatinAxisRec      axis[AF_DIMENSION_MAX];
 
   } AF_LatinMetricsRec, *AF_LatinMetrics;
 
 
-
   FT_LOCAL( FT_Error )
   af_latin_metrics_init( AF_LatinMetrics  metrics,
                          FT_Face          face );
@@ -108,57 +128,63 @@ FT_BEGIN_HEADER
 
 
 
/***************************************************************************/
/***************************************************************************/
/*****                                                                 *****/
/*****            L A T I N   G L Y P H   A N A L Y S I S              *****/
/*****                                                                 *****/
/***************************************************************************/
/***************************************************************************/
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****           L A T I N   G L Y P H   A N A L Y S I S             *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
 
   enum
   {
-    AF_LATIN_HINTS_HORZ_SNAP   = (1 << 0),  /* enable stem width snapping  */
-    AF_LATIN_HINTS_VERT_SNAP   = (1 << 1),  /* enable stem height snapping */
-    AF_LATIN_HINTS_STEM_ADJUST = (1 << 2),  /* enable stem width/height adjustment */
-    AF_LATIN_HINTS_MONO        = (1 << 3)   /* indicate monochrome rendering */
+    AF_LATIN_HINTS_HORZ_SNAP   = 1 << 0, /* enable stem width snapping  */
+    AF_LATIN_HINTS_VERT_SNAP   = 1 << 1, /* enable stem height snapping */
+    AF_LATIN_HINTS_STEM_ADJUST = 1 << 2, /* enable stem width/height    */
+                                         /* adjustment                  */
+    AF_LATIN_HINTS_MONO        = 1 << 3  /* indicate monochrome         */
+                                         /* rendering                   */
   };
 
-#define  AF_LATIN_HINTS_DO_HORZ_SNAP(h) \
-   AF_HINTS_TEST_OTHER(h,AF_LATIN_HINTS_HORZ_SNAP)
 
-#define  AF_LATIN_HINTS_DO_VERT_SNAP(h) \
-   AF_HINTS_TEST_OTHER(h,AF_LATIN_HINTS_VERT_SNAP)
+#define AF_LATIN_HINTS_DO_HORZ_SNAP( h )             \
+  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_HORZ_SNAP )
 
-#define  AF_LATIN_HINTS_DO_STEM_ADJUST(h)  \
-   AF_HINTS_TEST_OTHER(h,AF_LATIN_HINTS_STEM_ADJUST)
+#define AF_LATIN_HINTS_DO_VERT_SNAP( h )             \
+  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_VERT_SNAP )
 
-#define  AF_LATIN_HINTS_DO_MONO(h)  \
-   AF_HINTS_TEST_OTHER(h,AF_LATIN_HINTS_MONO)
+#define AF_LATIN_HINTS_DO_STEM_ADJUST( h )             \
+  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_STEM_ADJUST )
 
+#define AF_LATIN_HINTS_DO_MONO( h )             \
+  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_MONO )
 
- /* this shouldn't normally be exported. However, other scripts might
-  * like to use this function as-is
-  */
-  FT_LOCAL( void )
+
+  /*
+   *  This shouldn't normally be exported.  However, other scripts might
+   *  like to use this function 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
-  */
+  /*
+   *  This shouldn't normally be exported.  However, other scripts might
+   *  want to use this function as-is.
+   */
   FT_LOCAL( void )
   af_latin_hints_link_segments( AF_GlyphHints  hints,
                                 AF_Dimension   dim );
 
- /* this shouldn't normally be exported. However, other scripts might
-  * want to use this function as-is
-  */
-  FT_LOCAL( void )
+  /*
+   *  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( void )
+  FT_LOCAL( FT_Error )
   af_latin_hints_detect_features( AF_GlyphHints  hints,
                                   AF_Dimension   dim );
 
@@ -167,3 +193,6 @@ FT_BEGIN_HEADER
 FT_END_HEADER
 
 #endif /* __AFLATIN_H__ */
+
+
+/* END */
index 6782ee8..c3f3b2c 100644 (file)
@@ -1,7 +1,27 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afloader.c                                                             */
+/*                                                                         */
+/*    Auto-fitter glyph loading routines (body).                           */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "afloader.h"
 #include "afhints.h"
 #include "afglobal.h"
 #include "aflatin.h"
+#include "aferrors.h"
+
 
   FT_LOCAL_DEF( FT_Error )
   af_loader_init( AF_Loader  loader,
@@ -9,6 +29,7 @@
   {
     FT_Error  error;
 
+
     FT_ZERO( loader );
 
     af_glyph_hints_init( &loader->hints, memory );
 
 
   FT_LOCAL_DEF( FT_Error )
-  af_loader_reset( AF_Loader   loader,
-                   FT_Face     face )
+  af_loader_reset( AF_Loader  loader,
+                   FT_Face    face )
   {
-    FT_Error   error = 0;
+    FT_Error  error = AF_Err_Ok;
+
 
     loader->face    = face;
-    loader->globals = (AF_FaceGlobals) face->autohint.data;
+    loader->globals = (AF_FaceGlobals)face->autohint.data;
 
     FT_GlyphLoader_Rewind( loader->gloader );
 
       error = af_face_globals_new( face, &loader->globals );
       if ( !error )
       {
-        face->autohint.data      = (FT_Pointer) loader->globals;
-        face->autohint.finalizer = (FT_Generic_Finalizer) af_face_globals_free;
+        face->autohint.data =
+          (FT_Pointer)loader->globals;
+        face->autohint.finalizer =
+          (FT_Generic_Finalizer)af_face_globals_free;
       }
     }
+
     return error;
   }
 
 
   FT_LOCAL_DEF( void )
-  af_loader_done( AF_Loader   loader )
+  af_loader_done( AF_Loader  loader )
   {
+    af_glyph_hints_done( &loader->hints );
+
     loader->face    = NULL;
     loader->globals = NULL;
 
@@ -69,7 +96,7 @@
                     FT_Int32   load_flags,
                     FT_UInt    depth )
   {
-    FT_Error          error    = 0;
+    FT_Error          error;
     FT_Face           face     = loader->face;
     FT_GlyphLoader    gloader  = loader->gloader;
     AF_ScriptMetrics  metrics  = loader->metrics;
     FT_GlyphSlot      slot     = face->glyph;
     FT_Slot_Internal  internal = slot->internal;
 
+
     error = FT_Load_Glyph( face, glyph_index, load_flags );
     if ( error )
       goto Exit;
     {
       FT_Matrix  inverse;
 
+
       loader->trans_matrix = internal->glyph_matrix;
       loader->trans_delta  = internal->glyph_delta;
 
 
     switch ( slot->format )
     {
-      case FT_GLYPH_FORMAT_OUTLINE:
-       /* translate the loaded glyph when an internal transform
-        * is needed
-        */
-        if ( loader->transformed )
-          FT_Outline_Translate( &slot->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 */
-        error = FT_GlyphLoader_CheckPoints( gloader,
-                                            slot->outline.n_points + 4,
-                                            slot->outline.n_contours );
-        if ( error )
-          goto Exit;
+    case FT_GLYPH_FORMAT_OUTLINE:
+      /* translate the loaded glyph when an internal transform is needed */
+      if ( loader->transformed )
+        FT_Outline_Translate( &slot->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 */
+      error = FT_GlyphLoader_CheckPoints( gloader,
+                                          slot->outline.n_points + 4,
+                                          slot->outline.n_contours );
+      if ( error )
+        goto Exit;
 
-        FT_ARRAY_COPY( gloader->current.outline.points,
-                       slot->outline.points,
-                       slot->outline.n_points );
-
-        FT_ARRAY_COPY( gloader->current.extra_points,
-                       slot->outline.points,
-                       slot->outline.n_points );
-
-        FT_ARRAY_COPY( gloader->current.outline.contours,
-                       slot->outline.contours,
-                       slot->outline.n_contours );
-
-        FT_ARRAY_COPY( gloader->current.outline.tags,
-                       slot->outline.tags,
-                       slot->outline.n_points );
-
-        gloader->current.outline.n_points   = slot->outline.n_points;
-        gloader->current.outline.n_contours = slot->outline.n_contours;
-
-        /* compute original horizontal phantom points (and ignore */
-        /* vertical ones)                                         */
-        loader->pp1.x = hints->x_delta;
-        loader->pp1.y = hints->y_delta;
-        loader->pp2.x = FT_MulFix( slot->metrics.horiAdvance,
-                                   hints->x_scale ) + hints->x_delta;
-        loader->pp2.y = hints->y_delta;
-
-        /* be sure to check for spacing glyphs */
-        if ( slot->outline.n_points == 0 )
-          goto Hint_Metrics;
-
-        /* now load the slot image into the auto-outline and run the */
-        /* automatic hinting process                                 */
-        metrics->clazz->script_hints_apply( hints,
-                                            &gloader->current.outline,
-                                            metrics );
-
-        /* we now need to hint the metrics according to the change in */
-        /* width/positioning that occured during the hinting process  */
-        {
-          FT_Pos        old_advance, old_rsb, old_lsb, new_lsb;
-          FT_Pos        pp1x_uh, pp2x_uh;
-          AF_AxisHints  axis  = &hints->axis[ AF_DIMENSION_HORZ ];
-          AF_Edge       edge1 = axis->edges;         /* leftmost edge  */
-          AF_Edge       edge2 = edge1 +
-                                axis->num_edges - 1; /* rightmost edge */
+      FT_ARRAY_COPY( gloader->current.outline.points,
+                     slot->outline.points,
+                     slot->outline.n_points );
+
+      FT_ARRAY_COPY( gloader->current.extra_points,
+                     slot->outline.points,
+                     slot->outline.n_points );
+
+      FT_ARRAY_COPY( gloader->current.outline.contours,
+                     slot->outline.contours,
+                     slot->outline.n_contours );
+
+      FT_ARRAY_COPY( gloader->current.outline.tags,
+                     slot->outline.tags,
+                     slot->outline.n_points );
+
+      gloader->current.outline.n_points   = slot->outline.n_points;
+      gloader->current.outline.n_contours = slot->outline.n_contours;
+
+      /* compute original horizontal phantom points (and ignore */
+      /* vertical ones)                                         */
+      loader->pp1.x = hints->x_delta;
+      loader->pp1.y = hints->y_delta;
+      loader->pp2.x = FT_MulFix( slot->metrics.horiAdvance,
+                                 hints->x_scale ) + hints->x_delta;
+      loader->pp2.y = hints->y_delta;
+
+      /* be sure to check for spacing glyphs */
+      if ( slot->outline.n_points == 0 )
+        goto Hint_Metrics;
+
+      /* now load the slot image into the auto-outline and run the */
+      /* automatic hinting process                                 */
+      metrics->clazz->script_hints_apply( hints,
+                                          &gloader->current.outline,
+                                          metrics );
+
+      /* we now need to hint the metrics according to the change in */
+      /* width/positioning that occured during the hinting process  */
+      {
+        FT_Pos        old_advance, old_rsb, old_lsb, new_lsb;
+        FT_Pos        pp1x_uh, pp2x_uh;
+        AF_AxisHints  axis  = &hints->axis[AF_DIMENSION_HORZ];
+        AF_Edge       edge1 = axis->edges;         /* leftmost edge  */
+        AF_Edge       edge2 = edge1 +
+                              axis->num_edges - 1; /* rightmost edge */
 
 
-          if ( edge2 > edge1 )
-          {
-            old_advance = loader->pp2.x;
-            old_rsb     = old_advance - edge2->opos;
-            old_lsb     = edge1->opos;
-            new_lsb     = edge1->pos;
+        if ( axis->num_edges > 1 )
+        {
+          old_advance = loader->pp2.x;
+          old_rsb     = old_advance - edge2->opos;
+          old_lsb     = edge1->opos;
+          new_lsb     = edge1->pos;
 
-            /* remember unhinted values to later account */
-            /* for rounding errors                       */
+          /* remember unhinted values to later account */
+          /* for rounding errors                       */
 
-            pp1x_uh = new_lsb    - old_lsb;
-            pp2x_uh = edge2->pos + old_rsb;
+          pp1x_uh = new_lsb    - old_lsb;
+          pp2x_uh = edge2->pos + old_rsb;
 
-            /* prefer too much space over too little space */
-            /* for very small sizes                        */
+          /* prefer too much space over too little space */
+          /* for very small sizes                        */
 
-            if ( old_lsb < 24 )
-              pp1x_uh -= 5;
+          if ( old_lsb < 24 )
+            pp1x_uh -= 5;
 
-            if ( old_rsb < 24 )
-              pp2x_uh += 5;
+          if ( old_rsb < 24 )
+            pp2x_uh += 5;
 
-            loader->pp1.x = FT_PIX_ROUND( pp1x_uh );
-            loader->pp2.x = FT_PIX_ROUND( pp2x_uh );
+          loader->pp1.x = FT_PIX_ROUND( pp1x_uh );
+          loader->pp2.x = FT_PIX_ROUND( pp2x_uh );
 
-            slot->lsb_delta = loader->pp1.x - pp1x_uh;
-            slot->rsb_delta = loader->pp2.x - pp2x_uh;
+          slot->lsb_delta = loader->pp1.x - pp1x_uh;
+          slot->rsb_delta = loader->pp2.x - pp2x_uh;
 
 #if 0
-            /* try to fix certain bad advance computations */
-            if ( loader->pp2.x + loader->pp1.x == edge2->pos && old_rsb > 4 )
-              loader->pp2.x += 64;
+          /* try to fix certain bad advance computations */
+          if ( loader->pp2.x + loader->pp1.x == edge2->pos && old_rsb > 4 )
+            loader->pp2.x += 64;
 #endif
-          }
-          else
-          {
-            loader->pp1.x = FT_PIX_ROUND( loader->pp1.x );
-            loader->pp2.x = FT_PIX_ROUND( loader->pp2.x );
-          }
+
         }
+        else
+        {
+          loader->pp1.x = FT_PIX_ROUND( loader->pp1.x );
+          loader->pp2.x = FT_PIX_ROUND( loader->pp2.x );
+        }
+      }
 
-        /* good, we simply add the glyph to our loader's base */
-        FT_GlyphLoader_Add( gloader );
-        break;
+      /* good, we simply add the glyph to our loader's base */
+      FT_GlyphLoader_Add( gloader );
+      break;
 
     case FT_GLYPH_FORMAT_COMPOSITE:
       {
                        num_subglyphs );
 
         gloader->current.num_subglyphs = num_subglyphs;
-        num_base_subgs = gloader->base.num_subglyphs;
+        num_base_subgs                 = gloader->base.num_subglyphs;
 
         /* now, read each subglyph independently */
         for ( nn = 0; nn < num_subglyphs; nn++ )
             if ( start_point + k >= num_base_points         ||
                                l >= (FT_UInt)num_new_points )
             {
-              error = FT_Err_Invalid_Composite;
+              error = AF_Err_Invalid_Composite;
               goto Exit;
             }
 
             x = FT_MulFix( subglyph->arg1, hints->x_scale ) + hints->x_delta;
             y = FT_MulFix( subglyph->arg2, hints->y_scale ) + hints->y_delta;
 
-            x = FT_PIX_ROUND(x);
-            y = FT_PIX_ROUND(y);
+            x = FT_PIX_ROUND( x );
+            y = FT_PIX_ROUND( y );
           }
 
           {
 
     default:
       /* we don't support other formats (yet?) */
-      error = FT_Err_Unimplemented_Feature;
+      error = AF_Err_Unimplemented_Feature;
     }
 
   Hint_Metrics:
 
       FT_Outline_Get_CBox( &gloader->base.outline, &bbox );
 
-      bbox.xMin  = FT_PIX_FLOOR(  bbox.xMin );
-      bbox.yMin  = FT_PIX_FLOOR(  bbox.yMin );
-      bbox.xMax  = FT_PIX_CEIL( bbox.xMax );
-      bbox.yMax  = FT_PIX_CEIL( bbox.yMax );
+      bbox.xMin = FT_PIX_FLOOR( bbox.xMin );
+      bbox.yMin = FT_PIX_FLOOR( bbox.yMin );
+      bbox.xMax = FT_PIX_CEIL(  bbox.xMax );
+      bbox.yMax = FT_PIX_CEIL(  bbox.yMax );
 
       slot->metrics.width        = bbox.xMax - bbox.xMin;
       slot->metrics.height       = bbox.yMax - bbox.yMin;
         slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
                                                x_scale );
 #else
-      /* for mono-width fonts (like Andale, Courier, etc.) we need */
-      /* to keep the original rounded advance width                */
       if ( !FT_IS_FIXED_WIDTH( slot->face ) )
         slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
       else
   }
 
 
-
-
   FT_LOCAL_DEF( FT_Error )
   af_loader_load_glyph( AF_Loader  loader,
                         FT_Face    face,
     FT_Size       size = face->size;
     AF_ScalerRec  scaler;
 
+
     if ( !size )
-      return FT_Err_Invalid_Argument;
+      return AF_Err_Invalid_Argument;
 
     FT_ZERO( &scaler );
 
     {
       AF_ScriptMetrics  metrics;
 
-      error = af_face_globals_get_metrics( loader->globals, gindex, &metrics );
+
+      error = af_face_globals_get_metrics( loader->globals, gindex,
+                                           &metrics );
       if ( !error )
       {
         loader->metrics = metrics;
 
-        metrics->scaler = scaler;
-
         if ( metrics->clazz->script_metrics_scale )
           metrics->clazz->script_metrics_scale( metrics, &scaler );
+        else
+          metrics->scaler = scaler;
 
         load_flags |=  FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
         load_flags &= ~FT_LOAD_RENDER;
   Exit:
     return error;
   }
+
+
+/* END */
index 1236156..fa67c10 100644 (file)
@@ -1,9 +1,28 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afloader.h                                                             */
+/*                                                                         */
+/*    Auto-fitter glyph loading routines (specification).                  */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #ifndef __AF_LOADER_H__
 #define __AF_LOADER_H__
 
 #include "afhints.h"
 #include "afglobal.h"
 
+
 FT_BEGIN_HEADER
 
   typedef struct AF_LoaderRec_
@@ -45,6 +64,10 @@ FT_BEGIN_HEADER
 
 /* */
 
+
 FT_END_HEADER
 
 #endif /* __AF_LOADER_H__ */
+
+
+/* END */
index e22ffff..ee6bc1a 100644 (file)
@@ -1,7 +1,27 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afmodule.c                                                             */
+/*                                                                         */
+/*    Auto-fitter module implementation (body).                            */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "afmodule.h"
 #include "afloader.h"
+
 #include FT_INTERNAL_OBJECTS_H
 
+
   typedef struct  FT_AutofitterRec_
   {
     FT_ModuleRec  root;
   }
 
 
-
   FT_CALLBACK_TABLE_DEF
   const FT_AutoHinter_ServiceRec  af_autofitter_service =
   {
     NULL,
     NULL,
     NULL,
-    (FT_AutoHinter_GlyphLoadFunc) af_autofitter_load_glyph
+    (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph
   };
 
 
     0x10000L,   /* version 1.0 of the autofitter  */
     0x20000L,   /* requires FreeType 2.0 or above */
 
-    (const void*) &af_autofitter_service,
+    (const void*)&af_autofitter_service,
 
-    (FT_Module_Constructor) af_autofitter_init,
-    (FT_Module_Destructor)  af_autofitter_done,
-    (FT_Module_Requester)   0
+    (FT_Module_Constructor)af_autofitter_init,
+    (FT_Module_Destructor) af_autofitter_done,
+    (FT_Module_Requester)  NULL
   };
 
 
index b898cb3..36268a0 100644 (file)
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afmodule.h                                                             */
+/*                                                                         */
+/*    Auto-fitter module implementation (specification).                   */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #ifndef __AFMODULE_H__
 #define __AFMODULE_H__
 
@@ -14,3 +32,6 @@ FT_BEGIN_HEADER
 FT_END_HEADER
 
 #endif /* __AFMODULE_H__ */
+
+
+/* END */
index 5d0371f..c9323e7 100644 (file)
@@ -1,61 +1,82 @@
+/***************************************************************************/
+/*                                                                         */
+/*  aftypes.h                                                              */
+/*                                                                         */
+/*    Auto-fitter types (specification only).                              */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 /***************************************************************************
- *
- *  FreeType auto-fitter
- *
- *  (c) 2004 David Turner
  *
  *  The auto-fitter is a complete rewrite of the old auto-hinter.
- *  its main feature is the ability to differentiate between different
+ *  Its main feature is the ability to differentiate between different
  *  scripts in order to apply language-specific rules.
  *
- *  the code has also been compartimentized into several entities that
+ *  The code has also been compartimentized 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
+ *  Finally, we get rid of the Catharon license, since this code is
  *  released under the FreeType one.
- */
+ *
+ ***************************************************************************/
+
+
 #ifndef __AFTYPES_H__
 #define __AFTYPES_H__
 
 #include <ft2build.h>
+
 #include FT_FREETYPE_H
 #include FT_OUTLINE_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 
+
 FT_BEGIN_HEADER
 
/**************************************************************************/
/**************************************************************************/
/*****                                                                *****/
/*****                D E B U G G I N G                               *****/
/*****                                                                *****/
/**************************************************************************/
/**************************************************************************/
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****                    D E B U G G I N G                          *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
 
 #define xxAF_DEBUG
 
 #ifdef AF_DEBUG
 
-#  include <stdio.h>
-#  define AF_LOG( x )  printf x
+#include <stdio.h>
+
+#define AF_LOG( x )  printf x
 
 #else
 
-#  define AF_LOG( x )  do ; while ( 0 ) /* nothing */
+#define AF_LOG( x )  do ; while ( 0 )        /* nothing */
 
 #endif /* AF_DEBUG */
 
- /**************************************************************************/
- /**************************************************************************/
- /*****                                                                *****/
- /*****                U T I L I T Y                                   *****/
- /*****                                                                *****/
- /**************************************************************************/
- /**************************************************************************/
 
-  typedef struct AF_WidthRec_
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                 U T I L I T Y   S T U F F                     *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  typedef struct  AF_WidthRec_
   {
     FT_Pos  org;  /* original position/width in font units              */
     FT_Pos  cur;  /* current/scaled position/width in device sub-pixels */
@@ -65,99 +86,97 @@ FT_BEGIN_HEADER
 
 
   FT_LOCAL( void )
-  af_sort_pos( FT_UInt   count,
-               FT_Pos*   table );
+  af_sort_pos( FT_UInt  count,
+               FT_Pos*  table );
 
   FT_LOCAL( void )
   af_sort_widths( FT_UInt   count,
                   AF_Width  widths );
 
 
/**************************************************************************/
/**************************************************************************/
/*****                                                                *****/
/*****                A N G L E   T Y P E S                           *****/
/*****                                                                *****/
/**************************************************************************/
/**************************************************************************/
-
- /*
-  *  Angle type. The auto-fitter doesn't need a very high angular accuracy,
-  *  and this allows us to speed up some computations considerably with a
-  *  light Cordic algorithm (see afangles.c)
-  *
-  */
-
-  typedef FT_Int    AF_Angle;
-
-#define  AF_ANGLE_PI     256
-#define  AF_ANGLE_2PI    (AF_ANGLE_PI*2)
-#define  AF_ANGLE_PI2    (AF_ANGLE_PI/2)
-#define  AF_ANGLE_PI4    (AF_ANGLE_PI/4)
-
- /*
-  *  compute the angle of a given 2-D vector
-  *
-  */
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****                   A N G L E   T Y P E S                       *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
+
 /*
+   *  The auto-fitter doesn't need a very high angular accuracy;
+   *  this allows us to speed up some computations considerably with a
+   *  light Cordic algorithm (see afangles.c).
+   */
+
+  typedef FT_Int  AF_Angle;
+
+
+#define AF_ANGLE_PI   256
+#define AF_ANGLE_2PI  ( AF_ANGLE_PI * 2 )
+#define AF_ANGLE_PI2  ( AF_ANGLE_PI / 2 )
+#define AF_ANGLE_PI4  ( AF_ANGLE_PI / 4 )
+
+
+  /*
+   *  compute the angle of a given 2-D vector
+   */
   FT_LOCAL( AF_Angle )
   af_angle_atan( FT_Pos  dx,
                  FT_Pos  dy );
 
 
- /*
-  *  computes "angle2 - angle1", the result is always within
-  *  the range [ -AF_ANGLE_PI .. AF_ANGLE_PI-1 ]
-  *
-  */
+  /*
+   *  compute `angle2 - angle1'; the result is always within
+   *  the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]
+   */
   FT_LOCAL( AF_Angle )
   af_angle_diff( AF_Angle  angle1,
                  AF_Angle  angle2 );
 
 
/**************************************************************************/
/**************************************************************************/
/*****                                                                *****/
/*****                O U T L I N E S                                 *****/
/*****                                                                *****/
/**************************************************************************/
/**************************************************************************/
-
/* opaque handle to glyph-specific hints. see "afhints.h" for more
-  * details
-  */
-  typedef struct AF_GlyphHintsRec_*     AF_GlyphHints;
-
/* this structure is used to model an input glyph outline to
-  * the auto-hinter. The latter will set the "hints" field
-  * depending on the glyph's script
-  */
-  typedef struct AF_OutlineRec_
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****                    O U T L I N E S                            *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
+
 /*  opaque handle to glyph-specific hints -- see `afhints.h' for more
+   *  details
+   */
+  typedef struct AF_GlyphHintsRec_*  AF_GlyphHints;
+
 /*  This structure is used to model an input glyph outline to
+   *  the auto-hinter.  The latter will set the `hints' field
+   *  depending on the glyph's script.
+   */
+  typedef struct  AF_OutlineRec_
   {
-    FT_Face          face;
-    FT_Outline       outline;
-    FT_UInt          outline_resolution;
+    FT_Face        face;
+    FT_Outline     outline;
+    FT_UInt        outline_resolution;
 
-    FT_Int           advance;
-    FT_UInt          metrics_resolution;
+    FT_Int         advance;
+    FT_UInt        metrics_resolution;
 
-    AF_GlyphHints    hints;
+    AF_GlyphHints  hints;
 
   } AF_OutlineRec;
 
 
/**************************************************************************/
/**************************************************************************/
/*****                                                                *****/
/*****                S C A L E R S                                   *****/
/*****                                                                *****/
/**************************************************************************/
/**************************************************************************/
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****                       S C A L E R S                           *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
 
- /*
-  *  A scaler models the target pixel device that will receive the
-  *  auto-hinted glyph image
-  *
-  */
+  /*
+   *  A scaler models the target pixel device that will receive the
+   *  auto-hinted glyph image.
+   */
 
   typedef enum
   {
@@ -168,109 +187,116 @@ FT_BEGIN_HEADER
   } AF_ScalerFlags;
 
 
-  typedef struct AF_ScalerRec_
+  typedef struct  AF_ScalerRec_
   {
-    FT_Face         face;         /* source font face                        */
-    FT_Fixed        x_scale;      /* from font units to 1/64th device pixels */
-    FT_Fixed        y_scale;      /* from font units to 1/64th device pixels */
-    FT_Pos          x_delta;      /* in 1/64th device pixels                 */
-    FT_Pos          y_delta;      /* in 1/64th device pixels                 */
-    FT_Render_Mode  render_mode;  /* monochrome, anti-aliased, LCD, etc..    */
-    FT_UInt32       flags;        /* additionnal control flags, see above    */
+    FT_Face         face;        /* source font face                        */
+    FT_Fixed        x_scale;     /* from font units to 1/64th device pixels */
+    FT_Fixed        y_scale;     /* from font units to 1/64th device pixels */
+    FT_Pos          x_delta;     /* in 1/64th device pixels                 */
+    FT_Pos          y_delta;     /* in 1/64th device pixels                 */
+    FT_Render_Mode  render_mode; /* monochrome, anti-aliased, LCD, etc.     */
+    FT_UInt32       flags;       /* additional control flags, see above     */
 
   } AF_ScalerRec, *AF_Scaler;
 
 
-#define  AF_SCALER_EQUAL_SCALES(a,b)    \
-   ( (a)->x_scale == (b)->x_scale &&    \
-     (a)->y_scale == (b)->y_scale &&    \
-     (a)->x_delta == (b)->x_delta &&    \
-     (a)->y_delta == (b)->y_delta )
-
-
- /**************************************************************************/
- /**************************************************************************/
- /*****                                                                *****/
- /*****                S C R I P T S                                   *****/
- /*****                                                                *****/
- /**************************************************************************/
- /**************************************************************************/
-
- /*
-  *  the list of know scripts. Each different script correspond to the
-  *  following information:
-  *
-  *   - a set of Unicode ranges to test weither the face supports the
-  *     script
-  *
-  *   - a specific global analyzer that will compute global metrics
-  *     specific to the script.
-  *
-  *   - a specific glyph analyzer that will compute 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
-  */
+#define AF_SCALER_EQUAL_SCALES( a, b )      \
+          ( (a)->x_scale == (b)->x_scale && \
+            (a)->y_scale == (b)->y_scale && \
+            (a)->x_delta == (b)->x_delta && \
+            (a)->y_delta == (b)->y_delta )
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                       S C R I P T S                           *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /*
+   *  The list of know scripts.  Each different script corresponds to the
+   *  following information:
+   *
+   *   - A set of Unicode ranges to test whether the face supports the
+   *     script.
+   *
+   *   - A specific global analyzer that will compute global metrics
+   *     specific to the script.
+   *
+   *   - A specific glyph analyzer that will compute 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.
+   */
+
   typedef enum
   {
     AF_SCRIPT_NONE  = 0,
     AF_SCRIPT_LATIN = 1,
-    /* add new scripts here. don't forget to update the list in "afglobal.c" */
+    /* add new scripts here.  Don't forget to update the list in */
+    /* `afglobal.c'.                                             */
 
     AF_SCRIPT_MAX   /* do not remove */
 
   } AF_Script;
 
 
-
   typedef struct AF_ScriptClassRec_ const*  AF_ScriptClass;
 
-  typedef struct AF_ScriptMetricsRec_
+  typedef struct  AF_ScriptMetricsRec_
   {
-    AF_ScriptClass    clazz;
-    AF_ScalerRec      scaler;
+    AF_ScriptClass  clazz;
+    AF_ScalerRec    scaler;
 
   } AF_ScriptMetricsRec, *AF_ScriptMetrics;
 
 
- /* this function parses a FT_Face to compute global metrics for
-  * a specific script
-  */
-  typedef FT_Error  (*AF_Script_InitMetricsFunc)( AF_ScriptMetrics   metrics,
-                                                  FT_Face            face );
+  /*  This function parses an FT_Face to compute global metrics for
+   *  a specific script.
+   */
+  typedef FT_Error
+  (*AF_Script_InitMetricsFunc)( AF_ScriptMetrics  metrics,
+                                FT_Face           face );
 
-  typedef void      (*AF_Script_ScaleMetricsFunc)( AF_ScriptMetrics  metrics,
-                                                   AF_Scaler         scaler );
+  typedef void
+  (*AF_Script_ScaleMetricsFunc)( AF_ScriptMetrics  metrics,
+                                 AF_Scaler         scaler );
 
-  typedef void      (*AF_Script_DoneMetricsFunc)( AF_ScriptMetrics   metrics );
+  typedef void
+  (*AF_Script_DoneMetricsFunc)( AF_ScriptMetrics  metrics );
 
 
-  typedef FT_Error  (*AF_Script_InitHintsFunc)( AF_GlyphHints     hints,
-                                                AF_ScriptMetrics  metrics );
+  typedef FT_Error
+  (*AF_Script_InitHintsFunc)( AF_GlyphHints     hints,
+                              AF_ScriptMetrics  metrics );
 
-  typedef void      (*AF_Script_ApplyHintsFunc)( AF_GlyphHints     hints,
-                                                 FT_Outline*       outline,
-                                                 AF_ScriptMetrics  metrics );
+  typedef void
+  (*AF_Script_ApplyHintsFunc)( AF_GlyphHints     hints,
+                               FT_Outline*       outline,
+                               AF_ScriptMetrics  metrics );
 
 
-  typedef struct AF_Script_UniRangeRec_
+  typedef struct  AF_Script_UniRangeRec_
   {
-    FT_UInt32    first;
-    FT_UInt32    last;
+    FT_UInt32  first;
+    FT_UInt32  last;
 
   } AF_Script_UniRangeRec;
 
-  typedef const AF_Script_UniRangeRec *  AF_Script_UniRange;
+  typedef const AF_Script_UniRangeRec  *AF_Script_UniRange;
+
 
-  typedef struct AF_ScriptClassRec_
+  typedef struct  AF_ScriptClassRec_
   {
     AF_Script                   script;
-    AF_Script_UniRange          script_uni_ranges;  /* last must be { 0, 0 } */
+    AF_Script_UniRange          script_uni_ranges; /* last must be { 0, 0 } */
 
     FT_UInt                     script_metrics_size;
     AF_Script_InitMetricsFunc   script_metrics_init;
@@ -288,3 +314,6 @@ FT_BEGIN_HEADER
 FT_END_HEADER
 
 #endif /* __AFTYPES_H__ */
+
+
+/* END */
index c258e0d..2d58682 100644 (file)
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/*                                                                         */
+/*  autofit.c                                                              */
+/*                                                                         */
+/*    Auto-fitter module (body).                                           */
+/*                                                                         */
+/*  Copyright 2003, 2004, 2005 by                                          */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #define FT_MAKE_OPTION_SINGLE_OBJECT
 #include <ft2build.h>
 #include "afangles.c"
@@ -7,3 +25,6 @@
 #include "aflatin.c"
 #include "afloader.c"
 #include "afmodule.c"
+
+
+/* END */
diff --git a/reactos/lib/freetype/src/autofit/module.mk b/reactos/lib/freetype/src/autofit/module.mk
new file mode 100644 (file)
index 0000000..0d3cfd9
--- /dev/null
@@ -0,0 +1,22 @@
+#\r
+# FreeType 2 auto-fitter module definition\r
+#\r
+\r
+\r
+# Copyright 2003, 2004, 2005 by\r
+# David Turner, Robert Wilhelm, and Werner Lemberg.\r
+#\r
+# This file is part of the FreeType project, and may only be used, modified,\r
+# and distributed under the terms of the FreeType project license,\r
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\r
+# indicate that you have read the license and understand and accept it\r
+# fully.\r
+\r
+\r
+make_module_list: add_autofit_module\r
+\r
+add_autofit_module:\r
+       $(OPEN_DRIVER)autofit_module_class$(CLOSE_DRIVER)\r
+       $(ECHO_DRIVER)autofit  $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)\r
+\r
+# EOF\r
diff --git a/reactos/lib/freetype/src/autofit/rules.mk b/reactos/lib/freetype/src/autofit/rules.mk
new file mode 100644 (file)
index 0000000..0de220d
--- /dev/null
@@ -0,0 +1,75 @@
+#\r
+# FreeType 2 auto-fitter module configuration rules\r
+#\r
+\r
+\r
+# Copyright 2003, 2004, 2005 by\r
+# David Turner, Robert Wilhelm, and Werner Lemberg.\r
+#\r
+# This file is part of the FreeType project, and may only be used, modified,\r
+# and distributed under the terms of the FreeType project license,\r
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\r
+# indicate that you have read the license and understand and accept it\r
+# fully.\r
+\r
+\r
+# AUTOF driver directory\r
+#\r
+AUTOF_DIR := $(SRC_DIR)/autofit\r
+\r
+\r
+# compilation flags for the driver\r
+#\r
+AUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR))\r
+\r
+\r
+# AUTOF driver sources (i.e., C files)\r
+#\r
+AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \\r
+                 $(AUTOF_DIR)/afdummy.c  \\r
+                 $(AUTOF_DIR)/afglobal.c \\r
+                 $(AUTOF_DIR)/afhints.c  \\r
+                 $(AUTOF_DIR)/aflatin.c  \\r
+                 $(AUTOF_DIR)/afloader.c \\r
+                 $(AUTOF_DIR)/afmodule.c\r
+\r
+# AUTOF driver headers\r
+#\r
+AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h)  \\r
+               $(AUTOF_DIR)/aftypes.h  \\r
+               $(AUTOF_DIR)/aferrors.h\r
+\r
+\r
+# AUTOF driver object(s)\r
+#\r
+#   AUTOF_DRV_OBJ_M is used during `multi' builds.\r
+#   AUTOF_DRV_OBJ_S is used during `single' builds.\r
+#\r
+AUTOF_DRV_OBJ_M := $(AUTOF_DRV_SRC:$(AUTOF_DIR)/%.c=$(OBJ_DIR)/%.$O)\r
+AUTOF_DRV_OBJ_S := $(OBJ_DIR)/autofit.$O\r
+\r
+# AUTOF driver source file for single build\r
+#\r
+AUTOF_DRV_SRC_S := $(AUTOF_DIR)/autofit.c\r
+\r
+\r
+# AUTOF driver - single object\r
+#\r
+$(AUTOF_DRV_OBJ_S): $(AUTOF_DRV_SRC_S) $(AUTOF_DRV_SRC) \\r
+                   $(FREETYPE_H) $(AUTOF_DRV_H)\r
+       $(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(AUTOF_DRV_SRC_S))\r
+\r
+\r
+# AUTOF driver - multiple objects\r
+#\r
+$(OBJ_DIR)/%.$O: $(AUTOF_DIR)/%.c $(FREETYPE_H) $(AUTOF_DRV_H)\r
+       $(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\r
+\r
+\r
+# update main driver object lists\r
+#\r
+DRV_OBJS_S += $(AUTOF_DRV_OBJ_S)\r
+DRV_OBJS_M += $(AUTOF_DRV_OBJ_M)\r
+\r
+\r
+# EOF\r
diff --git a/reactos/lib/freetype/src/autohint/CatharonLicense.txt b/reactos/lib/freetype/src/autohint/CatharonLicense.txt
deleted file mode 100644 (file)
index 789c8c9..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-                  The Catharon Open Source LICENSE
-                    ----------------------------
-
-                            2000-Jul-04
-
-          Copyright (C) 2000 by Catharon Productions, Inc.
-
-
-
-Introduction
-============
-
-  This  license  applies to  source  files  distributed by  Catharon
-  Productions,  Inc.  in  several  archive packages.   This  license
-  applies  to all files  found in  such packages  which do  not fall
-  under their own explicit license.
-
-  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 are
-      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
-      Catharon 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 packages  distributed by
-  Catharon  Productions, Inc.  and  assume no  liability related  to
-  their use.
-
-
-Legal Terms
-===========
-
-0. Definitions
---------------
-
-  Throughout this license,  the terms `Catharon Package', `package',
-  and  `Catharon  Code'  refer   to  the  set  of  files  originally
-  distributed by Catharon Productions, Inc.
-
-  `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  one of  the
-  Catharon Packages'.
-
-  This  license applies  to all  files distributed  in  the original
-  Catharon  Package(s),  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  Catharon   Packages  are  copyright  (C)   2000  by  Catharon
-  Productions, Inc.  All rights reserved except as specified below.
-
-1. No Warranty
---------------
-
-  THE CATHARON PACKAGES ARE 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 OF OR THE INABILITY TO
-  USE THE CATHARON PACKAGE.
-
-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  Catharon Packages (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
-      (`license.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 on  the  work of
-      Catharon Productions, Inc. in the distribution documentation.
-
-  These conditions  apply to any  software derived from or  based on
-  the Catharon Packages, 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 Catharon Productions, Inc.  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 the following phrase
-  to refer to this software in your documentation: 'this software is
-  based in part on the Catharon Typography Project'.
-
-  As  you have  not signed  this license,  you are  not  required to
-  accept  it.  However,  as  the Catharon  Packages are  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  Catharon
-  Packages,  you indicate  that you  understand and  accept  all the
-  terms of this license.
-
---- end of license.txt ---
diff --git a/reactos/lib/freetype/src/autohint/Jamfile b/reactos/lib/freetype/src/autohint/Jamfile
deleted file mode 100644 (file)
index a129e5e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# FreeType 2 src/autohint Jamfile (c) 2001 David Turner
-#
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) autohint ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = ahangles ahglobal ahglyph ahhint ahmodule ;
-  }
-  else
-  {
-    _sources = autohint ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/autohint Jamfile
diff --git a/reactos/lib/freetype/src/autohint/ahangles.c b/reactos/lib/freetype/src/autohint/ahangles.c
deleted file mode 100644 (file)
index ef5a88e..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahangles.h                                                             */
-/*                                                                         */
-/*    A routine used to compute vector angles with limited accuracy        */
-/*    and very high speed (body).                                          */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002 Catharon Productions Inc.                    */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include "ahangles.h"
-
-
-  /* the following table has been automatically generated with */
-  /* the `mather.py' Python script                             */
-
-  const AH_Angle  ah_arctan[1L << AH_ATAN_BITS] =
-  {
-     0,  0,  1,  1,  1,  2,  2,  2,
-     3,  3,  3,  3,  4,  4,  4,  5,
-     5,  5,  6,  6,  6,  7,  7,  7,
-     8,  8,  8,  9,  9,  9, 10, 10,
-    10, 10, 11, 11, 11, 12, 12, 12,
-    13, 13, 13, 14, 14, 14, 14, 15,
-    15, 15, 16, 16, 16, 17, 17, 17,
-    18, 18, 18, 18, 19, 19, 19, 20,
-    20, 20, 21, 21, 21, 21, 22, 22,
-    22, 23, 23, 23, 24, 24, 24, 24,
-    25, 25, 25, 26, 26, 26, 26, 27,
-    27, 27, 28, 28, 28, 28, 29, 29,
-    29, 30, 30, 30, 30, 31, 31, 31,
-    31, 32, 32, 32, 33, 33, 33, 33,
-    34, 34, 34, 34, 35, 35, 35, 35,
-    36, 36, 36, 36, 37, 37, 37, 38,
-    38, 38, 38, 39, 39, 39, 39, 40,
-    40, 40, 40, 41, 41, 41, 41, 42,
-    42, 42, 42, 42, 43, 43, 43, 43,
-    44, 44, 44, 44, 45, 45, 45, 45,
-    46, 46, 46, 46, 46, 47, 47, 47,
-    47, 48, 48, 48, 48, 48, 49, 49,
-    49, 49, 50, 50, 50, 50, 50, 51,
-    51, 51, 51, 51, 52, 52, 52, 52,
-    52, 53, 53, 53, 53, 53, 54, 54,
-    54, 54, 54, 55, 55, 55, 55, 55,
-    56, 56, 56, 56, 56, 57, 57, 57,
-    57, 57, 57, 58, 58, 58, 58, 58,
-    59, 59, 59, 59, 59, 59, 60, 60,
-    60, 60, 60, 61, 61, 61, 61, 61,
-    61, 62, 62, 62, 62, 62, 62, 63,
-    63, 63, 63, 63, 63, 64, 64, 64
-  };
-
-
-  FT_LOCAL_DEF( AH_Angle )
-  ah_angle( FT_Vector*  v )
-  {
-    FT_Pos    dx, dy;
-    AH_Angle  angle;
-
-
-    dx = v->x;
-    dy = v->y;
-
-    /* check trivial cases */
-    if ( dy == 0 )
-    {
-      angle = 0;
-      if ( dx < 0 )
-        angle = AH_PI;
-      return angle;
-    }
-    else if ( dx == 0 )
-    {
-      angle = AH_HALF_PI;
-      if ( dy < 0 )
-        angle = -AH_HALF_PI;
-      return angle;
-    }
-
-    angle = 0;
-    if ( dx < 0 )
-    {
-      dx = -v->x;
-      dy = -v->y;
-      angle = AH_PI;
-    }
-
-    if ( dy < 0 )
-    {
-      FT_Pos  tmp;
-
-
-      tmp = dx;
-      dx  = -dy;
-      dy  = tmp;
-      angle -= AH_HALF_PI;
-    }
-
-    if ( dx == 0 && dy == 0 )
-      return 0;
-
-    if ( dx == dy )
-      angle += AH_PI / 4;
-    else if ( dx > dy )
-      angle += ah_arctan[FT_DivFix( dy, dx ) >> ( 16 - AH_ATAN_BITS )];
-    else
-      angle += AH_HALF_PI -
-               ah_arctan[FT_DivFix( dx, dy ) >> ( 16 - AH_ATAN_BITS )];
-
-    if ( angle > AH_PI )
-      angle -= AH_2PI;
-
-    return angle;
-  }
-
-
-  FT_LOCAL_DEF( AH_Angle )
-  ah_angle_diff( AH_Angle  angle1,
-                 AH_Angle  angle2 )
-  {
-    AH_Angle  delta;
-    
-
-    delta = ( angle2 - angle1 );
-    if ( delta < 0 )
-      delta += AH_2PI;
-    
-    if ( delta > AH_PI )
-      delta -= AH_2PI;
-    
-    return delta;
-  }                 
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahangles.h b/reactos/lib/freetype/src/autohint/ahangles.h
deleted file mode 100644 (file)
index f46bfaa..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahangles.h                                                             */
-/*                                                                         */
-/*    A routine used to compute vector angles with limited accuracy        */
-/*    and very high speed (specification).                                 */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002 Catharon Productions Inc.                    */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __AHANGLES_H__
-#define __AHANGLES_H__
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_OBJECTS_H
-#include "ahtypes.h"
-
-
-FT_BEGIN_HEADER
-
-
-  /* PI expressed in ah_angles -- we don't really need an important */
-  /* precision, so 256 should be enough                             */
-#define AH_PI       256
-#define AH_2PI      ( AH_PI * 2 )
-#define AH_HALF_PI  ( AH_PI / 2 )
-#define AH_2PIMASK  ( AH_2PI - 1 )
-
-  /* the number of bits used to express an arc tangent; */
-  /* see the structure of the lookup table              */
-#define AH_ATAN_BITS  8
-
-  extern
-  const AH_Angle  ah_arctan[1L << AH_ATAN_BITS];
-
-
-  FT_LOCAL( AH_Angle )
-  ah_angle( FT_Vector*  v );
-
-
-  FT_LOCAL( AH_Angle )
-  ah_angle_diff( AH_Angle  angle1,
-                 AH_Angle  angle2 );
-
-
-FT_END_HEADER
-
-#endif /* __AHANGLES_H__ */
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahglobal.c b/reactos/lib/freetype/src/autohint/ahglobal.c
deleted file mode 100644 (file)
index e157014..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahglobal.c                                                             */
-/*                                                                         */
-/*    Routines used to compute global metrics automatically (body).        */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc.        */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_DEBUG_H
-#include "ahglobal.h"
-#include "ahglyph.h"
-
-
-#define MAX_TEST_CHARACTERS  12
-
-  /* cf. AH_BLUE_XXX constants in ahtypes.h */
-
-  static
-  const char* const  blue_chars[AH_BLUE_MAX] =
-  {
-    "THEZOCQS",
-    "HEZLOCUS",
-#ifdef FT_CONFIG_CHESTER_SMALL_F
-    "fijkdbh",
-#endif
-    "xzroesc",
-    "xzroesc",
-    "pqgjy"
-  };
-
-
-  /* simple insertion sort */
-  static void
-  sort_values( FT_Int   count,
-               FT_Pos*  table )
-  {
-    FT_Int  i, j;
-    FT_Pos  swap;
-
-
-    for ( i = 1; i < count; i++ )
-    {
-      for ( j = i; j > 0; j-- )
-      {
-        if ( table[j] > table[j - 1] )
-          break;
-
-        swap         = table[j];
-        table[j]     = table[j - 1];
-        table[j - 1] = swap;
-      }
-    }
-  }
-
-
-  static FT_Error
-  ah_hinter_compute_blues( AH_Hinter  hinter )
-  {
-    AH_Blue       blue;
-    AH_Globals    globals = &hinter->globals->design;
-    FT_Pos        flats [MAX_TEST_CHARACTERS];
-    FT_Pos        rounds[MAX_TEST_CHARACTERS];
-    FT_Int        num_flats;
-    FT_Int        num_rounds;
-
-    FT_Face       face;
-    FT_GlyphSlot  glyph;
-    FT_Error      error;
-    FT_CharMap    charmap;
-
-
-    face  = hinter->face;
-    glyph = face->glyph;
-
-    /* save current charmap */
-    charmap = face->charmap;
-
-    /* do we have a Unicode charmap in there? */
-    error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
-    if ( error )
-      goto Exit;
-
-    /* we compute the blues simply by loading each character from the */
-    /* `blue_chars[blues]' string, then compute its top-most or       */
-    /* bottom-most points (depending on `AH_IS_TOP_BLUE')             */
-
-    AH_LOG(( "blue zones computation\n" ));
-    AH_LOG(( "------------------------------------------------\n" ));
-
-    for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ )
-    {
-      const char*  p     = blue_chars[blue];
-      const char*  limit = p + MAX_TEST_CHARACTERS;
-
-      FT_Pos       *blue_ref, *blue_shoot;
-
-
-      AH_LOG(( "blue %3d: ", blue ));
-
-      num_flats  = 0;
-      num_rounds = 0;
-
-      for ( ; p < limit; p++ )
-      {
-        FT_UInt     glyph_index;
-        FT_Vector*  extremum;
-        FT_Vector*  points;
-        FT_Vector*  point_limit;
-        FT_Vector*  point;
-        FT_Bool     round;
-
-
-        /* exit if we reach the end of the string */
-        if ( !*p )
-          break;
-
-        AH_LOG(( "`%c'", *p ));
-
-        /* load the character in the face -- skip unknown or empty ones */
-        glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );
-        if ( glyph_index == 0 )
-          continue;
-
-        error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
-        if ( error || glyph->outline.n_points <= 0 )
-          continue;
-
-        /* now compute min or max point indices and coordinates */
-        points      = glyph->outline.points;
-        point_limit = points + glyph->outline.n_points;
-        point       = points;
-        extremum    = point;
-        point++;
-
-        if ( AH_IS_TOP_BLUE( blue ) )
-        {
-          for ( ; point < point_limit; point++ )
-            if ( point->y > extremum->y )
-              extremum = point;
-        }
-        else
-        {
-          for ( ; point < point_limit; point++ )
-            if ( point->y < extremum->y )
-              extremum = point;
-        }
-
-        AH_LOG(( "%5d", (int)extremum->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 see its previous and next points                  */
-        {
-          FT_Int  idx = (FT_Int)( extremum - points );
-          FT_Int  n;
-          FT_Int  first, last, prev, next, end;
-          FT_Pos  dist;
-
-
-          last  = -1;
-          first = 0;
-
-          for ( n = 0; n < glyph->outline.n_contours; n++ )
-          {
-            end = glyph->outline.contours[n];
-            if ( end >= idx )
-            {
-              last = end;
-              break;
-            }
-            first = end + 1;
-          }
-
-          /* XXX: should never happen! */
-          if ( last < 0 )
-            continue;
-
-          /* now look for the previous and next points that are not on the */
-          /* same Y coordinate.  Threshold the `closeness'...              */
-
-          prev = idx;
-          next = prev;
-
-          do
-          {
-            if ( prev > first )
-              prev--;
-            else
-              prev = last;
-
-            dist = points[prev].y - extremum->y;
-            if ( dist < -5 || dist > 5 )
-              break;
-
-          } while ( prev != idx );
-
-          do
-          {
-            if ( next < last )
-              next++;
-            else
-              next = first;
-
-            dist = points[next].y - extremum->y;
-            if ( dist < -5 || dist > 5 )
-              break;
-
-          } while ( next != idx );
-
-          /* 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 );
-
-          AH_LOG(( "%c ", round ? 'r' : 'f' ));
-        }
-
-        if ( round )
-          rounds[num_rounds++] = extremum->y;
-        else
-          flats[num_flats++] = extremum->y;
-      }
-
-      AH_LOG(( "\n" ));
-
-      /* we have computed the contents of the `rounds' and `flats' tables, */
-      /* now determine the reference and overshoot position of the blue -- */
-      /* we simply take the median value after a simple sort               */
-      sort_values( num_rounds, rounds );
-      sort_values( num_flats,  flats  );
-
-      blue_ref   = globals->blue_refs + blue;
-      blue_shoot = globals->blue_shoots + blue;
-      if ( num_flats == 0 && num_rounds == 0 )
-      {
-        *blue_ref   = -10000;
-        *blue_shoot = -10000;
-      }
-      else if ( num_flats == 0 )
-      {
-        *blue_ref   =
-        *blue_shoot = rounds[num_rounds / 2];
-      }
-      else if ( num_rounds == 0 )
-      {
-        *blue_ref   =
-        *blue_shoot = flats[num_flats / 2];
-      }
-      else
-      {
-        *blue_ref   = flats[num_flats / 2];
-        *blue_shoot = rounds[num_rounds / 2];
-      }
-
-      /* there are sometimes problems: if the overshoot position of top     */
-      /* zones is under its reference position, or the opposite for bottom  */
-      /* zones.  We must thus check everything there and correct the errors */
-      if ( *blue_shoot != *blue_ref )
-      {
-        FT_Pos   ref      = *blue_ref;
-        FT_Pos   shoot    = *blue_shoot;
-        FT_Bool  over_ref = FT_BOOL( shoot > ref );
-
-
-        if ( AH_IS_TOP_BLUE( blue ) ^ over_ref )
-          *blue_shoot = *blue_ref = ( shoot + ref ) / 2;
-      }
-
-      AH_LOG(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot ));
-    }
-
-    /* reset original face charmap */
-    FT_Set_Charmap( face, charmap );
-    error = 0;
-
-  Exit:
-    return error;
-  }
-
-
-  static FT_Error
-  ah_hinter_compute_widths( AH_Hinter  hinter )
-  {
-    /* scan the array of segments in each direction */
-    AH_Outline  outline = hinter->glyph;
-    AH_Segment  segments;
-    AH_Segment  limit;
-    AH_Globals  globals = &hinter->globals->design;
-    FT_Pos*     widths;
-    FT_Int      dimension;
-    FT_Int*     p_num_widths;
-    FT_Error    error = 0;
-    FT_Pos      edge_distance_threshold = 32000;
-
-
-    globals->num_widths  = 0;
-    globals->num_heights = 0;
-
-    /* For now, compute the standard width and height from the `o'       */
-    /* character.  I started computing the stem width of the `i' and the */
-    /* stem height of the "-", but it wasn't too good.  Moreover, we now */
-    /* have a single character that gives us standard width and height.  */
-    {
-      FT_UInt  glyph_index;
-
-
-      glyph_index = FT_Get_Char_Index( hinter->face, 'o' );
-      if ( glyph_index == 0 )
-        return 0;
-
-      error = FT_Load_Glyph( hinter->face, glyph_index, FT_LOAD_NO_SCALE );
-      if ( error )
-        goto Exit;
-
-      error = ah_outline_load( hinter->glyph, 0x10000L, 0x10000L,
-                               hinter->face );
-      if ( error )
-        goto Exit;
-
-      ah_outline_compute_segments( hinter->glyph );
-      ah_outline_link_segments( hinter->glyph );
-    }
-
-    segments     = outline->horz_segments;
-    limit        = segments + outline->num_hsegments;
-    widths       = globals->heights;
-    p_num_widths = &globals->num_heights;
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Segment  seg = segments;
-      AH_Segment  link;
-      FT_Int      num_widths = 0;
-
-
-      for ( ; seg < limit; seg++ )
-      {
-        link = seg->link;
-        /* we only consider stem segments there! */
-        if ( link && link->link == seg && link > seg )
-        {
-          FT_Pos  dist;
-
-
-          dist = seg->pos - link->pos;
-          if ( dist < 0 )
-            dist = -dist;
-
-          if ( num_widths < AH_MAX_WIDTHS )
-            widths[num_widths++] = dist;
-        }
-      }
-
-      sort_values( num_widths, widths );
-      *p_num_widths = num_widths;
-
-      /* we will now try to find the smallest width */
-      if ( num_widths > 0 && widths[0] < edge_distance_threshold )
-        edge_distance_threshold = widths[0];
-
-      segments     = outline->vert_segments;
-      limit        = segments + outline->num_vsegments;
-      widths       = globals->widths;
-      p_num_widths = &globals->num_widths;
-    }
-
-    /* Now, compute the edge distance threshold as a fraction of the */
-    /* smallest width in the font. Set it in `hinter->glyph' too!    */
-    if ( edge_distance_threshold == 32000 )
-      edge_distance_threshold = 50;
-
-    /* let's try 20% */
-    hinter->glyph->edge_distance_threshold = edge_distance_threshold / 5;
-
-  Exit:
-    return error;
-  }
-
-
-  FT_LOCAL_DEF( FT_Error )
-  ah_hinter_compute_globals( AH_Hinter  hinter )
-  {
-    return ah_hinter_compute_widths( hinter ) ||
-           ah_hinter_compute_blues ( hinter );
-  }
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahglobal.h b/reactos/lib/freetype/src/autohint/ahglobal.h
deleted file mode 100644 (file)
index 5a9bcf8..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahglobal.h                                                             */
-/*                                                                         */
-/*    Routines used to compute global metrics automatically                */
-/*    (specification).                                                     */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003 Catharon Productions Inc.              */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __AHGLOBAL_H__
-#define __AHGLOBAL_H__
-
-
-#include <ft2build.h>
-#include "ahtypes.h"
-#include FT_INTERNAL_OBJECTS_H
-
-
-FT_BEGIN_HEADER
-
-
-#ifdef  FT_CONFIG_CHESTER_SMALL_F
-
-#define AH_IS_TOP_BLUE( b )  ( (b) == AH_BLUE_CAPITAL_TOP || \
-                               (b) == AH_BLUE_SMALL_F_TOP || \
-                               (b) == AH_BLUE_SMALL_TOP   )
-
-#else /* !FT_CONFIG_CHESTER_SMALL_F */
-
-#define AH_IS_TOP_BLUE( b )  ( (b) == AH_BLUE_CAPITAL_TOP || \
-                               (b) == AH_BLUE_SMALL_TOP   )
-
-#endif /* !FT_CONFIG_CHESTER_SMALL_F */
-
-
-  /* compute global metrics automatically */
-  FT_LOCAL( FT_Error )
-  ah_hinter_compute_globals( AH_Hinter  hinter );
-
-
-FT_END_HEADER
-
-#endif /* __AHGLOBAL_H__ */
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahglyph.c b/reactos/lib/freetype/src/autohint/ahglyph.c
deleted file mode 100644 (file)
index 2a0390b..0000000
+++ /dev/null
@@ -1,1699 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahglyph.c                                                              */
-/*                                                                         */
-/*    Routines used to load and analyze a given glyph before hinting       */
-/*    (body).                                                              */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc.        */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include "ahglyph.h"
-#include "ahangles.h"
-#include "ahglobal.h"
-#include "aherrors.h"
-
-
-#ifdef AH_DEBUG
-
-#include <stdio.h>
-
-  void
-  ah_dump_edges( AH_Outline  outline )
-  {
-    AH_Edge     edges;
-    AH_Edge     edge_limit;
-    AH_Segment  segments;
-    FT_Int      dimension;
-
-
-    edges      = outline->horz_edges;
-    edge_limit = edges + outline->num_hedges;
-    segments   = outline->horz_segments;
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Edge   edge;
-
-
-      printf ( "Table of %s edges:\n",
-               !dimension ? "vertical" : "horizontal" );
-      printf ( "  [ index |  pos |  dir  | link |"
-               " serif | blue | opos  |  pos  ]\n" );
-
-      for ( edge = edges; edge < edge_limit; edge++ )
-      {
-        printf ( "  [ %5d | %4d | %5s | %4d | %5d |  %c  | %5.2f | %5.2f ]\n",
-                 edge - edges,
-                 (int)edge->fpos,
-                 edge->dir == AH_DIR_UP
-                   ? "up"
-                   : ( edge->dir == AH_DIR_DOWN
-                         ? "down"
-                         : ( edge->dir == AH_DIR_LEFT
-                               ? "left"
-                               : ( edge->dir == AH_DIR_RIGHT
-                                     ? "right"
-                                     : "none" ) ) ),
-                 edge->link ? ( edge->link - edges ) : -1,
-                 edge->serif ? ( edge->serif - edges ) : -1,
-                 edge->blue_edge ? 'y' : 'n',
-                 edge->opos / 64.0,
-                 edge->pos / 64.0 );
-      }
-
-      edges      = outline->vert_edges;
-      edge_limit = edges + outline->num_vedges;
-      segments   = outline->vert_segments;
-    }
-  }
-
-
-  /* A function used to dump the array of linked segments */
-  void
-  ah_dump_segments( AH_Outline  outline )
-  {
-    AH_Segment  segments;
-    AH_Segment  segment_limit;
-    AH_Point    points;
-    FT_Int      dimension;
-
-
-    points        = outline->points;
-    segments      = outline->horz_segments;
-    segment_limit = segments + outline->num_hsegments;
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Segment  seg;
-
-
-      printf ( "Table of %s segments:\n",
-               !dimension ? "vertical" : "horizontal" );
-      printf ( "  [ index |  pos |  dir  | link | serif |"
-               " numl | first | start ]\n" );
-
-      for ( seg = segments; seg < segment_limit; seg++ )
-      {
-        printf ( "  [ %5d | %4d | %5s | %4d | %5d | %4d | %5d | %5d ]\n",
-                 seg - segments,
-                 (int)seg->pos,
-                 seg->dir == AH_DIR_UP
-                   ? "up"
-                   : ( seg->dir == AH_DIR_DOWN
-                         ? "down"
-                         : ( seg->dir == AH_DIR_LEFT
-                               ? "left"
-                               : ( seg->dir == AH_DIR_RIGHT
-                                     ? "right"
-                                     : "none" ) ) ),
-                 seg->link ? ( seg->link - segments ) : -1,
-                 seg->serif ? ( seg->serif - segments ) : -1,
-                 (int)seg->num_linked,
-                 seg->first - points,
-                 seg->last - points );
-      }
-
-      segments      = outline->vert_segments;
-      segment_limit = segments + outline->num_vsegments;
-    }
-  }
-
-#endif /* AH_DEBUG */
-
-
-  /* compute the direction value of a given vector */
-  static AH_Direction
-  ah_compute_direction( FT_Pos  dx,
-                        FT_Pos  dy )
-  {
-    AH_Direction  dir;
-    FT_Pos        ax = FT_ABS( dx );
-    FT_Pos        ay = FT_ABS( dy );
-
-
-    dir = AH_DIR_NONE;
-
-    /* atan(1/12) == 4.7 degrees */
-
-    /* test for vertical direction */
-    if ( ax * 12 < ay )
-    {
-      dir = dy > 0 ? AH_DIR_UP : AH_DIR_DOWN;
-    }
-    /* test for horizontal direction */
-    else if ( ay * 12 < ax )
-    {
-      dir = dx > 0 ? AH_DIR_RIGHT : AH_DIR_LEFT;
-    }
-
-    return dir;
-  }
-
-
-  /* this function is used by ah_get_orientation (see below) to test */
-  /* the fill direction of given bbox extremum                       */
-  static FT_Int
-  ah_test_extremum( FT_Outline*  outline,
-                    FT_Int       n )
-  {
-    FT_Vector  *prev, *cur, *next;
-    FT_Pos      product;
-    FT_Int      first, last, c;
-    FT_Int      retval;
-
-
-    /* we need to compute the `previous' and `next' point */
-    /* for this extremum; we check whether the extremum   */
-    /* is start or end of a contour and providing         */
-    /* appropriate values if so                           */
-    cur  = outline->points + n;
-    prev = cur - 1;
-    next = cur + 1;
-
-    first = 0;
-    for ( c = 0; c < outline->n_contours; c++ )
-    {
-      last = outline->contours[c];
-
-      if ( n == first )
-        prev = outline->points + last;
-
-      if ( n == last )
-        next = outline->points + first;
-
-      first = last + 1;
-    }
-
-    /* compute the vectorial product -- since we know that the angle */
-    /* is <= 180 degrees (otherwise it wouldn't be an extremum) we   */
-    /* can determine the filling orientation if the product is       */
-    /* either positive or negative                                   */
-    product = FT_MulDiv( cur->x  - prev->x,  /* in.x  */
-                         next->y - cur->y,   /* out.y */
-                         0x40 )
-              -
-              FT_MulDiv( cur->y  - prev->y,  /* in.y  */
-                         next->x - cur->x,   /* out.x */
-                         0x40 );
-
-    retval = 0;
-    if ( product )
-      retval = product > 0 ? 2 : 1;
-
-    return retval;
-  }
-
-
-  /* Compute the orientation of path filling.  It differs between TrueType */
-  /* and Type1 formats.  We could use the `FT_OUTLINE_REVERSE_FILL' flag,  */
-  /* but it is better to re-compute it directly (it seems that this flag   */
-  /* isn't correctly set for some weird composite glyphs currently).       */
-  /*                                                                       */
-  /* We do this by computing bounding box points, and computing their      */
-  /* curvature.                                                            */
-  /*                                                                       */
-  /* The function returns either 1 or 2.                                   */
-  /*                                                                       */
-  static FT_Int
-  ah_get_orientation( FT_Outline*  outline )
-  {
-    FT_BBox  box;
-    FT_Int   indices_xMin, indices_yMin, indices_xMax, indices_yMax;
-    FT_Int   n, last;
-
-
-    indices_xMin = -1;
-    indices_yMin = -1;
-    indices_xMax = -1;
-    indices_yMax = -1;
-
-    box.xMin = box.yMin =  32767L;
-    box.xMax = box.yMax = -32768L;
-
-    /* is it empty? */
-    if ( outline->n_contours < 1 )
-      return 1;
-
-    last = outline->contours[outline->n_contours - 1];
-
-    for ( n = 0; n <= last; n++ )
-    {
-      FT_Pos  x, y;
-
-
-      x = outline->points[n].x;
-      if ( x < box.xMin )
-      {
-        box.xMin     = x;
-        indices_xMin = n;
-      }
-      if ( x > box.xMax )
-      {
-        box.xMax     = x;
-        indices_xMax = n;
-      }
-
-      y = outline->points[n].y;
-      if ( y < box.yMin )
-      {
-        box.yMin     = y;
-        indices_yMin = n;
-      }
-      if ( y > box.yMax )
-      {
-        box.yMax     = y;
-        indices_yMax = n;
-      }
-    }
-
-    /* test orientation of the extrema */
-    n = ah_test_extremum( outline, indices_xMin );
-    if ( n )
-      goto Exit;
-
-    n = ah_test_extremum( outline, indices_yMin );
-    if ( n )
-      goto Exit;
-
-    n = ah_test_extremum( outline, indices_xMax );
-    if ( n )
-      goto Exit;
-
-    n = ah_test_extremum( outline, indices_yMax );
-    if ( !n )
-      n = 1;
-
-  Exit:
-    return n;
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    ah_outline_new                                                     */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Creates a new and empty AH_OutlineRec object.                      */
-  /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
-  ah_outline_new( FT_Memory    memory,
-                  AH_Outline*  aoutline )
-  {
-    FT_Error    error;
-    AH_Outline  outline;
-
-
-    if ( !FT_NEW( outline ) )
-    {
-      outline->memory = memory;
-      *aoutline       = outline;
-    }
-
-    return error;
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    ah_outline_done                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Destroys a given AH_OutlineRec object.                             */
-  /*                                                                       */
-  FT_LOCAL_DEF( void )
-  ah_outline_done( AH_Outline  outline )
-  {
-    FT_Memory memory = outline->memory;
-
-
-    FT_FREE( outline->horz_edges );
-    FT_FREE( outline->horz_segments );
-    FT_FREE( outline->contours );
-    FT_FREE( outline->points );
-
-    FT_FREE( outline );
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    ah_outline_save                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Saves the contents of a given AH_OutlineRec object into a face's   */
-  /*    glyph slot.                                                        */
-  /*                                                                       */
-  FT_LOCAL_DEF( void )
-  ah_outline_save( AH_Outline  outline,
-                   AH_Loader   gloader )
-  {
-    AH_Point    point       = outline->points;
-    AH_Point    point_limit = point + outline->num_points;
-    FT_Vector*  vec         = gloader->current.outline.points;
-    char*       tag         = gloader->current.outline.tags;
-
-
-    /* we assume that the glyph loader has already been checked for storage */
-    for ( ; point < point_limit; point++, vec++, tag++ )
-    {
-      vec->x = point->x;
-      vec->y = point->y;
-
-      if ( point->flags & AH_FLAG_CONIC )
-        tag[0] = FT_CURVE_TAG_CONIC;
-      else if ( point->flags & AH_FLAG_CUBIC )
-        tag[0] = FT_CURVE_TAG_CUBIC;
-      else
-        tag[0] = FT_CURVE_TAG_ON;
-    }
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    ah_outline_load                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads an unscaled outline from a glyph slot into an AH_OutlineRec  */
-  /*    object.                                                            */
-  /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
-  ah_outline_load( AH_Outline  outline,
-                   FT_Fixed    x_scale,
-                   FT_Fixed    y_scale,
-                   FT_Face     face )
-  {
-    FT_Memory    memory       = outline->memory;
-    FT_Error     error        = AH_Err_Ok;
-    FT_Outline*  source       = &face->glyph->outline;
-    FT_Int       num_points   = source->n_points;
-    FT_Int       num_contours = source->n_contours;
-    AH_Point     points;
-
-
-    /* check arguments */
-    if ( !face                                          ||
-         !face->size                                    ||
-         face->glyph->format != FT_GLYPH_FORMAT_OUTLINE )
-      return AH_Err_Invalid_Argument;
-
-    /* first of all, reallocate the contours array if necessary */
-    if ( num_contours > outline->max_contours )
-    {
-      FT_Int  new_contours = FT_PAD_CEIL( num_contours, 4 );
-
-
-      if ( FT_RENEW_ARRAY( outline->contours,
-                           outline->max_contours,
-                           new_contours ) )
-        goto Exit;
-
-      outline->max_contours = new_contours;
-    }
-
-    /* then, reallocate the points, segments & edges arrays if needed -- */
-    /* note that we reserved two additional point positions, used to     */
-    /* hint metrics appropriately                                        */
-    /*                                                                   */
-    if ( num_points + 2 > outline->max_points )
-    {
-      FT_Int  news = FT_PAD_CEIL( num_points + 2, 8 );
-      FT_Int  max  = outline->max_points;
-
-
-      if ( FT_RENEW_ARRAY( outline->points,        max,     news     ) ||
-           FT_RENEW_ARRAY( outline->horz_edges,    max * 2, news * 2 ) ||
-           FT_RENEW_ARRAY( outline->horz_segments, max * 2, news * 2 ) )
-        goto Exit;
-
-      /* readjust some pointers */
-      outline->vert_edges    = outline->horz_edges    + news;
-      outline->vert_segments = outline->horz_segments + news;
-      outline->max_points    = news;
-    }
-
-    outline->num_points   = num_points;
-    outline->num_contours = num_contours;
-
-    outline->num_hedges    = 0;
-    outline->num_vedges    = 0;
-    outline->num_hsegments = 0;
-    outline->num_vsegments = 0;
-
-    /* We can't rely on the value of `FT_Outline.flags' to know the fill  */
-    /* direction used for a glyph, given that some fonts are broken (e.g. */
-    /* the Arphic ones).  We thus recompute it each time we need to.      */
-    /*                                                                    */
-    outline->vert_major_dir = AH_DIR_UP;
-    outline->horz_major_dir = AH_DIR_LEFT;
-
-    if ( ah_get_orientation( source ) > 1 )
-    {
-      outline->vert_major_dir = AH_DIR_DOWN;
-      outline->horz_major_dir = AH_DIR_RIGHT;
-    }
-
-    outline->x_scale = x_scale;
-    outline->y_scale = y_scale;
-
-    points = outline->points;
-    if ( outline->num_points == 0 )
-      goto Exit;
-
-    {
-      /* do one thing at a time -- it is easier to understand, and */
-      /* the code is clearer                                       */
-      AH_Point  point;
-      AH_Point  point_limit = points + outline->num_points;
-
-
-      /* compute coordinates */
-      {
-        FT_Vector*  vec = source->points;
-
-
-        for ( point = points; point < point_limit; vec++, point++ )
-        {
-          point->fx = vec->x;
-          point->fy = vec->y;
-          point->ox = point->x = FT_MulFix( vec->x, x_scale );
-          point->oy = point->y = FT_MulFix( vec->y, y_scale );
-
-          point->flags = 0;
-        }
-      }
-
-      /* compute Bezier flags */
-      {
-        char*  tag = source->tags;
-
-
-        for ( point = points; point < point_limit; point++, tag++ )
-        {
-          switch ( FT_CURVE_TAG( *tag ) )
-          {
-          case FT_CURVE_TAG_CONIC:
-            point->flags = AH_FLAG_CONIC;
-            break;
-          case FT_CURVE_TAG_CUBIC:
-            point->flags = AH_FLAG_CUBIC;
-            break;
-          default:
-            ;
-          }
-        }
-      }
-
-      /* compute `next' and `prev' */
-      {
-        FT_Int    contour_index;
-        AH_Point  prev;
-        AH_Point  first;
-        AH_Point  end;
-
-
-        contour_index = 0;
-
-        first = points;
-        end   = points + source->contours[0];
-        prev  = end;
-
-        for ( point = points; point < point_limit; point++ )
-        {
-          point->prev = prev;
-          if ( point < end )
-          {
-            point->next = point + 1;
-            prev        = point;
-          }
-          else
-          {
-            point->next = first;
-            contour_index++;
-            if ( point + 1 < point_limit )
-            {
-              end   = points + source->contours[contour_index];
-              first = point + 1;
-              prev  = end;
-            }
-          }
-        }
-      }
-
-      /* set-up the contours array */
-      {
-        AH_Point*  contour       = outline->contours;
-        AH_Point*  contour_limit = contour + outline->num_contours;
-        short*     end           = source->contours;
-        short      idx           = 0;
-
-
-        for ( ; contour < contour_limit; contour++, end++ )
-        {
-          contour[0] = points + idx;
-          idx        = (short)( end[0] + 1 );
-        }
-      }
-
-      /* compute directions of in & out vectors */
-      {
-        for ( point = points; point < point_limit; point++ )
-        {
-          AH_Point   prev;
-          AH_Point   next;
-          FT_Vector  ivec, ovec;
-
-
-          prev   = point->prev;
-          ivec.x = point->fx - prev->fx;
-          ivec.y = point->fy - prev->fy;
-
-          point->in_dir = ah_compute_direction( ivec.x, ivec.y );
-
-          next   = point->next;
-          ovec.x = next->fx - point->fx;
-          ovec.y = next->fy - point->fy;
-
-          point->out_dir = ah_compute_direction( ovec.x, ovec.y );
-
-#ifndef AH_OPTION_NO_WEAK_INTERPOLATION
-          if ( point->flags & ( AH_FLAG_CONIC | AH_FLAG_CUBIC ) )
-          {
-          Is_Weak_Point:
-            point->flags |= AH_FLAG_WEAK_INTERPOLATION;
-          }
-          else if ( point->out_dir == point->in_dir )
-          {
-            AH_Angle  angle_in, angle_out, delta;
-
-
-            if ( point->out_dir != AH_DIR_NONE )
-              goto Is_Weak_Point;
-
-            angle_in  = ah_angle( &ivec );
-            angle_out = ah_angle( &ovec );
-            delta     = angle_in - angle_out;
-
-            if ( delta > AH_PI )
-              delta = AH_2PI - delta;
-
-            if ( delta < 0 )
-              delta = -delta;
-
-            if ( delta < 2 )
-              goto Is_Weak_Point;
-          }
-          else if ( point->in_dir == -point->out_dir )
-            goto Is_Weak_Point;
-#endif
-        }
-      }
-    }
-
-  Exit:
-    return error;
-  }
-
-
-  FT_LOCAL_DEF( void )
-  ah_setup_uv( AH_Outline  outline,
-               AH_UV       source )
-  {
-    AH_Point  point       = outline->points;
-    AH_Point  point_limit = point + outline->num_points;
-
-
-    switch ( source )
-    {
-    case AH_UV_FXY:
-      for ( ; point < point_limit; point++ )
-      {
-        point->u = point->fx;
-        point->v = point->fy;
-      }
-      break;
-
-    case AH_UV_FYX:
-      for ( ; point < point_limit; point++ )
-      {
-        point->u = point->fy;
-        point->v = point->fx;
-      }
-      break;
-
-    case AH_UV_OXY:
-      for ( ; point < point_limit; point++ )
-      {
-        point->u = point->ox;
-        point->v = point->oy;
-      }
-      break;
-
-    case AH_UV_OYX:
-      for ( ; point < point_limit; point++ )
-      {
-        point->u = point->oy;
-        point->v = point->ox;
-      }
-      break;
-
-    case AH_UV_YX:
-      for ( ; point < point_limit; point++ )
-      {
-        point->u = point->y;
-        point->v = point->x;
-      }
-      break;
-
-    case AH_UV_OX:
-      for ( ; point < point_limit; point++ )
-      {
-        point->u = point->x;
-        point->v = point->ox;
-      }
-      break;
-
-    case AH_UV_OY:
-      for ( ; point < point_limit; point++ )
-      {
-        point->u = point->y;
-        point->v = point->oy;
-      }
-      break;
-
-    default:
-      for ( ; point < point_limit; point++ )
-      {
-        point->u = point->x;
-        point->v = point->y;
-      }
-    }
-  }
-
-
-  /* compute all inflex points in a given glyph */
-  static void
-  ah_outline_compute_inflections( AH_Outline  outline )
-  {
-    AH_Point*  contour       = outline->contours;
-    AH_Point*  contour_limit = contour + outline->num_contours;
-
-
-    /* load original coordinates in (u,v) */
-    ah_setup_uv( outline, AH_UV_FXY );
-
-    /* do each contour separately */
-    for ( ; contour < contour_limit; contour++ )
-    {
-      FT_Vector  vec;
-      AH_Point   point = contour[0];
-      AH_Point   first = point;
-      AH_Point   start = point;
-      AH_Point   end   = point;
-      AH_Point   before;
-      AH_Point   after;
-      AH_Angle   angle_in, angle_seg, angle_out;
-      AH_Angle   diff_in, diff_out;
-      FT_Int     finished = 0;
-
-
-      /* compute first segment in contour */
-      first = point;
-
-      start = end = first;
-      do
-      {
-        end = end->next;
-        if ( end == first )
-          goto Skip;
-
-      } while ( end->u == first->u && end->v == first->v );
-
-      vec.x = end->u - start->u;
-      vec.y = end->v - start->v;
-      angle_seg = ah_angle( &vec );
-
-      /* extend the segment start whenever possible */
-      before = start;
-      do
-      {
-        do
-        {
-          start  = before;
-          before = before->prev;
-          if ( before == first )
-            goto Skip;
-
-        } while ( before->u == start->u && before->v == start->v );
-
-        vec.x    = start->u - before->u;
-        vec.y    = start->v - before->v;
-        angle_in = ah_angle( &vec );
-
-      } while ( angle_in == angle_seg );
-
-      first   = start;
-      diff_in = ah_angle_diff( angle_in, angle_seg );
-
-      /* now, process all segments in the contour */
-      do
-      {
-        /* first, extend current segment's end whenever possible */
-        after = end;
-        do
-        {
-          do
-          {
-            end   = after;
-            after = after->next;
-            if ( after == first )
-              finished = 1;
-
-          } while ( end->u == after->u && end->v == after->v );
-
-          vec.x     = after->u - end->u;
-          vec.y     = after->v - end->v;
-          angle_out = ah_angle( &vec );
-
-        } while ( angle_out == angle_seg );
-
-        diff_out = ah_angle_diff( angle_seg, angle_out );
-
-        if ( ( diff_in ^ diff_out ) < 0 )
-        {
-          /* diff_in and diff_out have different signs, we have */
-          /* inflection points here...                          */
-          do
-          {
-            start->flags |= AH_FLAG_INFLECTION;
-            start = start->next;
-
-          } while ( start != end );
-
-          start->flags |= AH_FLAG_INFLECTION;
-        }
-
-        start     = end;
-        end       = after;
-        angle_seg = angle_out;
-        diff_in   = diff_out;
-
-      } while ( !finished );
-
-    Skip:
-      ;
-    }
-  }
-
-
-  FT_LOCAL_DEF( void )
-  ah_outline_compute_segments( AH_Outline  outline )
-  {
-    int           dimension;
-    AH_Segment    segments;
-    FT_Int*       p_num_segments;
-    AH_Direction  segment_dir;
-    AH_Direction  major_dir;
-
-
-    segments       = outline->horz_segments;
-    p_num_segments = &outline->num_hsegments;
-    major_dir      = AH_DIR_RIGHT;      /* This value must be positive! */
-    segment_dir    = major_dir;
-
-    /* set up (u,v) in each point */
-    ah_setup_uv( outline, AH_UV_FYX );
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Point*   contour       =  outline->contours;
-      AH_Point*   contour_limit =  contour + outline->num_contours;
-      AH_Segment  segment       =  segments;
-      FT_Int      num_segments  =  0;
-
-#ifdef AH_HINT_METRICS
-      AH_Point    min_point     =  0;
-      AH_Point    max_point     =  0;
-      FT_Pos      min_coord     =  32000;
-      FT_Pos      max_coord     = -32000;
-#endif
-
-
-      /* do each contour separately */
-      for ( ; contour < contour_limit; contour++ )
-      {
-        AH_Point  point   =  contour[0];
-        AH_Point  last    =  point->prev;
-        int       on_edge =  0;
-        FT_Pos    min_pos =  32000;  /* minimum segment pos != min_coord */
-        FT_Pos    max_pos = -32000;  /* maximum segment pos != max_coord */
-        FT_Bool   passed;
-
-
-#ifdef AH_HINT_METRICS
-        if ( point->u < min_coord )
-        {
-          min_coord = point->u;
-          min_point = point;
-        }
-        if ( point->u > max_coord )
-        {
-          max_coord = point->u;
-          max_point = point;
-        }
-#endif
-
-        if ( point == last )  /* skip singletons -- just in case */
-          continue;
-
-        if ( FT_ABS( last->out_dir )  == major_dir &&
-             FT_ABS( point->out_dir ) == major_dir )
-        {
-          /* we are already on an edge, try to locate its start */
-          last = point;
-
-          for (;;)
-          {
-            point = point->prev;
-            if ( FT_ABS( point->out_dir ) != major_dir )
-            {
-              point = point->next;
-              break;
-            }
-            if ( point == last )
-              break;
-          }
-        }
-
-        last   = point;
-        passed = 0;
-
-        for (;;)
-        {
-          FT_Pos  u, v;
-
-
-          if ( on_edge )
-          {
-            u = point->u;
-            if ( u < min_pos )
-              min_pos = u;
-            if ( u > max_pos )
-              max_pos = u;
-
-            if ( point->out_dir != segment_dir || point == last )
-            {
-              /* we are just leaving an edge; record a new segment! */
-              segment->last = point;
-              segment->pos  = ( min_pos + max_pos ) >> 1;
-
-              /* a segment is round if either its first or last point */
-              /* is a control point                                   */
-              if ( ( segment->first->flags | point->flags ) &
-                     AH_FLAG_CONTROL                        )
-                segment->flags |= AH_EDGE_ROUND;
-
-              /* compute segment size */
-              min_pos = max_pos = point->v;
-
-              v = segment->first->v;
-              if ( v < min_pos )
-                min_pos = v;
-              if ( v > max_pos )
-                max_pos = v;
-
-              segment->min_coord = min_pos;
-              segment->max_coord = max_pos;
-
-              on_edge = 0;
-              num_segments++;
-              segment++;
-              /* fallthrough */
-            }
-          }
-
-          /* now exit if we are at the start/end point */
-          if ( point == last )
-          {
-            if ( passed )
-              break;
-            passed = 1;
-          }
-
-          if ( !on_edge && FT_ABS( point->out_dir ) == major_dir )
-          {
-            /* this is the start of a new segment! */
-            segment_dir = point->out_dir;
-
-            /* clear all segment fields */
-            FT_ZERO( segment );
-
-            segment->dir      = segment_dir;
-            segment->flags    = AH_EDGE_NORMAL;
-            min_pos = max_pos = point->u;
-            segment->first    = point;
-            segment->last     = point;
-            segment->contour  = contour;
-            segment->score    = 32000;
-            segment->link     = NULL;
-            on_edge           = 1;
-
-#ifdef AH_HINT_METRICS
-            if ( point == max_point )
-              max_point = 0;
-
-            if ( point == min_point )
-              min_point = 0;
-#endif
-          }
-
-          point = point->next;
-        }
-
-      } /* contours */
-
-#ifdef AH_HINT_METRICS
-      /* we need to ensure that there are edges on the left-most and  */
-      /* right-most points of the glyph in order to hint the metrics; */
-      /* we do this by inserting fake segments when needed            */
-      if ( dimension == 0 )
-      {
-        AH_Point  point       = outline->points;
-        AH_Point  point_limit = point + outline->num_points;
-
-        FT_Pos    min_pos =  32000;
-        FT_Pos    max_pos = -32000;
-
-
-        min_point = 0;
-        max_point = 0;
-
-        /* compute minimum and maximum points */
-        for ( ; point < point_limit; point++ )
-        {
-          FT_Pos  x = point->fx;
-
-
-          if ( x < min_pos )
-          {
-            min_pos   = x;
-            min_point = point;
-          }
-          if ( x > max_pos )
-          {
-            max_pos   = x;
-            max_point = point;
-          }
-        }
-
-        /* insert minimum segment */
-        if ( min_point )
-        {
-          /* clear all segment fields */
-          FT_ZERO( segment );
-
-          segment->dir   = segment_dir;
-          segment->flags = AH_EDGE_NORMAL;
-          segment->first = min_point;
-          segment->last  = min_point;
-          segment->pos   = min_pos;
-          segment->score = 32000;
-          segment->link  = NULL;
-
-          num_segments++;
-          segment++;
-        }
-
-        /* insert maximum segment */
-        if ( max_point )
-        {
-          /* clear all segment fields */
-          FT_ZERO( segment );
-
-          segment->dir   = segment_dir;
-          segment->flags = AH_EDGE_NORMAL;
-          segment->first = max_point;
-          segment->last  = max_point;
-          segment->pos   = max_pos;
-          segment->score = 32000;
-          segment->link  = NULL;
-
-          num_segments++;
-          segment++;
-        }
-      }
-#endif /* AH_HINT_METRICS */
-
-      *p_num_segments = num_segments;
-
-      segments       = outline->vert_segments;
-      major_dir      = AH_DIR_UP;
-      p_num_segments = &outline->num_vsegments;
-
-      ah_setup_uv( outline, AH_UV_FXY );
-    }
-  }
-
-
-  FT_LOCAL_DEF( void )
-  ah_outline_link_segments( AH_Outline  outline )
-  {
-    AH_Segment    segments;
-    AH_Segment    segment_limit;
-    AH_Direction  major_dir;
-    int           dimension;
-
-
-    segments      = outline->horz_segments;
-    segment_limit = segments + outline->num_hsegments;
-    major_dir     = outline->horz_major_dir;
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Segment  seg1;
-      AH_Segment  seg2;
-
-#if 0
-      /* now compare each segment to the others */
-      for ( seg1 = segments; seg1 < segment_limit; seg1++ )
-      {
-        FT_Pos      best_score;
-        AH_Segment  best_segment;
-
-
-        /* the fake segments are introduced to hint the metrics -- */
-        /* we must never link them to anything                     */
-        if ( seg1->first == seg1->last )
-          continue;
-
-        best_segment = seg1->link;
-        if ( best_segment )
-          best_score = seg1->score;
-        else
-          best_score = +32000;
-
-        for ( seg2 = segments; seg2 < segment_limit; seg2++ )
-          if ( seg1 != seg2 && seg1->dir + seg2->dir == 0 )
-          {
-            FT_Pos   pos1 = seg1->pos;
-            FT_Pos   pos2 = seg2->pos;
-            FT_Bool  is_dir;
-            FT_Bool  is_pos;
-
-
-            /* check that the segments are correctly oriented and */
-            /* positioned to form a black distance                */
-
-            is_dir = (FT_Bool)( seg1->dir == outline->horz_major_dir ||
-                                seg1->dir == outline->vert_major_dir );
-            is_pos = (FT_Bool)( pos1 > pos2 );
-
-            if ( pos1 == pos2 || !(is_dir ^ is_pos) )
-              continue;
-
-            {
-              FT_Pos  min = seg1->min_coord;
-              FT_Pos  max = seg1->max_coord;
-              FT_Pos  len, dist, score;
-
-
-              if ( min < seg2->min_coord )
-                min = seg2->min_coord;
-
-              if ( max > seg2->max_coord )
-                max = seg2->max_coord;
-
-              len = max - min;
-              if ( len >= 8 )
-              {
-                dist = seg2->pos - seg1->pos;
-                if ( dist < 0 )
-                  dist = -dist;
-
-                score = dist + 3000 / len;
-
-                if ( score < best_score )
-                {
-                  best_score   = score;
-                  best_segment = seg2;
-                }
-              }
-            }
-          }
-
-        if ( best_segment )
-        {
-          seg1->link  = best_segment;
-          seg1->score = best_score;
-          best_segment->num_linked++;
-        }
-      }
-#endif /* 0 */
-
-#if 1
-      /* the following code does the same, but much faster! */
-
-      /* 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->first == seg1->last || seg1->dir != major_dir )
-          continue;
-
-        for ( seg2 = segments; seg2 < segment_limit; seg2++ )
-          if ( seg2 != seg1 && seg1->dir + seg2->dir == 0 )
-          {
-            FT_Pos  pos1 = seg1->pos;
-            FT_Pos  pos2 = seg2->pos;
-            FT_Pos  dist = pos2 - pos1;
-
-
-            if ( dist < 0 )
-              continue;
-
-            {
-              FT_Pos  min = seg1->min_coord;
-              FT_Pos  max = seg1->max_coord;
-              FT_Pos  len, score;
-
-
-              if ( min < seg2->min_coord )
-                min = seg2->min_coord;
-
-              if ( max > seg2->max_coord )
-                max = seg2->max_coord;
-
-              len = max - min;
-              if ( len >= 8 )
-              {
-                score = dist + 3000 / len;
-
-                if ( score < seg1->score )
-                {
-                  seg1->score = score;
-                  seg1->link  = seg2;
-                }
-
-                if ( score < seg2->score )
-                {
-                  seg2->score = score;
-                  seg2->link  = seg1;
-                }
-              }
-            }
-          }
-      }
-#endif /* 1 */
-
-      /* now, compute the `serif' segments */
-      for ( seg1 = segments; seg1 < segment_limit; seg1++ )
-      {
-        seg2 = seg1->link;
-
-        if ( seg2 )
-        {
-          seg2->num_linked++;
-          if ( seg2->link != seg1 )
-          {
-            seg1->link  = 0;
-            seg1->serif = seg2->link;
-          }
-        }
-      }
-
-      segments      = outline->vert_segments;
-      segment_limit = segments + outline->num_vsegments;
-      major_dir     = outline->vert_major_dir;
-    }
-  }
-
-
-  static void
-  ah_outline_compute_edges( AH_Outline  outline )
-  {
-    AH_Edge       edges;
-    AH_Segment    segments;
-    AH_Segment    segment_limit;
-    AH_Direction  up_dir;
-    FT_Int*       p_num_edges;
-    FT_Int        dimension;
-    FT_Fixed      scale;
-    FT_Pos        edge_distance_threshold;
-
-
-    edges         = outline->horz_edges;
-    segments      = outline->horz_segments;
-    segment_limit = segments + outline->num_hsegments;
-    p_num_edges   = &outline->num_hedges;
-    up_dir        = AH_DIR_RIGHT;
-    scale         = outline->y_scale;
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Edge     edge;
-      AH_Edge     edge_limit;  /* really == edge + num_edges */
-      AH_Segment  seg;
-
-
-      /*********************************************************************/
-      /*                                                                   */
-      /* We will begin by generating a sorted table of edges for the       */
-      /* current direction.  To do so, we simply scan each segment and try */
-      /* to find an edge in our table that corresponds to its position.    */
-      /*                                                                   */
-      /* If no edge is found, we create and insert a new edge in the       */
-      /* sorted table.  Otherwise, we simply add the segment to the edge's */
-      /* list which will be processed in the second step to compute the    */
-      /* edge's properties.                                                */
-      /*                                                                   */
-      /* Note that the edges table is sorted along the segment/edge        */
-      /* position.                                                         */
-      /*                                                                   */
-      /*********************************************************************/
-
-      edge_distance_threshold = FT_MulFix( outline->edge_distance_threshold,
-                                           scale );
-      if ( edge_distance_threshold > 64 / 4 )
-        edge_distance_threshold = 64 / 4;
-
-      edge_distance_threshold = FT_DivFix( edge_distance_threshold,
-                                           scale );
-
-      edge_limit = edges;
-      for ( seg = segments; seg < segment_limit; seg++ )
-      {
-        AH_Edge  found = 0;
-
-
-        /* look for an edge corresponding to the segment */
-        for ( edge = edges; edge < edge_limit; edge++ )
-        {
-          FT_Pos  dist;
-
-
-          dist = seg->pos - edge->fpos;
-          if ( dist < 0 )
-            dist = -dist;
-
-          if ( dist < edge_distance_threshold )
-          {
-            found = edge;
-            break;
-          }
-        }
-
-        if ( !found )
-        {
-          /* insert a new edge in the list and */
-          /* sort according to the position    */
-          while ( edge > edges && edge[-1].fpos > seg->pos )
-          {
-            edge[0] = edge[-1];
-            edge--;
-          }
-          edge_limit++;
-
-          /* clear all edge fields */
-          FT_MEM_ZERO( edge, sizeof ( *edge ) );
-
-          /* add the segment to the new edge's list */
-          edge->first    = seg;
-          edge->last     = seg;
-          edge->fpos     = seg->pos;
-          edge->opos     = edge->pos = FT_MulFix( seg->pos, scale );
-          seg->edge_next = seg;
-        }
-        else
-        {
-          /* if an edge was found, simply add the segment to the edge's */
-          /* list                                                       */
-          seg->edge_next        = edge->first;
-          edge->last->edge_next = seg;
-          edge->last            = seg;
-        }
-      }
-      *p_num_edges = (FT_Int)( edge_limit - edges );
-
-
-      /*********************************************************************/
-      /*                                                                   */
-      /* Good, we will now compute each edge's properties according to     */
-      /* segments found on its position.  Basically, these are:            */
-      /*                                                                   */
-      /*  - edge's main direction                                          */
-      /*  - stem edge, serif edge or both (which defaults to stem then)    */
-      /*  - rounded edge, straight or both (which defaults to straight)    */
-      /*  - link for edge                                                  */
-      /*                                                                   */
-      /*********************************************************************/
-
-      /* first of all, set the `edge' field in each segment -- this is */
-      /* required in order to compute edge links                       */
-
-      /* Note that I've tried to remove this loop, setting
-       * the "edge" field of each segment directly in the
-       * code above.  For some reason, it slows down execution
-       * speed -- on a Sun.
-       */
-      for ( edge = edges; edge < edge_limit; edge++ )
-      {
-        seg = edge->first;
-        if ( seg )
-          do
-          {
-            seg->edge = edge;
-            seg       = seg->edge_next;
-          }
-          while ( seg != edge->first );
-      }
-
-      /* now, compute each edge properties */
-      for ( edge = edges; edge < edge_limit; edge++ )
-      {
-        FT_Int  is_round    = 0;  /* does it contain round segments?    */
-        FT_Int  is_straight = 0;  /* does it contain straight segments? */
-        FT_Pos  ups         = 0;  /* number of upwards segments         */
-        FT_Pos  downs       = 0;  /* number of downwards segments       */
-
-
-        seg = edge->first;
-
-        do
-        {
-          FT_Bool  is_serif;
-
-
-          /* check for roundness of segment */
-          if ( seg->flags & AH_EDGE_ROUND )
-            is_round++;
-          else
-            is_straight++;
-
-          /* check for segment direction */
-          if ( seg->dir == up_dir )
-            ups   += seg->max_coord-seg->min_coord;
-          else
-            downs += seg->max_coord-seg->min_coord;
-
-          /* check for links -- if seg->serif is set, then seg->link must */
-          /* be ignored                                                   */
-          is_serif = (FT_Bool)( seg->serif && seg->serif->edge != edge );
-
-          if ( seg->link || is_serif )
-          {
-            AH_Edge     edge2;
-            AH_Segment  seg2;
-
-
-            edge2 = edge->link;
-            seg2  = seg->link;
-
-            if ( is_serif )
-            {
-              seg2  = seg->serif;
-              edge2 = edge->serif;
-            }
-
-            if ( edge2 )
-            {
-              FT_Pos  edge_delta;
-              FT_Pos  seg_delta;
-
-
-              edge_delta = edge->fpos - edge2->fpos;
-              if ( edge_delta < 0 )
-                edge_delta = -edge_delta;
-
-              seg_delta = seg->pos - seg2->pos;
-              if ( seg_delta < 0 )
-                seg_delta = -seg_delta;
-
-              if ( seg_delta < edge_delta )
-                edge2 = seg2->edge;
-            }
-            else
-              edge2 = seg2->edge;
-
-#ifdef FT_CONFIG_CHESTER_SERIF
-            if ( is_serif )
-            {
-              edge->serif   = edge2;
-              edge2->flags |= AH_EDGE_SERIF;
-            }
-            else
-              edge->link  = edge2;
-#else /* !FT_CONFIG_CHESTER_SERIF */
-            if ( is_serif )
-              edge->serif = edge2;
-            else
-              edge->link  = edge2;
-#endif /* !FT_CONFIG_CHESTER_SERIF */
-          }
-
-          seg = seg->edge_next;
-
-        } while ( seg != edge->first );
-
-        /* set the round/straight flags */
-        edge->flags = AH_EDGE_NORMAL;
-
-        if ( is_round > 0 && is_round >= is_straight )
-          edge->flags |= AH_EDGE_ROUND;
-
-        /* set the edge's main direction */
-        edge->dir = AH_DIR_NONE;
-
-        if ( ups > downs )
-          edge->dir = up_dir;
-
-        else if ( ups < downs )
-          edge->dir = -up_dir;
-
-        else if ( ups == downs )
-          edge->dir = 0;  /* both up and down! */
-
-        /* gets rid of serifs if link is set                */
-        /* XXX: This gets rid of many unpleasant artefacts! */
-        /*      Example: the `c' in cour.pfa at size 13     */
-
-        if ( edge->serif && edge->link )
-          edge->serif = 0;
-      }
-
-      edges         = outline->vert_edges;
-      segments      = outline->vert_segments;
-      segment_limit = segments + outline->num_vsegments;
-      p_num_edges   = &outline->num_vedges;
-      up_dir        = AH_DIR_UP;
-      scale         = outline->x_scale;
-    }
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    ah_outline_detect_features                                         */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Performs feature detection on a given AH_OutlineRec object.        */
-  /*                                                                       */
-  FT_LOCAL_DEF( void )
-  ah_outline_detect_features( AH_Outline  outline )
-  {
-    ah_outline_compute_segments   ( outline );
-    ah_outline_link_segments      ( outline );
-    ah_outline_compute_edges      ( outline );
-    ah_outline_compute_inflections( outline );
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    ah_outline_compute_blue_edges                                      */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Computes the `blue edges' in a given outline (i.e. those that must */
-  /*    be snapped to a blue zone edge (top or bottom).                    */
-  /*                                                                       */
-  FT_LOCAL_DEF( void )
-  ah_outline_compute_blue_edges( AH_Outline       outline,
-                                 AH_Face_Globals  face_globals )
-  {
-    AH_Edge     edge       = outline->horz_edges;
-    AH_Edge     edge_limit = edge + outline->num_hedges;
-    AH_Globals  globals    = &face_globals->design;
-    FT_Fixed    y_scale    = outline->y_scale;
-
-    FT_Bool     blue_active[AH_BLUE_MAX];
-
-
-    /* compute which blue zones are active, i.e. have their scaled */
-    /* size < 3/4 pixels                                           */
-    {
-      AH_Blue  blue;
-      FT_Bool  check = 0;
-
-
-      for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ )
-      {
-        FT_Pos  ref, shoot, dist;
-
-
-        ref   = globals->blue_refs[blue];
-        shoot = globals->blue_shoots[blue];
-        dist  = ref - shoot;
-        if ( dist < 0 )
-          dist = -dist;
-
-        blue_active[blue] = 0;
-
-        if ( FT_MulFix( dist, y_scale ) < 48 )
-        {
-          blue_active[blue] = 1;
-          check = 1;
-        }
-      }
-
-      /* return immediately if no blue zone is active */
-      if ( !check )
-        return;
-    }
-
-    /* for each horizontal edge search the blue zone which is closest */
-    for ( ; edge < edge_limit; edge++ )
-    {
-      AH_Blue  blue;
-      FT_Pos*  best_blue = 0;
-      FT_Pos   best_dist;  /* initial threshold */
-
-
-      /* compute the initial threshold as a fraction of the EM size */
-      best_dist = FT_MulFix( face_globals->face->units_per_EM / 40, y_scale );
-
-#ifdef FT_CONFIG_CHESTER_SMALL_F
-      if ( best_dist > 64 / 2 )
-        best_dist = 64 / 2;
-#else
-      if ( best_dist > 64 / 4 )
-        best_dist = 64 / 4;
-#endif
-
-      for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ )
-      {
-        /* 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 XXX                              */
-        FT_Bool  is_top_blue  =
-                   FT_BOOL( AH_IS_TOP_BLUE( blue ) );
-        FT_Bool  is_major_dir =
-                   FT_BOOL( edge->dir == outline->horz_major_dir );
-
-
-        if ( !blue_active[blue] )
-          continue;
-
-        /* 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 )
-        {
-          FT_Pos   dist;
-          FT_Pos*  blue_pos = globals->blue_refs + blue;
-
-
-          /* first of all, compare it to the reference position */
-          dist = edge->fpos - *blue_pos;
-          if ( dist < 0 )
-            dist = -dist;
-
-          dist = FT_MulFix( dist, y_scale );
-          if ( dist < best_dist )
-          {
-            best_dist = dist;
-            best_blue = blue_pos;
-          }
-
-          /* now, compare it to the overshoot position if the edge is     */
-          /* rounded, and if the edge is over the reference position of a */
-          /* top zone, or under the reference position of a bottom zone   */
-          if ( edge->flags & AH_EDGE_ROUND && dist != 0 )
-          {
-            FT_Bool  is_under_ref = FT_BOOL( edge->fpos < *blue_pos );
-
-
-            if ( is_top_blue ^ is_under_ref )
-            {
-              blue_pos = globals->blue_shoots + blue;
-              dist = edge->fpos - *blue_pos;
-              if ( dist < 0 )
-                dist = -dist;
-
-              dist = FT_MulFix( dist, y_scale );
-              if ( dist < best_dist )
-              {
-                best_dist = dist;
-                best_blue = blue_pos;
-              }
-            }
-          }
-        }
-      }
-
-      if ( best_blue )
-        edge->blue_edge = best_blue;
-    }
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    ah_outline_scale_blue_edges                                        */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    This function must be called before hinting in order to re-adjust  */
-  /*    the contents of the detected edges (basically change the `blue     */
-  /*    edge' pointer from `design units' to `scaled ones').               */
-  /*                                                                       */
-  FT_LOCAL_DEF( void )
-  ah_outline_scale_blue_edges( AH_Outline       outline,
-                               AH_Face_Globals  globals )
-  {
-    AH_Edge  edge       = outline->horz_edges;
-    AH_Edge  edge_limit = edge + outline->num_hedges;
-    FT_Pos   delta;
-
-
-    delta = globals->scaled.blue_refs - globals->design.blue_refs;
-
-    for ( ; edge < edge_limit; edge++ )
-    {
-      if ( edge->blue_edge )
-        edge->blue_edge += delta;
-    }
-  }
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahglyph.h b/reactos/lib/freetype/src/autohint/ahglyph.h
deleted file mode 100644 (file)
index b346cbe..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahglyph.h                                                              */
-/*                                                                         */
-/*    Routines used to load and analyze a given glyph before hinting       */
-/*    (specification).                                                     */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002 Catharon Productions Inc.                    */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __AHGLYPH_H__
-#define __AHGLYPH_H__
-
-
-#include <ft2build.h>
-#include "ahtypes.h"
-
-
-FT_BEGIN_HEADER
-
-
-  typedef enum  AH_UV_
-  {
-    AH_UV_FXY,
-    AH_UV_FYX,
-    AH_UV_OXY,
-    AH_UV_OYX,
-    AH_UV_OX,
-    AH_UV_OY,
-    AH_UV_YX,
-    AH_UV_XY  /* should always be last! */
-
-  } AH_UV;
-
-
-  FT_LOCAL( void )
-  ah_setup_uv( AH_Outline  outline,
-               AH_UV       source );
-
-
-  /* AH_OutlineRec functions - they should be typically called in this order */
-
-  FT_LOCAL( FT_Error )
-  ah_outline_new( FT_Memory    memory,
-                  AH_Outline*  aoutline );
-
-  FT_LOCAL( FT_Error )
-  ah_outline_load( AH_Outline  outline,
-                   FT_Fixed    x_scale,
-                   FT_Fixed    y_scale,
-                   FT_Face     face );
-
-  FT_LOCAL( void )
-  ah_outline_compute_segments( AH_Outline  outline );
-
-  FT_LOCAL( void )
-  ah_outline_link_segments( AH_Outline  outline );
-
-  FT_LOCAL( void )
-  ah_outline_detect_features( AH_Outline  outline );
-
-  FT_LOCAL( void )
-  ah_outline_compute_blue_edges( AH_Outline       outline,
-                                 AH_Face_Globals  globals );
-
-  FT_LOCAL( void )
-  ah_outline_scale_blue_edges( AH_Outline       outline,
-                               AH_Face_Globals  globals );
-
-  FT_LOCAL( void )
-  ah_outline_save( AH_Outline  outline,
-                   AH_Loader   loader );
-
-  FT_LOCAL( void )
-  ah_outline_done( AH_Outline  outline );
-
-
-FT_END_HEADER
-
-#endif /* __AHGLYPH_H__ */
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahhint.c b/reactos/lib/freetype/src/autohint/ahhint.c
deleted file mode 100644 (file)
index 8e8afea..0000000
+++ /dev/null
@@ -1,1937 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahhint.c                                                               */
-/*                                                                         */
-/*    Glyph hinter (body).                                                 */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc.        */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include "ahhint.h"
-#include "ahglyph.h"
-#include "ahangles.h"
-#include "aherrors.h"
-#include FT_OUTLINE_H
-
-
-#define FACE_GLOBALS( face )  ( (AH_Face_Globals)(face)->autohint.data )
-
-#define AH_USE_IUP
-#define OPTIM_STEM_SNAP
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****   Hinting routines                                              ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  /* snap a given width in scaled coordinates to one of the */
-  /* current standard widths                                */
-  static FT_Pos
-  ah_snap_width( FT_Pos*  widths,
-                 FT_Int   count,
-                 FT_Pos   width )
-  {
-    int     n;
-    FT_Pos  best      = 64 + 32 + 2;
-    FT_Pos  reference = width;
-    FT_Pos  scaled;
-
-
-    for ( n = 0; n < count; n++ )
-    {
-      FT_Pos  w;
-      FT_Pos  dist;
-
-
-      w = widths[n];
-      dist = width - w;
-      if ( dist < 0 )
-        dist = -dist;
-      if ( dist < best )
-      {
-        best      = dist;
-        reference = w;
-      }
-    }
-
-    scaled = FT_PIX_ROUND( reference );
-
-    if ( width >= reference )
-    {
-      if ( width < scaled + 48 )
-        width = reference;
-    }
-    else
-    {
-      if ( width > scaled - 48 )
-        width = reference;
-    }
-
-    return width;
-  }
-
-
-  /* compute the snapped width of a given stem */
-
-#ifdef FT_CONFIG_CHESTER_SERIF
-
-  static FT_Pos
-  ah_compute_stem_width( AH_Hinter      hinter,
-                         int            vertical,
-                         FT_Pos         width,
-                         AH_Edge_Flags  base_flags,
-                         AH_Edge_Flags  stem_flags )
-  {
-    AH_Globals  globals = &hinter->globals->scaled;
-    FT_Pos      dist    = width;
-    FT_Int      sign    = 0;
-
-
-    if ( dist < 0 )
-    {
-      dist = -width;
-      sign = 1;
-    }
-
-    if ( !hinter->do_stem_adjust )
-    {
-      /* leave stem widths unchanged */
-    }
-    else if ( (  vertical && !hinter->do_vert_snapping ) ||
-              ( !vertical && !hinter->do_horz_snapping ) )
-    {
-      /* smooth hinting process: very lightly quantize the stem width */
-      /*                                                              */
-
-      /* leave the widths of serifs alone */
-
-      if ( ( stem_flags & AH_EDGE_SERIF ) && vertical && ( dist < 3 * 64 ) )
-        goto Done_Width;
-
-      else if ( ( base_flags & AH_EDGE_ROUND ) )
-      {
-        if ( dist < 80 )
-          dist = 64;
-      }
-      else if ( dist < 56 )
-        dist = 56;
-
-      {
-        FT_Pos  delta = dist - globals->stds[vertical];
-
-
-        if ( delta < 0 )
-          delta = -delta;
-
-        if ( delta < 40 )
-        {
-          dist = globals->stds[vertical];
-          if ( dist < 48 )
-            dist = 48;
-
-          goto Done_Width;
-        }
-
-        if ( dist < 3 * 64 )
-        {
-          delta  = dist & 63;
-          dist  &= -64;
-
-          if ( delta < 10 )
-            dist += delta;
-
-          else if ( delta < 32 )
-            dist += 10;
-
-          else if ( delta < 54 )
-            dist += 54;
-
-          else
-            dist += delta;
-        }
-        else
-          dist = ( dist + 32 ) & ~63;
-      }
-    }
-    else
-    {
-      /* strong hinting process: snap the stem width to integer pixels */
-      /*                                                               */
-      if ( vertical )
-      {
-        dist = ah_snap_width( globals->heights, globals->num_heights, dist );
-
-        /* in the case of vertical hinting, always round */
-        /* the stem heights to integer pixels            */
-        if ( dist >= 64 )
-          dist = ( dist + 16 ) & ~63;
-        else
-          dist = 64;
-      }
-      else
-      {
-        dist = ah_snap_width( globals->widths, globals->num_widths, dist );
-
-        if ( hinter->flags & AH_HINTER_MONOCHROME )
-        {
-          /* monochrome horizontal hinting: snap widths to integer pixels */
-          /* with a different threshold                                   */
-          if ( dist < 64 )
-            dist = 64;
-          else
-            dist = ( dist + 32 ) & ~63;
-        }
-        else
-        {
-          /* for horizontal anti-aliased hinting, we adopt a more subtle */
-          /* approach: we strengthen small stems, round stems whose size */
-          /* is between 1 and 2 pixels to an integer, otherwise nothing  */
-          if ( dist < 48 )
-            dist = ( dist + 64 ) >> 1;
-
-          else if ( dist < 128 )
-            dist = ( dist + 22 ) & ~63;
-          else
-            /* XXX: round otherwise to prevent color fringes in LCD mode */
-            dist = ( dist + 32 ) & ~63;
-        }
-      }
-    }
-
-  Done_Width:
-    if ( sign )
-      dist = -dist;
-
-    return dist;
-  }
-
-#else /* !FT_CONFIG_CHESTER_SERIF */
-
-  static FT_Pos
-  ah_compute_stem_width( AH_Hinter  hinter,
-                         int        vertical,
-                         FT_Pos     width )
-  {
-    AH_Globals  globals = &hinter->globals->scaled;
-    FT_Pos      dist    = width;
-    FT_Int      sign    = 0;
-
-
-    if ( dist < 0 )
-    {
-      dist = -width;
-      sign = 1;
-    }
-
-    if ( !hinter->do_stem_adjust )
-    {
-      /* leave stem widths unchanged */
-    }
-    else if ( (  vertical && !hinter->do_vert_snapping ) ||
-              ( !vertical && !hinter->do_horz_snapping ) )
-    {
-      /* smooth hinting process: very lightly quantize the stem width */
-      /*                                                              */
-      if ( dist < 64 )
-        dist = 64;
-
-      {
-        FT_Pos  delta = dist - globals->stds[vertical];
-
-
-        if ( delta < 0 )
-          delta = -delta;
-
-        if ( delta < 40 )
-        {
-          dist = globals->stds[vertical];
-          if ( dist < 48 )
-            dist = 48;
-        }
-
-        if ( dist < 3 * 64 )
-        {
-          delta  = dist & 63;
-          dist  &= -64;
-
-          if ( delta < 10 )
-            dist += delta;
-
-          else if ( delta < 32 )
-            dist += 10;
-
-          else if ( delta < 54 )
-            dist += 54;
-
-          else
-            dist += delta;
-        }
-        else
-          dist = ( dist + 32 ) & ~63;
-      }
-    }
-    else
-    {
-      /* strong hinting process: snap the stem width to integer pixels */
-      /*                                                               */
-      if ( vertical )
-      {
-        dist = ah_snap_width( globals->heights, globals->num_heights, dist );
-
-        /* in the case of vertical hinting, always round */
-        /* the stem heights to integer pixels            */
-        if ( dist >= 64 )
-          dist = ( dist + 16 ) & ~63;
-        else
-          dist = 64;
-      }
-      else
-      {
-        dist = ah_snap_width( globals->widths, globals->num_widths, dist );
-
-        if ( hinter->flags & AH_HINTER_MONOCHROME )
-        {
-          /* monochrome horizontal hinting: snap widths to integer pixels */
-          /* with a different threshold                                   */
-          if ( dist < 64 )
-            dist = 64;
-          else
-            dist = ( dist + 32 ) & ~63;
-        }
-        else
-        {
-          /* for horizontal anti-aliased hinting, we adopt a more subtle */
-          /* approach: we strengthen small stems, round stems whose size */
-          /* is between 1 and 2 pixels to an integer, otherwise nothing  */
-          if ( dist < 48 )
-            dist = ( dist + 64 ) >> 1;
-
-          else if ( dist < 128 )
-            dist = ( dist + 22 ) & ~63;
-          else
-            /* XXX: round otherwise to prevent color fringes in LCD mode */
-            dist = ( dist + 32 ) & ~63;
-        }
-      }
-    }
-
-    if ( sign )
-      dist = -dist;
-
-    return dist;
-  }
-
-#endif /* !FT_CONFIG_CHESTER_SERIF */
-
-
-  /* align one stem edge relative to the previous stem edge */
-  static void
-  ah_align_linked_edge( AH_Hinter  hinter,
-                        AH_Edge    base_edge,
-                        AH_Edge    stem_edge,
-                        int        vertical )
-  {
-    FT_Pos  dist = stem_edge->opos - base_edge->opos;
-
-#ifdef FT_CONFIG_CHESTER_SERIF
-
-    FT_Pos  fitted_width = ah_compute_stem_width( hinter,
-                                                  vertical,
-                                                  dist,
-                                                  base_edge->flags,
-                                                  stem_edge->flags );
-
-
-    stem_edge->pos = base_edge->pos + fitted_width;
-
-#else
-
-    stem_edge->pos = base_edge->pos +
-                     ah_compute_stem_width( hinter, vertical, dist );
-
-#endif
-
-  }
-
-
-  static void
-  ah_align_serif_edge( AH_Hinter  hinter,
-                       AH_Edge    base,
-                       AH_Edge    serif,
-                       int        vertical )
-  {
-    FT_Pos  dist;
-    FT_Pos  sign = 1;
-
-    FT_UNUSED( hinter );
-    FT_UNUSED( vertical );
-
-
-    dist = serif->opos - base->opos;
-    if ( dist < 0 )
-    {
-      dist = -dist;
-      sign = -1;
-    }
-
-#if 0
-    /* do not touch serifs widths! */
-    if ( base->flags & AH_EDGE_DONE )
-    {
-      if ( dist >= 64 )
-        dist = ( dist + 8 ) & ~63;
-
-      else if ( dist <= 32 && !vertical )
-        dist = ( dist + 33 ) >> 1;
-
-      else
-        dist = 0;
-    }
-#endif
-
-    serif->pos = base->pos + sign * dist;
-  }
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****       E D G E   H I N T I N G                                   ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-  FT_LOCAL_DEF( void )
-  ah_hinter_hint_edges( AH_Hinter  hinter )
-  {
-    AH_Edge     edges;
-    AH_Edge     edge_limit;
-    AH_Outline  outline = hinter->glyph;
-    FT_Int      dimension;
-    FT_Int      n_edges;
-
-
-    edges      = outline->horz_edges;
-    edge_limit = edges + outline->num_hedges;
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Edge  edge;
-      AH_Edge  anchor = 0;
-      int      has_serifs = 0;
-
-
-      if ( !hinter->do_horz_hints && !dimension )
-        goto Next_Dimension;
-
-      if ( !hinter->do_vert_hints && dimension )
-        goto Next_Dimension;
-
-      /* we begin by aligning all stems relative to the blue zone */
-      /* if needed -- that's only for horizontal edges            */
-      if ( dimension )
-      {
-        for ( edge = edges; edge < edge_limit; edge++ )
-        {
-          FT_Pos*      blue;
-          AH_EdgeRec  *edge1, *edge2;
-
-
-          if ( edge->flags & AH_EDGE_DONE )
-            continue;
-
-          blue  = edge->blue_edge;
-          edge1 = 0;
-          edge2 = edge->link;
-
-          if ( blue )
-          {
-            edge1 = edge;
-          }
-          else if ( edge2 && edge2->blue_edge )
-          {
-            blue  = edge2->blue_edge;
-            edge1 = edge2;
-            edge2 = edge;
-          }
-
-          if ( !edge1 )
-            continue;
-
-          edge1->pos    = blue[0];
-          edge1->flags |= AH_EDGE_DONE;
-
-          if ( edge2 && !edge2->blue_edge )
-          {
-            ah_align_linked_edge( hinter, edge1, edge2, dimension );
-            edge2->flags |= AH_EDGE_DONE;
-          }
-
-          if ( !anchor )
-            anchor = edge;
-        }
-      }
-
-      /* now we will align all stem edges, trying to maintain the */
-      /* relative order of stems in the glyph                     */
-      for ( edge = edges; edge < edge_limit; edge++ )
-      {
-        AH_EdgeRec*  edge2;
-
-
-        if ( edge->flags & AH_EDGE_DONE )
-          continue;
-
-        /* skip all non-stem edges */
-        edge2 = edge->link;
-        if ( !edge2 )
-        {
-          has_serifs++;
-          continue;
-        }
-
-        /* now align the stem */
-
-        /* this should not happen, but it's better to be safe */
-        if ( edge2->blue_edge || edge2 < edge )
-        {
-          ah_align_linked_edge( hinter, edge2, edge, dimension );
-          edge->flags |= AH_EDGE_DONE;
-          continue;
-        }
-
-        if ( !anchor )
-        {
-
-#ifdef FT_CONFIG_CHESTER_STEM
-
-          FT_Pos  org_len, org_center, cur_len;
-          FT_Pos  cur_pos1, error1, error2, u_off, d_off;
-
-
-          org_len = edge2->opos - edge->opos;
-          cur_len = ah_compute_stem_width( hinter, dimension, org_len,
-                                           edge->flags, edge2->flags );
-
-          if ( cur_len <= 64 )
-            u_off = d_off = 32;
-          else
-          {
-            u_off = 38;
-            d_off = 26;
-          }
-
-          if ( cur_len < 96 )
-          {
-            org_center = edge->opos + ( org_len >> 1 );
-
-            cur_pos1   = FT_PIX_ROUND( org_center );
-
-            error1 = org_center - ( cur_pos1 - u_off );
-            if ( error1 < 0 )
-              error1 = -error1;
-
-            error2 = org_center - ( cur_pos1 + d_off );
-            if ( error2 < 0 )
-              error2 = -error2;
-
-            if ( error1 < error2 )
-              cur_pos1 -= u_off;
-            else
-              cur_pos1 += d_off;
-
-            edge->pos  = cur_pos1 - cur_len / 2;
-            edge2->pos = cur_pos1 + cur_len / 2;
-
-          }
-          else
-            edge->pos = FT_PIX_ROUND( edge->opos );
-
-          anchor = edge;
-
-          edge->flags |= AH_EDGE_DONE;
-
-          ah_align_linked_edge( hinter, edge, edge2, dimension );
-
-#else /* !FT_CONFIG_CHESTER_STEM */
-
-          edge->pos = FT_PIX_ROUND( edge->opos );
-          anchor    = edge;
-
-          edge->flags |= AH_EDGE_DONE;
-
-          ah_align_linked_edge( hinter, edge, edge2, dimension );
-
-#endif /* !FT_CONFIG_CHESTER_STEM */
-
-        }
-        else
-        {
-          FT_Pos  org_pos, org_len, org_center, cur_len;
-          FT_Pos  cur_pos1, cur_pos2, delta1, delta2;
-
-
-          org_pos    = anchor->pos + ( edge->opos - anchor->opos );
-          org_len    = edge2->opos - edge->opos;
-          org_center = org_pos + ( org_len >> 1 );
-
-#ifdef FT_CONFIG_CHESTER_SERIF
-
-          cur_len = ah_compute_stem_width( hinter, dimension, org_len,
-                                           edge->flags, edge2->flags  );
-
-
-#else  /* !FT_CONFIG_CHESTER_SERIF */
-
-          cur_len = ah_compute_stem_width( hinter, dimension, org_len );
-
-#endif /* !FT_CONFIG_CHESTER_SERIF */
-
-#ifdef FT_CONFIG_CHESTER_STEM
-
-          if ( cur_len < 96 )
-          {
-            FT_Pos  u_off, d_off;
-
-
-            cur_pos1 = FT_PIX_ROUND( org_center );
-
-            if (cur_len <= 64 )
-              u_off = d_off = 32;
-            else
-            {
-              u_off = 38;
-              d_off = 26;
-            }
-
-            delta1 = org_center - ( cur_pos1 - u_off );
-            if ( delta1 < 0 )
-              delta1 = -delta1;
-
-            delta2 = org_center - ( cur_pos1 + d_off );
-            if ( delta2 < 0 )
-              delta2 = -delta2;
-
-            if ( delta1 < delta2 )
-              cur_pos1 -= u_off;
-            else
-              cur_pos1 += d_off;
-
-            edge->pos  = cur_pos1 - cur_len / 2;
-            edge2->pos = cur_pos1 + cur_len / 2;
-          }
-          else
-          {
-            org_pos    = anchor->pos + ( edge->opos - anchor->opos );
-            org_len    = edge2->opos - edge->opos;
-            org_center = org_pos + ( org_len >> 1 );
-
-            cur_len    = ah_compute_stem_width( hinter, dimension, org_len,
-                                                edge->flags, edge2->flags );
-
-            cur_pos1   = FT_PIX_ROUND( org_pos );
-            delta1     = ( cur_pos1 + ( cur_len >> 1 ) - org_center );
-            if ( delta1 < 0 )
-              delta1 = -delta1;
-
-            cur_pos2   = FT_PIX_ROUND( org_pos + org_len ) - cur_len;
-            delta2     = ( cur_pos2 + ( cur_len >> 1 ) - org_center );
-            if ( delta2 < 0 )
-              delta2 = -delta2;
-
-            edge->pos  = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
-            edge2->pos = edge->pos + cur_len;
-          }
-
-#else /* !FT_CONFIG_CHESTER_STEM */
-
-          cur_pos1   = FT_PIX_ROUND( org_pos );
-          delta1     = ( cur_pos1 + ( cur_len >> 1 ) - org_center );
-          if ( delta1 < 0 )
-            delta1 = -delta1;
-
-          cur_pos2   = FT_PIX_ROUND( org_pos + org_len ) - cur_len;
-          delta2     = ( cur_pos2 + ( cur_len >> 1 ) - org_center );
-          if ( delta2 < 0 )
-            delta2 = -delta2;
-
-          edge->pos  = ( delta1 <= delta2 ) ? cur_pos1 : cur_pos2;
-          edge2->pos = edge->pos + cur_len;
-
-#endif /* !FT_CONFIG_CHESTER_STEM */
-
-          edge->flags  |= AH_EDGE_DONE;
-          edge2->flags |= AH_EDGE_DONE;
-
-          if ( edge > edges && edge->pos < edge[-1].pos )
-            edge->pos = edge[-1].pos;
-        }
-      }
-
-      /* make sure that lowercase m's maintain their symmetry */
-
-      /* In general, lowercase m's have six vertical edges if they are sans */
-      /* serif, or twelve if they are avec serif.  This implementation is   */
-      /* based on that assumption, and seems to work very well with most    */
-      /* faces.  However, if for a certain face this assumption is not      */
-      /* true, the m is just rendered like before.  In addition, any stem   */
-      /* correction will only be applied to symmetrical glyphs (even if the */
-      /* glyph is not an m), so the potential for unwanted distortion is    */
-      /* relatively low.                                                    */
-
-      /* We don't handle horizontal edges since we can't easily assure that */
-      /* the third (lowest) stem aligns with the base line; it might end up */
-      /* one pixel higher or lower.                                         */
-
-      n_edges = (FT_Int)( edge_limit - edges );
-      if ( !dimension && ( n_edges == 6 || n_edges == 12 ) )
-      {
-        AH_EdgeRec  *edge1, *edge2, *edge3;
-        FT_Pos       dist1, dist2, span, delta;
-
-
-        if ( n_edges == 6 )
-        {
-          edge1 = edges;
-          edge2 = edges + 2;
-          edge3 = edges + 4;
-        }
-        else
-        {
-          edge1 = edges + 1;
-          edge2 = edges + 5;
-          edge3 = edges + 9;
-        }
-
-        dist1 = edge2->opos - edge1->opos;
-        dist2 = edge3->opos - edge2->opos;
-
-        span = dist1 - dist2;
-        if ( span < 0 )
-          span = -span;
-
-        if ( span < 8 )
-        {
-          delta = edge3->pos - ( 2 * edge2->pos - edge1->pos );
-          edge3->pos -= delta;
-          if ( edge3->link )
-            edge3->link->pos -= delta;
-
-          /* move the serifs along with the stem */
-          if ( n_edges == 12 )
-          {
-            ( edges + 8 )->pos -= delta;
-            ( edges + 11 )->pos -= delta;
-          }
-
-          edge3->flags |= AH_EDGE_DONE;
-          if ( edge3->link )
-            edge3->link->flags |= AH_EDGE_DONE;
-        }
-      }
-
-      if ( !has_serifs )
-        goto Next_Dimension;
-
-      /* now hint the remaining edges (serifs and single) in order */
-      /* to complete our processing                                */
-      for ( edge = edges; edge < edge_limit; edge++ )
-      {
-        if ( edge->flags & AH_EDGE_DONE )
-          continue;
-
-        if ( edge->serif )
-          ah_align_serif_edge( hinter, edge->serif, edge, dimension );
-        else if ( !anchor )
-        {
-          edge->pos = FT_PIX_ROUND( edge->opos );
-          anchor    = edge;
-        }
-        else
-          edge->pos = anchor->pos +
-                      FT_PIX_ROUND( edge->opos - anchor->opos );
-
-        edge->flags |= AH_EDGE_DONE;
-
-        if ( edge > edges && edge->pos < edge[-1].pos )
-          edge->pos = edge[-1].pos;
-
-        if ( edge + 1 < edge_limit        &&
-             edge[1].flags & AH_EDGE_DONE &&
-             edge->pos > edge[1].pos      )
-          edge->pos = edge[1].pos;
-      }
-
-    Next_Dimension:
-      edges      = outline->vert_edges;
-      edge_limit = edges + outline->num_vedges;
-    }
-  }
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****       P O I N T   H I N T I N G                                 ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  static void
-  ah_hinter_align_edge_points( AH_Hinter  hinter )
-  {
-    AH_Outline  outline = hinter->glyph;
-    AH_Edge     edges;
-    AH_Edge     edge_limit;
-    FT_Int      dimension;
-
-
-    edges      = outline->horz_edges;
-    edge_limit = edges + outline->num_hedges;
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Edge  edge;
-
-
-      edge = edges;
-      for ( ; edge < edge_limit; edge++ )
-      {
-        /* move the points of each segment     */
-        /* in each edge to the edge's position */
-        AH_Segment  seg = edge->first;
-
-
-        do
-        {
-          AH_Point  point = seg->first;
-
-
-          for (;;)
-          {
-            if ( dimension )
-            {
-              point->y      = edge->pos;
-              point->flags |= AH_FLAG_TOUCH_Y;
-            }
-            else
-            {
-              point->x      = edge->pos;
-              point->flags |= AH_FLAG_TOUCH_X;
-            }
-
-            if ( point == seg->last )
-              break;
-
-            point = point->next;
-          }
-
-          seg = seg->edge_next;
-
-        } while ( seg != edge->first );
-      }
-
-      edges      = outline->vert_edges;
-      edge_limit = edges + outline->num_vedges;
-    }
-  }
-
-
-  /* hint the strong points -- this is equivalent to the TrueType `IP' */
-  /* hinting instruction                                               */
-  static void
-  ah_hinter_align_strong_points( AH_Hinter  hinter )
-  {
-    AH_Outline  outline = hinter->glyph;
-    FT_Int      dimension;
-    AH_Edge     edges;
-    AH_Edge     edge_limit;
-    AH_Point    points;
-    AH_Point    point_limit;
-    AH_Flags    touch_flag;
-
-
-    points      = outline->points;
-    point_limit = points + outline->num_points;
-
-    edges       = outline->horz_edges;
-    edge_limit  = edges + outline->num_hedges;
-    touch_flag  = AH_FLAG_TOUCH_Y;
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Point  point;
-      AH_Edge   edge;
-
-
-      if ( edges < edge_limit )
-        for ( point = points; point < point_limit; point++ )
-        {
-          FT_Pos  u, ou, fu;  /* point position */
-          FT_Pos  delta;
-
-
-          if ( point->flags & touch_flag )
-            continue;
-
-#ifndef AH_OPTION_NO_WEAK_INTERPOLATION
-          /* if this point is candidate to weak interpolation, we will  */
-          /* interpolate it after all strong points have been processed */
-          if (  ( point->flags & AH_FLAG_WEAK_INTERPOLATION ) &&
-               !( point->flags & AH_FLAG_INFLECTION )         )
-            continue;
-#endif
-
-          if ( dimension )
-          {
-            u  = point->fy;
-            ou = point->oy;
-          }
-          else
-          {
-            u  = point->fx;
-            ou = point->ox;
-          }
-
-          fu = u;
-
-          /* is the point before the first edge? */
-          edge  = edges;
-          delta = edge->fpos - u;
-          if ( delta >= 0 )
-          {
-            u = edge->pos - ( edge->opos - ou );
-            goto Store_Point;
-          }
-
-          /* is the point after the last edge? */
-          edge  = edge_limit - 1;
-          delta = u - edge->fpos;
-          if ( delta >= 0 )
-          {
-            u = edge->pos + ( ou - edge->opos );
-            goto Store_Point;
-          }
-
-#if 1
-          {
-            FT_UInt  min, max, mid;
-            FT_Pos   fpos;
-
-
-            /* find enclosing edges */
-            min = 0;
-            max = (FT_UInt)( edge_limit - edges );
-
-            while ( min < max )
-            {
-              mid  = ( max + min ) >> 1;
-              edge = edges + mid;
-              fpos = edge->fpos;
-
-              if ( u < fpos )
-                max = mid;
-              else if ( u > fpos )
-                min = mid + 1;
-              else
-              {
-                /* we are on the edge */
-                u = edge->pos;
-                goto Store_Point;
-              }
-            }
-
-            {
-              AH_Edge  before = edges + min - 1;
-              AH_Edge  after  = edges + min + 0;
-
-
-              /* assert( before && after && before != after ) */
-              if ( before->scale == 0 )
-                before->scale = FT_DivFix( after->pos - before->pos,
-                                           after->fpos - before->fpos );
-
-              u = before->pos + FT_MulFix( fu - before->fpos,
-                                           before->scale );
-            }
-          }
-
-#else /* !0 */
-
-          /* otherwise, interpolate the point in between */
-          {
-            AH_Edge  before = 0;
-            AH_Edge  after  = 0;
-
-
-            for ( edge = edges; edge < edge_limit; edge++ )
-            {
-              if ( u == edge->fpos )
-              {
-                u = edge->pos;
-                goto Store_Point;
-              }
-              if ( u < edge->fpos )
-                break;
-              before = edge;
-            }
-
-            for ( edge = edge_limit - 1; edge >= edges; edge-- )
-            {
-              if ( u == edge->fpos )
-              {
-                u = edge->pos;
-                goto Store_Point;
-              }
-              if ( u > edge->fpos )
-                break;
-              after = edge;
-            }
-
-            if ( before->scale == 0 )
-              before->scale = FT_DivFix( after->pos - before->pos,
-                                        after->fpos - before->fpos );
-
-            u = before->pos + FT_MulFix( fu - before->fpos,
-                                        before->scale );
-          }
-
-#endif /* !0 */
-
-        Store_Point:
-
-          /* save the point position */
-          if ( dimension )
-            point->y = u;
-          else
-            point->x = u;
-
-          point->flags |= touch_flag;
-        }
-
-      edges      = outline->vert_edges;
-      edge_limit = edges + outline->num_vedges;
-      touch_flag = AH_FLAG_TOUCH_X;
-    }
-  }
-
-
-#ifndef AH_OPTION_NO_WEAK_INTERPOLATION
-
-  static void
-  ah_iup_shift( AH_Point  p1,
-                AH_Point  p2,
-                AH_Point  ref )
-  {
-    AH_Point  p;
-    FT_Pos    delta = ref->u - ref->v;
-
-
-    for ( p = p1; p < ref; p++ )
-      p->u = p->v + delta;
-
-    for ( p = ref + 1; p <= p2; p++ )
-      p->u = p->v + delta;
-  }
-
-
-  static void
-  ah_iup_interp( AH_Point  p1,
-                 AH_Point  p2,
-                 AH_Point  ref1,
-                 AH_Point  ref2 )
-  {
-    AH_Point  p;
-    FT_Pos    u;
-    FT_Pos    v1 = ref1->v;
-    FT_Pos    v2 = ref2->v;
-    FT_Pos    d1 = ref1->u - v1;
-    FT_Pos    d2 = ref2->u - v2;
-
-
-    if ( p1 > p2 )
-      return;
-
-    if ( v1 == v2 )
-    {
-      for ( p = p1; p <= p2; p++ )
-      {
-        u = p->v;
-
-        if ( u <= v1 )
-          u += d1;
-        else
-          u += d2;
-
-        p->u = u;
-      }
-      return;
-    }
-
-    if ( v1 < v2 )
-    {
-      for ( p = p1; p <= p2; p++ )
-      {
-        u = p->v;
-
-        if ( u <= v1 )
-          u += d1;
-        else if ( u >= v2 )
-          u += d2;
-        else
-          u = ref1->u + FT_MulDiv( u - v1, ref2->u - ref1->u, v2 - v1 );
-
-        p->u = u;
-      }
-    }
-    else
-    {
-      for ( p = p1; p <= p2; p++ )
-      {
-        u = p->v;
-
-        if ( u <= v2 )
-          u += d2;
-        else if ( u >= v1 )
-          u += d1;
-        else
-          u = ref1->u + FT_MulDiv( u - v1, ref2->u - ref1->u, v2 - v1 );
-
-        p->u = u;
-      }
-    }
-  }
-
-
-  /* interpolate weak points -- this is equivalent to the TrueType `IUP' */
-  /* hinting instruction                                                 */
-  static void
-  ah_hinter_align_weak_points( AH_Hinter  hinter )
-  {
-    AH_Outline  outline = hinter->glyph;
-    FT_Int      dimension;
-    AH_Point    points;
-    AH_Point    point_limit;
-    AH_Point*   contour_limit;
-    AH_Flags    touch_flag;
-
-
-    points      = outline->points;
-    point_limit = points + outline->num_points;
-
-    /* PASS 1: Move segment points to edge positions */
-
-    touch_flag = AH_FLAG_TOUCH_Y;
-
-    contour_limit = outline->contours + outline->num_contours;
-
-    ah_setup_uv( outline, AH_UV_OY );
-
-    for ( dimension = 1; dimension >= 0; dimension-- )
-    {
-      AH_Point   point;
-      AH_Point   end_point;
-      AH_Point   first_point;
-      AH_Point*  contour;
-
-
-      point   = points;
-      contour = outline->contours;
-
-      for ( ; contour < contour_limit; contour++ )
-      {
-        point       = *contour;
-        end_point   = point->prev;
-        first_point = point;
-
-        while ( point <= end_point && !( point->flags & touch_flag ) )
-          point++;
-
-        if ( point <= end_point )
-        {
-          AH_Point  first_touched = point;
-          AH_Point  cur_touched   = point;
-
-
-          point++;
-          while ( point <= end_point )
-          {
-            if ( point->flags & touch_flag )
-            {
-              /* we found two successive touched points; we interpolate */
-              /* all contour points between them                        */
-              ah_iup_interp( cur_touched + 1, point - 1,
-                             cur_touched, point );
-              cur_touched = point;
-            }
-            point++;
-          }
-
-          if ( cur_touched == first_touched )
-          {
-            /* this is a special case: only one point was touched in the */
-            /* contour; we thus simply shift the whole contour           */
-            ah_iup_shift( first_point, end_point, cur_touched );
-          }
-          else
-          {
-            /* now interpolate after the last touched point to the end */
-            /* of the contour                                          */
-            ah_iup_interp( cur_touched + 1, end_point,
-                           cur_touched, first_touched );
-
-            /* if the first contour point isn't touched, interpolate */
-            /* from the contour start to the first touched point     */
-            if ( first_touched > points )
-              ah_iup_interp( first_point, first_touched - 1,
-                             cur_touched, first_touched );
-          }
-        }
-      }
-
-      /* now save the interpolated values back to x/y */
-      if ( dimension )
-      {
-        for ( point = points; point < point_limit; point++ )
-          point->y = point->u;
-
-        touch_flag = AH_FLAG_TOUCH_X;
-        ah_setup_uv( outline, AH_UV_OX );
-      }
-      else
-      {
-        for ( point = points; point < point_limit; point++ )
-          point->x = point->u;
-
-        break;  /* exit loop */
-      }
-    }
-  }
-
-#endif /* !AH_OPTION_NO_WEAK_INTERPOLATION */
-
-
-  FT_LOCAL_DEF( void )
-  ah_hinter_align_points( AH_Hinter  hinter )
-  {
-    ah_hinter_align_edge_points( hinter );
-
-#ifndef AH_OPTION_NO_STRONG_INTERPOLATION
-    ah_hinter_align_strong_points( hinter );
-#endif
-
-#ifndef AH_OPTION_NO_WEAK_INTERPOLATION
-    ah_hinter_align_weak_points( hinter );
-#endif
-  }
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****       H I N T E R   O B J E C T   M E T H O D S                 ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-  /* scale and fit the global metrics */
-  static void
-  ah_hinter_scale_globals( AH_Hinter  hinter,
-                           FT_Fixed   x_scale,
-                           FT_Fixed   y_scale )
-  {
-    FT_Int           n;
-    AH_Face_Globals  globals = hinter->globals;
-    AH_Globals       design  = &globals->design;
-    AH_Globals       scaled  = &globals->scaled;
-
-
-    /* copy content */
-    *scaled = *design;
-
-    /* scale the standard widths & heights */
-    for ( n = 0; n < design->num_widths; n++ )
-      scaled->widths[n] = FT_MulFix( design->widths[n], x_scale );
-
-    for ( n = 0; n < design->num_heights; n++ )
-      scaled->heights[n] = FT_MulFix( design->heights[n], y_scale );
-
-    scaled->stds[0] = ( design->num_widths  > 0 ) ? scaled->widths[0]  : 32000;
-    scaled->stds[1] = ( design->num_heights > 0 ) ? scaled->heights[0] : 32000;
-
-    /* scale the blue zones */
-    for ( n = 0; n < AH_BLUE_MAX; n++ )
-    {
-      FT_Pos  delta, delta2;
-
-
-      delta = design->blue_shoots[n] - design->blue_refs[n];
-      delta2 = delta;
-      if ( delta < 0 )
-        delta2 = -delta2;
-      delta2 = FT_MulFix( delta2, y_scale );
-
-      if ( delta2 < 32 )
-        delta2 = 0;
-      else if ( delta2 < 64 )
-        delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );
-      else
-        delta2 = FT_PIX_ROUND( delta2 );
-
-      if ( delta < 0 )
-        delta2 = -delta2;
-
-      scaled->blue_refs[n] =
-        FT_PIX_ROUND( FT_MulFix( design->blue_refs[n], y_scale ) );
-
-      scaled->blue_shoots[n] = scaled->blue_refs[n] + delta2;
-    }
-
-    globals->x_scale = x_scale;
-    globals->y_scale = y_scale;
-  }
-
-
-  static void
-  ah_hinter_align( AH_Hinter  hinter )
-  {
-    ah_hinter_align_edge_points( hinter );
-    ah_hinter_align_points( hinter );
-  }
-
-
-  /* finalize a hinter object */
-  FT_LOCAL_DEF( void )
-  ah_hinter_done( AH_Hinter  hinter )
-  {
-    if ( hinter )
-    {
-      FT_Memory  memory = hinter->memory;
-
-
-      ah_loader_done( hinter->loader );
-      ah_outline_done( hinter->glyph );
-
-      /* note: the `globals' pointer is _not_ owned by the hinter */
-      /*       but by the current face object; we don't need to   */
-      /*       release it                                         */
-      hinter->globals = 0;
-      hinter->face    = 0;
-
-      FT_FREE( hinter );
-    }
-  }
-
-
-  /* create a new empty hinter object */
-  FT_LOCAL_DEF( FT_Error )
-  ah_hinter_new( FT_Library  library,
-                 AH_Hinter  *ahinter )
-  {
-    AH_Hinter  hinter = 0;
-    FT_Memory  memory = library->memory;
-    FT_Error   error;
-
-
-    *ahinter = 0;
-
-    /* allocate object */
-    if ( FT_NEW( hinter ) )
-      goto Exit;
-
-    hinter->memory = memory;
-    hinter->flags  = 0;
-
-    /* allocate outline and loader */
-    error = ah_outline_new( memory, &hinter->glyph )  ||
-            ah_loader_new ( memory, &hinter->loader ) ||
-            ah_loader_create_extra( hinter->loader );
-    if ( error )
-      goto Exit;
-
-    *ahinter = hinter;
-
-  Exit:
-    if ( error )
-      ah_hinter_done( hinter );
-
-    return error;
-  }
-
-
-  /* create a face's autohint globals */
-  FT_LOCAL_DEF( FT_Error )
-  ah_hinter_new_face_globals( AH_Hinter   hinter,
-                              FT_Face     face,
-                              AH_Globals  globals )
-  {
-    FT_Error         error;
-    FT_Memory        memory = hinter->memory;
-    AH_Face_Globals  face_globals;
-
-
-    if ( FT_NEW( face_globals ) )
-      goto Exit;
-
-    hinter->face    = face;
-    hinter->globals = face_globals;
-
-    if ( globals )
-      face_globals->design = *globals;
-    else
-      ah_hinter_compute_globals( hinter );
-
-    face->autohint.data      = face_globals;
-    face->autohint.finalizer = (FT_Generic_Finalizer)
-                                 ah_hinter_done_face_globals;
-    face_globals->face       = face;
-
-  Exit:
-    return error;
-  }
-
-
-  /* discard a face's autohint globals */
-  FT_LOCAL_DEF( void )
-  ah_hinter_done_face_globals( AH_Face_Globals  globals )
-  {
-    FT_Face    face   = globals->face;
-    FT_Memory  memory = face->memory;
-
-
-    FT_FREE( globals );
-  }
-
-
-  static FT_Error
-  ah_hinter_load( AH_Hinter  hinter,
-                  FT_UInt    glyph_index,
-                  FT_Int32   load_flags,
-                  FT_UInt    depth )
-  {
-    FT_Face           face     = hinter->face;
-    FT_GlyphSlot      slot     = face->glyph;
-    FT_Slot_Internal  internal = slot->internal;
-    FT_Fixed          x_scale  = hinter->globals->x_scale;
-    FT_Fixed          y_scale  = hinter->globals->y_scale;
-    FT_Error          error;
-    AH_Outline        outline  = hinter->glyph;
-    AH_Loader         gloader  = hinter->loader;
-
-
-    /* load the glyph */
-    error = FT_Load_Glyph( face, glyph_index, load_flags );
-    if ( error )
-      goto Exit;
-
-    /* Set `hinter->transformed' after loading with FT_LOAD_NO_RECURSE. */
-    hinter->transformed = internal->glyph_transformed;
-
-    if ( hinter->transformed )
-    {
-      FT_Matrix  imatrix;
-
-
-      imatrix              = internal->glyph_matrix;
-      hinter->trans_delta  = internal->glyph_delta;
-      hinter->trans_matrix = imatrix;
-
-      FT_Matrix_Invert( &imatrix );
-      FT_Vector_Transform( &hinter->trans_delta, &imatrix );
-    }
-
-    /* set linear horizontal metrics */
-    slot->linearHoriAdvance = slot->metrics.horiAdvance;
-    slot->linearVertAdvance = slot->metrics.vertAdvance;
-
-    switch ( slot->format )
-    {
-    case FT_GLYPH_FORMAT_OUTLINE:
-
-      /* translate glyph outline if we need to */
-      if ( hinter->transformed )
-      {
-        FT_UInt     n     = slot->outline.n_points;
-        FT_Vector*  point = slot->outline.points;
-
-
-        for ( ; n > 0; point++, n-- )
-        {
-          point->x += hinter->trans_delta.x;
-          point->y += hinter->trans_delta.y;
-        }
-      }
-
-      /* copy the outline points in the loader's current               */
-      /* extra points which is used to keep original glyph coordinates */
-      error = ah_loader_check_points( gloader, slot->outline.n_points + 4,
-                                      slot->outline.n_contours );
-      if ( error )
-        goto Exit;
-
-      FT_ARRAY_COPY( gloader->current.extra_points, slot->outline.points,
-                     slot->outline.n_points );
-
-      FT_ARRAY_COPY( gloader->current.outline.contours, slot->outline.contours,
-                     slot->outline.n_contours );
-
-      FT_ARRAY_COPY( gloader->current.outline.tags, slot->outline.tags,
-                     slot->outline.n_points );
-
-      gloader->current.outline.n_points   = slot->outline.n_points;
-      gloader->current.outline.n_contours = slot->outline.n_contours;
-
-      /* compute original horizontal phantom points, ignoring vertical ones */
-      hinter->pp1.x = 0;
-      hinter->pp1.y = 0;
-      hinter->pp2.x = FT_MulFix( slot->metrics.horiAdvance, x_scale );
-      hinter->pp2.y = 0;
-
-      /* be sure to check for spacing glyphs */
-      if ( slot->outline.n_points == 0 )
-        goto Hint_Metrics;
-
-      /* now load the slot image into the auto-outline and run the */
-      /* automatic hinting process                                 */
-      error = ah_outline_load( outline, x_scale, y_scale, face );
-      if ( error )
-        goto Exit;
-
-      /* perform feature detection */
-      ah_outline_detect_features( outline );
-
-      if ( hinter->do_vert_hints )
-      {
-        ah_outline_compute_blue_edges( outline, hinter->globals );
-        ah_outline_scale_blue_edges( outline, hinter->globals );
-      }
-
-      /* perform alignment control */
-      ah_hinter_hint_edges( hinter );
-      ah_hinter_align( hinter );
-
-      /* now save the current outline into the loader's current table */
-      ah_outline_save( outline, gloader );
-
-      /* we now need to hint the metrics according to the change in */
-      /* width/positioning that occured during the hinting process  */
-      if ( outline->num_vedges > 0 )
-      {
-        FT_Pos   old_advance, old_rsb, old_lsb, new_lsb, pp1x_uh, pp2x_uh;
-        AH_Edge  edge1 = outline->vert_edges;     /* leftmost edge  */
-        AH_Edge  edge2 = edge1 +
-                         outline->num_vedges - 1; /* rightmost edge */
-
-
-        old_advance = hinter->pp2.x;
-        old_rsb     = old_advance - edge2->opos;
-        old_lsb     = edge1->opos;
-        new_lsb     = edge1->pos;
-
-        /* remember unhinted values to later account for rounding errors */
-
-        pp1x_uh = new_lsb    - old_lsb;
-        pp2x_uh = edge2->pos + old_rsb;
-
-        /* prefer too much space over too little space for very small sizes */
-
-        if ( old_lsb < 24 )
-          pp1x_uh -= 5;
-
-        if ( old_rsb < 24 )
-          pp2x_uh += 5;
-
-        hinter->pp1.x = FT_PIX_ROUND( pp1x_uh );
-        hinter->pp2.x = FT_PIX_ROUND( pp2x_uh );
-
-        slot->lsb_delta = hinter->pp1.x - pp1x_uh;
-        slot->rsb_delta = hinter->pp2.x - pp2x_uh;
-
-#if 0
-        /* try to fix certain bad advance computations */
-        if ( hinter->pp2.x + hinter->pp1.x == edge2->pos && old_rsb > 4 )
-          hinter->pp2.x += 64;
-#endif
-      }
-
-      else
-      {
-        hinter->pp1.x = ( hinter->pp1.x + 32 ) & -64;
-        hinter->pp2.x = ( hinter->pp2.x + 32 ) & -64;
-      }
-
-      /* good, we simply add the glyph to our loader's base */
-      ah_loader_add( gloader );
-      break;
-
-    case FT_GLYPH_FORMAT_COMPOSITE:
-      {
-        FT_UInt      nn, num_subglyphs = slot->num_subglyphs;
-        FT_UInt      num_base_subgs, start_point;
-        FT_SubGlyph  subglyph;
-
-
-        start_point = gloader->base.outline.n_points;
-
-        /* first of all, copy the subglyph descriptors in the glyph loader */
-        error = ah_loader_check_subglyphs( gloader, num_subglyphs );
-        if ( error )
-          goto Exit;
-
-        FT_ARRAY_COPY( gloader->current.subglyphs, slot->subglyphs,
-                       num_subglyphs );
-
-        gloader->current.num_subglyphs = num_subglyphs;
-        num_base_subgs = gloader->base.num_subglyphs;
-
-        /* now, read each subglyph independently */
-        for ( nn = 0; nn < num_subglyphs; nn++ )
-        {
-          FT_Vector  pp1, pp2;
-          FT_Pos     x, y;
-          FT_UInt    num_points, num_new_points, num_base_points;
-
-
-          /* gloader.current.subglyphs can change during glyph loading due */
-          /* to re-allocation -- we must recompute the current subglyph on */
-          /* each iteration                                                */
-          subglyph = gloader->base.subglyphs + num_base_subgs + nn;
-
-          pp1 = hinter->pp1;
-          pp2 = hinter->pp2;
-
-          num_base_points = gloader->base.outline.n_points;
-
-          error = ah_hinter_load( hinter, subglyph->index,
-                                  load_flags, depth + 1 );
-          if ( error )
-            goto Exit;
-
-          /* recompute subglyph pointer */
-          subglyph = gloader->base.subglyphs + num_base_subgs + nn;
-
-          if ( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS )
-          {
-            pp1 = hinter->pp1;
-            pp2 = hinter->pp2;
-          }
-          else
-          {
-            hinter->pp1 = pp1;
-            hinter->pp2 = pp2;
-          }
-
-          num_points     = gloader->base.outline.n_points;
-          num_new_points = num_points - num_base_points;
-
-          /* now perform the transform required for this subglyph */
-
-          if ( subglyph->flags & ( FT_SUBGLYPH_FLAG_SCALE    |
-                                   FT_SUBGLYPH_FLAG_XY_SCALE |
-                                   FT_SUBGLYPH_FLAG_2X2      ) )
-          {
-            FT_Vector*  cur   = gloader->base.outline.points +
-                                num_base_points;
-            FT_Vector*  org   = gloader->base.extra_points +
-                                num_base_points;
-            FT_Vector*  limit = cur + num_new_points;
-
-
-            for ( ; cur < limit; cur++, org++ )
-            {
-              FT_Vector_Transform( cur, &subglyph->transform );
-              FT_Vector_Transform( org, &subglyph->transform );
-            }
-          }
-
-          /* apply offset */
-
-          if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ) )
-          {
-            FT_Int      k = subglyph->arg1;
-            FT_UInt     l = subglyph->arg2;
-            FT_Vector*  p1;
-            FT_Vector*  p2;
-
-
-            if ( start_point + k >= num_base_points         ||
-                               l >= (FT_UInt)num_new_points )
-            {
-              error = AH_Err_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 */
-            p1 = gloader->base.outline.points + start_point + k;
-            p2 = gloader->base.outline.points + start_point + l;
-
-            x = p1->x - p2->x;
-            y = p1->y - p2->y;
-          }
-          else
-          {
-            x = FT_MulFix( subglyph->arg1, x_scale );
-            y = FT_MulFix( subglyph->arg2, y_scale );
-
-            x = FT_PIX_ROUND(x);
-            y = FT_PIX_ROUND(y);
-          }
-
-          {
-            FT_Outline  dummy = gloader->base.outline;
-
-
-            dummy.points  += num_base_points;
-            dummy.n_points = (short)num_new_points;
-
-            FT_Outline_Translate( &dummy, x, y );
-          }
-        }
-      }
-      break;
-
-    default:
-      /* we don't support other formats (yet?) */
-      error = AH_Err_Unimplemented_Feature;
-    }
-
-  Hint_Metrics:
-    if ( depth == 0 )
-    {
-      FT_BBox  bbox;
-
-
-      /* transform the hinted outline if needed */
-      if ( hinter->transformed )
-        FT_Outline_Transform( &gloader->base.outline, &hinter->trans_matrix );
-
-      /* we must translate our final outline by -pp1.x and compute */
-      /* the new metrics                                           */
-      if ( hinter->pp1.x )
-        FT_Outline_Translate( &gloader->base.outline, -hinter->pp1.x, 0 );
-
-      FT_Outline_Get_CBox( &gloader->base.outline, &bbox );
-      bbox.xMin  = FT_PIX_FLOOR(  bbox.xMin );
-      bbox.yMin  = FT_PIX_FLOOR(  bbox.yMin );
-      bbox.xMax  = FT_PIX_CEIL( bbox.xMax );
-      bbox.yMax  = FT_PIX_CEIL( bbox.yMax );
-
-      slot->metrics.width        = bbox.xMax - bbox.xMin;
-      slot->metrics.height       = bbox.yMax - bbox.yMin;
-      slot->metrics.horiBearingX = bbox.xMin;
-      slot->metrics.horiBearingY = bbox.yMax;
-
-      /* for mono-width fonts (like Andale, Courier, etc.) we need */
-      /* to keep the original rounded advance width                */
-      if ( !FT_IS_FIXED_WIDTH( slot->face ) )
-        slot->metrics.horiAdvance = hinter->pp2.x - hinter->pp1.x;
-      else
-        slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
-                                               x_scale );
-
-      slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
-
-      /* now copy outline into glyph slot */
-      ah_loader_rewind( slot->internal->loader );
-      error = ah_loader_copy_points( slot->internal->loader, gloader );
-      if ( error )
-        goto Exit;
-
-      slot->outline = slot->internal->loader->base.outline;
-      slot->format  = FT_GLYPH_FORMAT_OUTLINE;
-    }
-
-#ifdef DEBUG_HINTER
-    ah_debug_hinter = hinter;
-#endif
-
-  Exit:
-    return error;
-  }
-
-
-  /* load and hint a given glyph */
-  FT_LOCAL_DEF( FT_Error )
-  ah_hinter_load_glyph( AH_Hinter     hinter,
-                        FT_GlyphSlot  slot,
-                        FT_Size       size,
-                        FT_UInt       glyph_index,
-                        FT_Int32      load_flags )
-  {
-    FT_Face          face         = slot->face;
-    FT_Error         error;
-    FT_Fixed         x_scale      = size->metrics.x_scale;
-    FT_Fixed         y_scale      = size->metrics.y_scale;
-    AH_Face_Globals  face_globals = FACE_GLOBALS( face );
-    FT_Render_Mode   hint_mode    = FT_LOAD_TARGET_MODE( load_flags );
-
-
-    /* first of all, we need to check that we're using the correct face and */
-    /* global hints to load the glyph                                       */
-    if ( hinter->face != face || hinter->globals != face_globals )
-    {
-      hinter->face = face;
-      if ( !face_globals )
-      {
-        error = ah_hinter_new_face_globals( hinter, face, 0 );
-        if ( error )
-          goto Exit;
-
-      }
-      hinter->globals = FACE_GLOBALS( face );
-      face_globals    = FACE_GLOBALS( face );
-
-    }
-
-#ifdef FT_CONFIG_CHESTER_BLUE_SCALE
-
-   /* try to optimize the y_scale so that the top of non-capital letters
-    * is aligned on a pixel boundary whenever possible
-    */
-    {
-      AH_Globals  design = &face_globals->design;
-      FT_Pos      shoot  = design->blue_shoots[AH_BLUE_SMALL_TOP];
-
-
-      /* the value of 'shoot' will be -1000 if the font doesn't have */
-      /* small latin letters; we simply check the sign here...       */
-      if ( shoot > 0 )
-      {
-        FT_Pos  scaled = FT_MulFix( shoot, y_scale );
-        FT_Pos  fitted = FT_PIX_ROUND( scaled );
-
-
-        if ( scaled != fitted )
-        {
-         /* adjust y_scale
-          */
-          y_scale = FT_MulDiv( y_scale, fitted, scaled );
-
-         /* adust x_scale
-          */
-          if ( fitted < scaled )
-            x_scale -= x_scale / 50;  /* x_scale*0.98 with integers */
-        }
-      }
-    }
-
-#endif /* FT_CONFIG_CHESTER_BLUE_SCALE */
-
-    /* now, we must check the current character pixel size to see if we */
-    /* need to rescale the global metrics                               */
-    if ( face_globals->x_scale != x_scale ||
-         face_globals->y_scale != y_scale )
-      ah_hinter_scale_globals( hinter, x_scale, y_scale );
-
-    ah_loader_rewind( hinter->loader );
-
-    /* reset hinting flags according to load flags and current render target */
-    hinter->do_horz_hints = FT_BOOL( !(load_flags & FT_LOAD_NO_AUTOHINT) );
-    hinter->do_vert_hints = FT_BOOL( !(load_flags & FT_LOAD_NO_AUTOHINT) );
-
-#ifdef DEBUG_HINTER
-    hinter->do_horz_hints = !ah_debug_disable_vert;  /* not a bug, the meaning */
-    hinter->do_vert_hints = !ah_debug_disable_horz;  /* of h/v is inverted!    */
-#endif
-
-    /* we snap the width of vertical stems for the monochrome and         */
-    /* horizontal LCD rendering targets only.  Corresponds to X snapping. */
-    hinter->do_horz_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO ||
-                                        hint_mode == FT_RENDER_MODE_LCD  );
-
-    /* we snap the width of horizontal stems for the monochrome and     */
-    /* vertical LCD rendering targets only.  Corresponds to Y snapping. */
-    hinter->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO   ||
-                                        hint_mode == FT_RENDER_MODE_LCD_V  );
-
-    hinter->do_stem_adjust   = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT );
-
-    load_flags |= FT_LOAD_NO_SCALE
-                | FT_LOAD_IGNORE_TRANSFORM;
-    load_flags &= ~FT_LOAD_RENDER;
-
-    error = ah_hinter_load( hinter, glyph_index, load_flags, 0 );
-
-  Exit:
-    return error;
-  }
-
-
-  /* retrieve a face's autohint globals for client applications */
-  FT_LOCAL_DEF( void )
-  ah_hinter_get_global_hints( AH_Hinter  hinter,
-                              FT_Face    face,
-                              void**     global_hints,
-                              long*      global_len )
-  {
-    AH_Globals  globals = 0;
-    FT_Memory   memory  = hinter->memory;
-    FT_Error    error;
-
-
-    /* allocate new master globals */
-    if ( FT_NEW( globals ) )
-      goto Fail;
-
-    /* compute face globals if needed */
-    if ( !FACE_GLOBALS( face ) )
-    {
-      error = ah_hinter_new_face_globals( hinter, face, 0 );
-      if ( error )
-        goto Fail;
-    }
-
-    *globals      = FACE_GLOBALS( face )->design;
-    *global_hints = globals;
-    *global_len   = sizeof( *globals );
-
-    return;
-
-  Fail:
-    FT_FREE( globals );
-
-    *global_hints = 0;
-    *global_len   = 0;
-  }
-
-
-  FT_LOCAL_DEF( void )
-  ah_hinter_done_global_hints( AH_Hinter  hinter,
-                               void*      global_hints )
-  {
-    FT_Memory  memory = hinter->memory;
-
-
-    FT_FREE( global_hints );
-  }
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahhint.h b/reactos/lib/freetype/src/autohint/ahhint.h
deleted file mode 100644 (file)
index 2c352d0..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahhint.h                                                               */
-/*                                                                         */
-/*    Glyph hinter (declaration).                                          */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002 Catharon Productions Inc.                    */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __AHHINT_H__
-#define __AHHINT_H__
-
-
-#include <ft2build.h>
-#include "ahglobal.h"
-
-
-FT_BEGIN_HEADER
-
-
-#define AH_HINT_DEFAULT        0
-#define AH_HINT_NO_ALIGNMENT   1
-#define AH_HINT_NO_HORZ_EDGES  0x200000L  /* temporary hack */
-#define AH_HINT_NO_VERT_EDGES  0x400000L  /* temporary hack */
-
-
-  /* create a new empty hinter object */
-  FT_LOCAL( FT_Error )
-  ah_hinter_new( FT_Library  library,
-                 AH_Hinter*  ahinter );
-
-  /* Load a hinted glyph in the hinter */
-  FT_LOCAL( FT_Error )
-  ah_hinter_load_glyph( AH_Hinter     hinter,
-                        FT_GlyphSlot  slot,
-                        FT_Size       size,
-                        FT_UInt       glyph_index,
-                        FT_Int32      load_flags );
-
-  /* finalize a hinter object */
-  FT_LOCAL( void )
-  ah_hinter_done( AH_Hinter  hinter );
-
-  FT_LOCAL( void )
-  ah_hinter_done_face_globals( AH_Face_Globals  globals );
-
-  FT_LOCAL( void )
-  ah_hinter_get_global_hints( AH_Hinter  hinter,
-                              FT_Face    face,
-                              void**     global_hints,
-                              long*      global_len );
-
-  FT_LOCAL( void )
-  ah_hinter_done_global_hints( AH_Hinter  hinter,
-                               void*      global_hints );
-
-
-FT_END_HEADER
-
-#endif /* __AHHINT_H__ */
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahloader.h b/reactos/lib/freetype/src/autohint/ahloader.h
deleted file mode 100644 (file)
index c8e42ef..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahloader.h                                                             */
-/*                                                                         */
-/*    Glyph loader for the auto-hinting module (declaration only).         */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002 Catharon Productions Inc.                    */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* This defines the AH_GlyphLoader type; it is simply a typedef to       */
-  /* FT_GlyphLoader.                                                       */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-#ifndef __AHLOADER_H__
-#define __AHLOADER_H__
-
-
-#include <ft2build.h>
-
-
-FT_BEGIN_HEADER
-
-#include FT_INTERNAL_GLYPH_LOADER_H
-
-  #define AH_Load    FT_GlyphLoad
-  #define AH_Loader  FT_GlyphLoader
-
-  #define ah_loader_new              FT_GlyphLoader_New
-  #define ah_loader_done             FT_GlyphLoader_Done
-  #define ah_loader_reset            FT_GlyphLoader_Reset
-  #define ah_loader_rewind           FT_GlyphLoader_Rewind
-  #define ah_loader_create_extra     FT_GlyphLoader_CreateExtra
-  #define ah_loader_check_points     FT_GlyphLoader_CheckPoints
-  #define ah_loader_check_subglyphs  FT_GlyphLoader_CheckSubGlyphs
-  #define ah_loader_prepare          FT_GlyphLoader_Prepare
-  #define ah_loader_add              FT_GlyphLoader_Add
-  #define ah_loader_copy_points      FT_GlyphLoader_CopyPoints
-
-
-FT_END_HEADER
-
-#endif /* __AHLOADER_H__ */
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahmodule.c b/reactos/lib/freetype/src/autohint/ahmodule.c
deleted file mode 100644 (file)
index 03d067b..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahmodule.c                                                             */
-/*                                                                         */
-/*    Auto-hinting module implementation (declaration).                    */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc.        */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include FT_MODULE_H
-#include "ahhint.h"
-
-
-#ifdef  DEBUG_HINTER
-   AH_Hinter  ah_debug_hinter       = NULL;
-   FT_Bool    ah_debug_disable_horz = 0;
-   FT_Bool    ah_debug_disable_vert = 0;
-#endif
-
-  typedef struct  FT_AutoHinterRec_
-  {
-    FT_ModuleRec  root;
-    AH_Hinter     hinter;
-
-  } FT_AutoHinterRec;
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  ft_autohinter_init( FT_Module  module )       /* FT_AutoHinter */
-  {
-    FT_AutoHinter  autohinter = (FT_AutoHinter)module;
-    FT_Error       error;
-
-
-    error = ah_hinter_new( module->library, &autohinter->hinter );
-
-#ifdef DEBUG_HINTER
-    if ( !error )
-      ah_debug_hinter = autohinter->hinter;
-#endif
-
-    return error;
-  }
-
-
-  FT_CALLBACK_DEF( void )
-  ft_autohinter_done( FT_Module  module )
-  {
-    FT_AutoHinter  autohinter = (FT_AutoHinter)module;
-
-
-    ah_hinter_done( autohinter->hinter );
-
-#ifdef DEBUG_HINTER
-    ah_debug_hinter = NULL;
-#endif
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  ft_autohinter_load_glyph( FT_AutoHinter  module,
-                            FT_GlyphSlot   slot,
-                            FT_Size        size,
-                            FT_UInt        glyph_index,
-                            FT_Int32       load_flags )
-  {
-    return ah_hinter_load_glyph( module->hinter,
-                                 slot, size, glyph_index, load_flags );
-  }
-
-
-  FT_CALLBACK_DEF( void )
-  ft_autohinter_reset_globals( FT_AutoHinter  module,
-                               FT_Face        face )
-  {
-    FT_UNUSED( module );
-
-    if ( face->autohint.data )
-      ah_hinter_done_face_globals( (AH_Face_Globals)(face->autohint.data) );
-  }
-
-
-  FT_CALLBACK_DEF( void )
-  ft_autohinter_get_globals( FT_AutoHinter  module,
-                             FT_Face        face,
-                             void**         global_hints,
-                             long*          global_len )
-  {
-    ah_hinter_get_global_hints( module->hinter, face,
-                                global_hints, global_len );
-  }
-
-
-  FT_CALLBACK_DEF( void )
-  ft_autohinter_done_globals( FT_AutoHinter  module,
-                              void*          global_hints )
-  {
-    ah_hinter_done_global_hints( module->hinter, global_hints );
-  }
-
-
-  FT_CALLBACK_TABLE_DEF
-  const FT_AutoHinter_ServiceRec  ft_autohinter_service =
-  {
-    ft_autohinter_reset_globals,
-    ft_autohinter_get_globals,
-    ft_autohinter_done_globals,
-    ft_autohinter_load_glyph
-  };
-
-
-  FT_CALLBACK_TABLE_DEF
-  const FT_Module_Class  autohint_module_class =
-  {
-    FT_MODULE_HINTER,
-    sizeof ( FT_AutoHinterRec ),
-
-    "autohinter",
-    0x10000L,   /* version 1.0 of the autohinter  */
-    0x20000L,   /* requires FreeType 2.0 or above */
-
-    (const void*) &ft_autohinter_service,
-
-    ft_autohinter_init,
-    ft_autohinter_done,
-    0                       /* FT_Module_Requester */
-  };
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/ahtypes.h b/reactos/lib/freetype/src/autohint/ahtypes.h
deleted file mode 100644 (file)
index f2cedd2..0000000
+++ /dev/null
@@ -1,527 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahtypes.h                                                              */
-/*                                                                         */
-/*    General types and definitions for the auto-hint module               */
-/*    (specification only).                                                */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc.        */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __AHTYPES_H__
-#define __AHTYPES_H__
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_OBJECTS_H
-
-#ifdef DEBUG_HINTER
-#include <../src/autohint/ahloader.h>
-#else
-#include "ahloader.h"
-#endif
-
-
-#define xxAH_DEBUG
-
-
-#ifdef AH_DEBUG
-
-#include <stdio.h>
-#define AH_LOG( x )  printf ## x
-
-#else
-
-#define AH_LOG( x )  do ; while ( 0 ) /* nothing */
-
-#endif /* AH_DEBUG */
-
-
-FT_BEGIN_HEADER
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /**** COMPILE-TIME BUILD OPTIONS                                      ****/
-  /****                                                                 ****/
-  /**** Toggle these configuration macros to experiment with `features' ****/
-  /**** of the auto-hinter.                                             ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* If this option is defined, only strong interpolation will be used to  */
-  /* place the points between edges.  Otherwise, `smooth' points are       */
-  /* detected and later hinted through weak interpolation to correct some  */
-  /* unpleasant artefacts.                                                 */
-  /*                                                                       */
-#undef AH_OPTION_NO_WEAK_INTERPOLATION
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Undefine this macro if you don't want to hint the metrics.  There is  */
-  /* no reason to do this (at least for non-CJK scripts), except for       */
-  /* experimentation.                                                      */
-  /*                                                                       */
-#undef  AH_HINT_METRICS
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define this macro if you do not want to insert extra edges at a       */
-  /* glyph's x and y extremum (if there isn't one already available).      */
-  /* This helps to reduce a number of artefacts and allows hinting of      */
-  /* metrics.                                                              */
-  /*                                                                       */
-#undef AH_OPTION_NO_EXTREMUM_EDGES
-
-
-  /* don't touch for now */
-#define AH_MAX_WIDTHS   12
-#define AH_MAX_HEIGHTS  12
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****   TYPE DEFINITIONS                                              ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-  /* see ahangles.h */
-  typedef FT_Int  AH_Angle;
-
-
-  /* hint flags */
-#define AH_FLAG_NONE       0
-
-  /* bezier control points flags */
-#define AH_FLAG_CONIC                 1
-#define AH_FLAG_CUBIC                 2
-#define AH_FLAG_CONTROL               ( AH_FLAG_CONIC | AH_FLAG_CUBIC )
-
-  /* extrema flags */
-#define AH_FLAG_EXTREMA_X             4
-#define AH_FLAG_EXTREMA_Y             8
-
-  /* roundness */
-#define AH_FLAG_ROUND_X              16
-#define AH_FLAG_ROUND_Y              32
-
-  /* touched */
-#define AH_FLAG_TOUCH_X              64
-#define AH_FLAG_TOUCH_Y             128
-
-  /* weak interpolation */
-#define AH_FLAG_WEAK_INTERPOLATION  256
-#define AH_FLAG_INFLECTION          512
-
-  typedef FT_Int AH_Flags;
-
-
-  /* edge hint flags */
-#define AH_EDGE_NORMAL  0
-#define AH_EDGE_ROUND   1
-#define AH_EDGE_SERIF   2
-#define AH_EDGE_DONE    4
-
-  typedef FT_Int  AH_Edge_Flags;
-
-
-  /* hint directions -- the values are computed so that two vectors are */
-  /* in opposite directions iff `dir1+dir2 == 0'                        */
-#define AH_DIR_NONE    4
-#define AH_DIR_RIGHT   1
-#define AH_DIR_LEFT   -1
-#define AH_DIR_UP      2
-#define AH_DIR_DOWN   -2
-
-  typedef FT_Int  AH_Direction;
-
-
-  typedef struct AH_PointRec_*    AH_Point;
-  typedef struct AH_SegmentRec_*  AH_Segment;
-  typedef struct AH_EdgeRec_*     AH_Edge;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    AH_PointRec                                                        */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A structure used to model an outline point to the AH_OutlineRec    */
-  /*    type.                                                              */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    flags     :: The current point hint flags.                         */
-  /*                                                                       */
-  /*    ox, oy    :: The current original scaled coordinates.              */
-  /*                                                                       */
-  /*    fx, fy    :: The current coordinates in font units.                */
-  /*                                                                       */
-  /*    x,  y     :: The current hinted coordinates.                       */
-  /*                                                                       */
-  /*    u, v      :: Point coordinates -- meaning varies with context.     */
-  /*                                                                       */
-  /*    in_dir    :: The direction of the inwards vector (prev->point).    */
-  /*                                                                       */
-  /*    out_dir   :: The direction of the outwards vector (point->next).   */
-  /*                                                                       */
-  /*    next      :: The next point in same contour.                       */
-  /*                                                                       */
-  /*    prev      :: The previous point in same contour.                   */
-  /*                                                                       */
-  typedef struct  AH_PointRec_
-  {
-    AH_Flags      flags;    /* point flags used by hinter */
-    FT_Pos        ox, oy;
-    FT_Pos        fx, fy;
-    FT_Pos        x,  y;
-    FT_Pos        u,  v;
-
-    AH_Direction  in_dir;   /* direction of inwards vector  */
-    AH_Direction  out_dir;  /* direction of outwards vector */
-
-    AH_Point      next;     /* next point in contour     */
-    AH_Point      prev;     /* previous point in contour */
-
-  } AH_PointRec;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    AH_SegmentRec                                                      */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A structure used to describe an edge segment to the auto-hinter.   */
-  /*    A segment is simply a sequence of successive points located on the */
-  /*    same horizontal or vertical `position', in a given direction.      */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    flags      :: The segment edge flags (straight, rounded, etc.).    */
-  /*                                                                       */
-  /*    dir        :: The segment direction.                               */
-  /*                                                                       */
-  /*    min_coord  :: The minimum coordinate of the segment.               */
-  /*                                                                       */
-  /*    max_coord  :: The maximum coordinate of the segment.               */
-  /*                                                                       */
-  /*    edge       :: The edge of the current segment.                     */
-  /*                                                                       */
-  /*    edge_next  :: The next segment on the same edge.                   */
-  /*                                                                       */
-  /*    link       :: The pairing segment for this edge.                   */
-  /*                                                                       */
-  /*    serif      :: The primary segment for serifs.                      */
-  /*                                                                       */
-  /*    num_linked :: The number of other segments that link to this one.  */
-  /*                                                                       */
-  /*    score      :: Used to score the segment when selecting them.       */
-  /*                                                                       */
-  /*    first      :: The first point in the segment.                      */
-  /*                                                                       */
-  /*    last       :: The last point in the segment.                       */
-  /*                                                                       */
-  /*    contour    :: A pointer to the first point of the segment's        */
-  /*                  contour.                                             */
-  /*                                                                       */
-  typedef struct  AH_SegmentRec_
-  {
-    AH_Edge_Flags  flags;
-    AH_Direction   dir;
-    FT_Pos         pos;         /* position of segment           */
-    FT_Pos         min_coord;   /* minimum coordinate of segment */
-    FT_Pos         max_coord;   /* maximum coordinate of segment */
-
-    AH_Edge        edge;
-    AH_Segment     edge_next;
-
-    AH_Segment     link;        /* link segment               */
-    AH_Segment     serif;       /* primary segment for serifs */
-    FT_Pos         num_linked;  /* number of linked segments  */
-    FT_Pos         score;
-
-    AH_Point       first;       /* first point in edge segment             */
-    AH_Point       last;        /* last point in edge segment              */
-    AH_Point*      contour;     /* ptr to first point of segment's contour */
-
-  } AH_SegmentRec;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    AH_EdgeRec                                                         */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A structure used to describe an edge, which really is a horizontal */
-  /*    or vertical coordinate to be hinted depending on the segments      */
-  /*    located on it.                                                     */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    fpos       :: The original edge position in font units.            */
-  /*                                                                       */
-  /*    opos       :: The original scaled edge position.                   */
-  /*                                                                       */
-  /*    pos        :: The hinted edge position.                            */
-  /*                                                                       */
-  /*    flags      :: The segment edge flags (straight, rounded, etc.).    */
-  /*                                                                       */
-  /*    dir        :: The main segment direction on this edge.             */
-  /*                                                                       */
-  /*    scale      :: Scaling factor between original and hinted edge      */
-  /*                  positions.                                           */
-  /*                                                                       */
-  /*    blue_edge  :: Indicate the blue zone edge this edge is related to. */
-  /*                  Only set for some of the horizontal edges in a latin */
-  /*                  font.                                                */
-  /*                                                                       */
-  /*    link       :: The linked edge.                                     */
-  /*                                                                       */
-  /*    serif      :: The serif edge.                                      */
-  /*                                                                       */
-  /*    num_linked :: The number of other edges that pair to this one.     */
-  /*                                                                       */
-  /*    score      :: Used to score the edge when selecting them.          */
-  /*                                                                       */
-  /*    first      :: The first edge segment.                              */
-  /*                                                                       */
-  /*    last       :: The last edge segment.                               */
-  /*                                                                       */
-  typedef struct  AH_EdgeRec_
-  {
-    FT_Pos         fpos;
-    FT_Pos         opos;
-    FT_Pos         pos;
-
-    AH_Edge_Flags  flags;
-    AH_Direction   dir;
-    FT_Fixed       scale;
-    FT_Pos*        blue_edge;
-
-    AH_Edge        link;
-    AH_Edge        serif;
-    FT_Int         num_linked;
-
-    FT_Int         score;
-
-    AH_Segment     first;
-    AH_Segment     last;
-
-
-  } AH_EdgeRec;
-
-
-  /* an outline as seen by the hinter */
-  typedef struct  AH_OutlineRec_
-  {
-    FT_Memory     memory;
-
-    AH_Direction  vert_major_dir;   /* vertical major direction   */
-    AH_Direction  horz_major_dir;   /* horizontal major direction */
-
-    FT_Fixed      x_scale;
-    FT_Fixed      y_scale;
-    FT_Pos        edge_distance_threshold;
-
-    FT_Int        max_points;
-    FT_Int        num_points;
-    AH_Point      points;
-
-    FT_Int        max_contours;
-    FT_Int        num_contours;
-    AH_Point*     contours;
-
-    FT_Int        num_hedges;
-    AH_Edge       horz_edges;
-
-    FT_Int        num_vedges;
-    AH_Edge       vert_edges;
-
-    FT_Int        num_hsegments;
-    AH_Segment    horz_segments;
-
-    FT_Int        num_vsegments;
-    AH_Segment    vert_segments;
-
-  } AH_OutlineRec, *AH_Outline;
-
-
-#ifdef FT_CONFIG_CHESTER_SMALL_F
-
-#define AH_BLUE_CAPITAL_TOP     0                              /* THEZOCQS */
-#define AH_BLUE_CAPITAL_BOTTOM  ( AH_BLUE_CAPITAL_TOP + 1 )    /* HEZLOCUS */
-#define AH_BLUE_SMALL_F_TOP     ( AH_BLUE_CAPITAL_BOTTOM + 1 ) /* fijkdbh  */
-#define AH_BLUE_SMALL_TOP       ( AH_BLUE_SMALL_F_TOP + 1 )    /* xzroesc  */
-#define AH_BLUE_SMALL_BOTTOM    ( AH_BLUE_SMALL_TOP + 1 )      /* xzroesc  */
-#define AH_BLUE_SMALL_MINOR     ( AH_BLUE_SMALL_BOTTOM + 1 )   /* pqgjy    */
-#define AH_BLUE_MAX             ( AH_BLUE_SMALL_MINOR + 1 )
-
-#else /* !FT_CONFIG_CHESTER_SMALL_F */
-
-#define AH_BLUE_CAPITAL_TOP     0                              /* THEZOCQS */
-#define AH_BLUE_CAPITAL_BOTTOM  ( AH_BLUE_CAPITAL_TOP + 1 )    /* HEZLOCUS */
-#define AH_BLUE_SMALL_TOP       ( AH_BLUE_CAPITAL_BOTTOM + 1 ) /* xzroesc  */
-#define AH_BLUE_SMALL_BOTTOM    ( AH_BLUE_SMALL_TOP + 1 )      /* xzroesc  */
-#define AH_BLUE_SMALL_MINOR     ( AH_BLUE_SMALL_BOTTOM + 1 )   /* pqgjy    */
-#define AH_BLUE_MAX             ( AH_BLUE_SMALL_MINOR + 1 )
-
-#endif /* !FT_CONFIG_CHESTER_SMALL_F */
-
-  typedef FT_Int  AH_Blue;
-
-
-#define AH_HINTER_MONOCHROME  1
-#define AH_HINTER_OPTIMIZE    2
-
-  typedef FT_Int  AH_Hinter_Flags;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    AH_GlobalsRec                                                      */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Holds the global metrics for a given font face (be it in design    */
-  /*    units or scaled pixel values).                                     */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    num_widths  :: The number of widths.                               */
-  /*                                                                       */
-  /*    num_heights :: The number of heights.                              */
-  /*                                                                       */
-  /*    stds        :: A two-element array giving the default stem width   */
-  /*                   and height.                                         */
-  /*                                                                       */
-  /*    widths      :: Snap widths, including standard one.                */
-  /*                                                                       */
-  /*    heights     :: Snap height, including standard one.                */
-  /*                                                                       */
-  /*    blue_refs   :: The reference positions of blue zones.              */
-  /*                                                                       */
-  /*    blue_shoots :: The overshoot positions of blue zones.              */
-  /*                                                                       */
-  typedef struct  AH_GlobalsRec_
-  {
-    FT_Int  num_widths;
-    FT_Int  num_heights;
-
-    FT_Pos  stds[2];
-
-    FT_Pos  widths [AH_MAX_WIDTHS];
-    FT_Pos  heights[AH_MAX_HEIGHTS];
-
-    FT_Pos  blue_refs  [AH_BLUE_MAX];
-    FT_Pos  blue_shoots[AH_BLUE_MAX];
-
-  } AH_GlobalsRec, *AH_Globals;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    AH_Face_GlobalsRec                                                 */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Holds the complete global metrics for a given font face (i.e., the */
-  /*    design units version + a scaled version + the current scales       */
-  /*    used).                                                             */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    face    :: A handle to the source face object                      */
-  /*                                                                       */
-  /*    design  :: The globals in font design units.                       */
-  /*                                                                       */
-  /*    scaled  :: Scaled globals in sub-pixel values.                     */
-  /*                                                                       */
-  /*    x_scale :: The current horizontal scale.                           */
-  /*                                                                       */
-  /*    y_scale :: The current vertical scale.                             */
-  /*                                                                       */
-  /*    control_overshoot ::                                               */
-  /*               Currently unused.                                       */
-  /*                                                                       */
-  typedef struct  AH_Face_GlobalsRec_
-  {
-    FT_Face        face;
-    AH_GlobalsRec  design;
-    AH_GlobalsRec  scaled;
-    FT_Fixed       x_scale;
-    FT_Fixed       y_scale;
-    FT_Bool        control_overshoot;
-
-  } AH_Face_GlobalsRec, *AH_Face_Globals;
-
-
-  typedef struct  AH_HinterRec_
-  {
-    FT_Memory        memory;
-    AH_Hinter_Flags  flags;
-
-    FT_Int           algorithm;
-    FT_Face          face;
-
-    AH_Face_Globals  globals;
-
-    AH_Outline       glyph;
-
-    AH_Loader        loader;
-    FT_Vector        pp1;               /* horizontal phantom points */
-    FT_Vector        pp2;
-    /* we ignore vertical phantom points */
-
-    FT_Bool          transformed;
-    FT_Vector        trans_delta;
-    FT_Matrix        trans_matrix;
-
-    FT_Bool          do_horz_hints;     /* disable X hinting            */
-    FT_Bool          do_vert_hints;     /* disable Y hinting            */
-    FT_Bool          do_horz_snapping;  /* disable X stem size snapping */
-    FT_Bool          do_vert_snapping;  /* disable Y stem size snapping */
-    FT_Bool          do_stem_adjust;    /* disable light stem snapping  */
-
-  } AH_HinterRec, *AH_Hinter;
-
-
-#ifdef DEBUG_HINTER
-  extern AH_Hinter  ah_debug_hinter;
-  extern FT_Bool    ah_debug_disable_horz;
-  extern FT_Bool    ah_debug_disable_vert;
-#else
-#define ah_debug_disable_horz  0
-#define ah_debug_disable_vert  0
-#endif /* DEBUG_HINTER */
-
-
-FT_END_HEADER
-
-#endif /* __AHTYPES_H__ */
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/autohint.c b/reactos/lib/freetype/src/autohint/autohint.c
deleted file mode 100644 (file)
index 3783a82..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  autohint.c                                                             */
-/*                                                                         */
-/*    Automatic Hinting wrapper (body only).                               */
-/*                                                                         */
-/*  Copyright 2000-2001 Catharon Productions Inc.                          */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#define FT_MAKE_OPTION_SINGLE_OBJECT
-
-#include <ft2build.h>
-#include "ahangles.c"
-#include "ahglyph.c"
-#include "ahglobal.c"
-#include "ahhint.c"
-#include "ahmodule.c"
-
-
-/* END */
diff --git a/reactos/lib/freetype/src/autohint/mather.py b/reactos/lib/freetype/src/autohint/mather.py
deleted file mode 100644 (file)
index 8ad8b55..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-#
-
-#
-# autohint math table builder
-#
-
-
-# Copyright 1996-2000 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.
-
-
-import math
-
-ag_pi = 256
-
-def print_arctan( atan_bits ):
-    atan_base = 1 << atan_bits
-
-    print "  static AH_Angle  ag_arctan[1L << AG_ATAN_BITS] ="
-    print "  {"
-
-    count = 0
-    line  = "   "
-
-    for n in range( atan_base ):
-        comma = ","
-        if ( n == atan_base - 1 ):
-            comma = ""
-
-        angle = math.atan( n * 1.0 / atan_base ) / math.pi * ag_pi
-        line  = line + " " + repr( int( angle + 0.5 ) ) + comma
-        count = count + 1;
-        if ( count == 8 ):
-            count = 0
-            print line
-            line = "   "
-
-    if ( count > 0 ):
-        print line
-    print "  };"
-
-
-# This routine is not used currently.
-#
-def print_sines():
-    print "  static FT_Fixed  ah_sines[AG_HALF_PI + 1] ="
-    print "  {"
-
-    count = 0
-    line  = "   "
-
-    for n in range( ag_pi / 2 ):
-        sinus = math.sin( n * math.pi / ag_pi )
-        line  = line + " " + repr( int( 65536.0 * sinus ) ) + ","
-        count = count + 1
-        if ( count == 8 ):
-            count = 0
-            print line
-            line = "   "
-
-    if ( count > 0 ):
-        print line
-    print "   65536"
-    print "  };"
-
-
-print_arctan( 8 )
-print
-
-
-# END
diff --git a/reactos/lib/freetype/src/autohint/module.mk b/reactos/lib/freetype/src/autohint/module.mk
deleted file mode 100644 (file)
index edc9f4e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# FreeType 2 auto-hinter module definition
-#
-
-
-# Copyright 2000 Catharon Productions Inc.
-# Author: David Turner
-#
-# This file is part of the Catharon Typography Project and shall only
-# be used, modified, and distributed under the terms of the Catharon
-# Open Source License that should come with this file under the name
-# `CatharonLicense.txt'.  By continuing to use, modify, or distribute
-# this file you indicate that you have read the license and
-# understand and accept it fully.
-#
-# Note that this license is compatible with the FreeType license.
-
-
-make_module_list: add_autohint_module
-
-add_autohint_module:
-       $(OPEN_DRIVER)autohint_module_class$(CLOSE_DRIVER)
-       $(ECHO_DRIVER)autohint  $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
-
-# EOF
diff --git a/reactos/lib/freetype/src/autohint/rules.mk b/reactos/lib/freetype/src/autohint/rules.mk
deleted file mode 100644 (file)
index ee264e8..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# FreeType 2 auto-hinter module configuration rules
-#
-
-
-# Copyright 2000, 2001, 2002, 2003 Catharon Productions Inc.
-# Author: David Turner
-#
-# This file is part of the Catharon Typography Project and shall only
-# be used, modified, and distributed under the terms of the Catharon
-# Open Source License that should come with this file under the name
-# `CatharonLicense.txt'.  By continuing to use, modify, or distribute
-# this file you indicate that you have read the license and
-# understand and accept it fully.
-#
-# Note that this license is compatible with the FreeType license.
-
-
-# AUTO driver directory
-#
-AUTO_DIR := $(SRC_DIR)/autohint
-
-
-# compilation flags for the driver
-#
-AUTO_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTO_DIR))
-
-
-# AUTO driver sources (i.e., C files)
-#
-AUTO_DRV_SRC := $(AUTO_DIR)/ahangles.c \
-                $(AUTO_DIR)/ahglobal.c \
-                $(AUTO_DIR)/ahglyph.c  \
-                $(AUTO_DIR)/ahhint.c   \
-                $(AUTO_DIR)/ahmodule.c
-
-# AUTO driver headers
-#
-AUTO_DRV_H := $(AUTO_DRV_SRC:%c=%h)  \
-              $(AUTO_DIR)/ahloader.h \
-              $(AUTO_DIR)/ahtypes.h  \
-              $(AUTO_DIR)/aherrors.h
-
-
-# AUTO driver object(s)
-#
-#   AUTO_DRV_OBJ_M is used during `multi' builds.
-#   AUTO_DRV_OBJ_S is used during `single' builds.
-#
-AUTO_DRV_OBJ_M := $(AUTO_DRV_SRC:$(AUTO_DIR)/%.c=$(OBJ_DIR)/%.$O)
-AUTO_DRV_OBJ_S := $(OBJ_DIR)/autohint.$O
-
-# AUTO driver source file for single build
-#
-AUTO_DRV_SRC_S := $(AUTO_DIR)/autohint.c
-
-
-# AUTO driver - single object
-#
-$(AUTO_DRV_OBJ_S): $(AUTO_DRV_SRC_S) $(AUTO_DRV_SRC) \
-                   $(FREETYPE_H) $(AUTO_DRV_H)
-       $(AUTO_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(AUTO_DRV_SRC_S))
-
-
-# AUTO driver - multiple objects
-#
-$(OBJ_DIR)/%.$O: $(AUTO_DIR)/%.c $(FREETYPE_H) $(AUTO_DRV_H)
-       $(AUTO_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
-
-
-# update main driver object lists
-#
-DRV_OBJS_S += $(AUTO_DRV_OBJ_S)
-DRV_OBJS_M += $(AUTO_DRV_OBJ_M)
-
-
-# EOF
index d82e65d..6ac9b63 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/base Jamfile (c) 2001, 2002, 2003, 2004 David Turner
+# FreeType 2 src/base Jamfile
 #
+# Copyright 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.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) base ;
 
@@ -10,7 +18,7 @@ SubDir  FT2_TOP $(FT2_SRC_DIR) base ;
   if $(FT2_MULTI)
   {
     _sources = ftutil ftdbgmem ftstream ftcalc fttrigon ftgloadr ftoutln
-               ftobjs ftnames ftrfork ;
+               ftobjs ftnames  ftrfork  ;
   }
   else
   {
@@ -24,7 +32,7 @@ SubDir  FT2_TOP $(FT2_SRC_DIR) base ;
 #
 Library  $(FT2_LIB) : ftsystem.c   ftinit.c    ftglyph.c  ftmm.c     ftbdf.c
                       ftbbox.c     ftdebug.c   ftxf86.c   fttype1.c  ftpfr.c
-                      ftstroke.c   ftwinfnt.c ;
+                      ftstroke.c   ftwinfnt.c  ftotval.c  ftbitmap.c ;
 
 # Add Macintosh-specific file to the library when necessary.
 #
index d2f133d..fec27e2 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing BDF-specific strings (body).              */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -21,6 +21,8 @@
 #include FT_SERVICE_BDF_H
 
 
+  /* documentation is in ftbdf.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Get_BDF_Charset_ID( FT_Face       face,
                          const char*  *acharset_encoding,
@@ -54,6 +56,8 @@
   }
 
 
+  /* documentation is in ftbdf.h */
+
   FT_EXPORT( FT_Error )
   FT_Get_BDF_Property( FT_Face           face,
                        const char*       prop_name,
diff --git a/reactos/lib/freetype/src/base/ftbitmap.c b/reactos/lib/freetype/src/base/ftbitmap.c
new file mode 100644 (file)
index 0000000..6de4aac
--- /dev/null
@@ -0,0 +1,616 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ftbitmap.c                                                             */\r
+/*                                                                         */\r
+/*    FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */\r
+/*    bitmaps into 8bpp format (body).                                     */\r
+/*                                                                         */\r
+/*  Copyright 2004, 2005 by                                                */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_BITMAP_H\r
+#include FT_INTERNAL_OBJECTS_H\r
+\r
+\r
+  static\r
+  const FT_Bitmap  null_bitmap = { 0, 0, 0, 0, 0, 0, 0, 0 };\r
+\r
+\r
+  /* documentation is in ftbitmap.h */\r
+\r
+  FT_EXPORT_DEF( void )\r
+  FT_Bitmap_New( FT_Bitmap  *abitmap )\r
+  {\r
+    *abitmap = null_bitmap;\r
+  }\r
+\r
+\r
+  /* documentation is in ftbitmap.h */\r
+\r
+  FT_EXPORT_DEF( FT_Error )\r
+  FT_Bitmap_Copy( FT_Library        library,\r
+                  const FT_Bitmap  *source,\r
+                  FT_Bitmap        *target)\r
+  {\r
+    FT_Memory  memory = library->memory;\r
+    FT_Error   error  = FT_Err_Ok;\r
+    FT_Int     pitch  = source->pitch;\r
+    FT_ULong   size;\r
+\r
+\r
+    if ( source == target )\r
+      return FT_Err_Ok;\r
+\r
+    if ( source->buffer == NULL )\r
+    {\r
+      *target = *source;\r
+\r
+      return FT_Err_Ok;\r
+    }\r
+\r
+    if ( pitch < 0 )\r
+      pitch = -pitch;\r
+    size = (FT_ULong)( pitch * source->rows );\r
+\r
+    if ( target->buffer )\r
+    {\r
+      FT_Int    target_pitch = target->pitch;\r
+      FT_ULong  target_size;\r
+\r
+\r
+      if ( target_pitch < 0  )\r
+        target_pitch = -target_pitch;\r
+      target_size = (FT_ULong)( target_pitch * target->rows );\r
+\r
+      if ( target_size != size )\r
+        FT_QREALLOC( target->buffer, target_size, size );\r
+    }\r
+    else\r
+      FT_QALLOC( target->buffer, size );\r
+\r
+    if ( !error )\r
+    {\r
+      unsigned char *p;\r
+\r
+\r
+      p = target->buffer;\r
+      *target = *source;\r
+      target->buffer = p;\r
+\r
+      FT_MEM_COPY( target->buffer, source->buffer, size );\r
+    }\r
+\r
+    return error;\r
+  }\r
+\r
+\r
+  static FT_Error\r
+  ft_bitmap_assure_buffer( FT_Memory   memory,\r
+                           FT_Bitmap*  bitmap,\r
+                           FT_UInt     xpixels,\r
+                           FT_UInt     ypixels )\r
+  {\r
+    FT_Error        error;\r
+    int             pitch;\r
+    int             new_pitch;\r
+    FT_UInt         ppb;\r
+    FT_Int          i;\r
+    unsigned char*  buffer;\r
+\r
+\r
+    pitch = bitmap->pitch;\r
+    if ( pitch < 0 )\r
+      pitch = -pitch;\r
+\r
+    switch ( bitmap->pixel_mode )\r
+    {\r
+    case FT_PIXEL_MODE_MONO:\r
+      ppb = 8;\r
+      break;\r
+    case FT_PIXEL_MODE_GRAY2:\r
+      ppb = 4;\r
+      break;\r
+    case FT_PIXEL_MODE_GRAY4:\r
+      ppb = 2;\r
+      break;\r
+    case FT_PIXEL_MODE_GRAY:\r
+    case FT_PIXEL_MODE_LCD:\r
+    case FT_PIXEL_MODE_LCD_V:\r
+      ppb = 1;\r
+      break;\r
+    default:\r
+      return FT_Err_Invalid_Glyph_Format;\r
+    }\r
+\r
+    /* if no need to allocate memory */\r
+    if ( ypixels == 0 && pitch * ppb >= bitmap->width + xpixels )\r
+    {\r
+      /* zero the padding */\r
+      for ( i = 0; i < bitmap->rows; i++ )\r
+      {\r
+        unsigned char*  last_byte;\r
+        int             bits = xpixels * ( 8 / ppb );\r
+        int             mask = 0;\r
+\r
+\r
+        last_byte = bitmap->buffer + i * pitch + ( bitmap->width - 1 ) / ppb;\r
+\r
+        if ( bits >= 8 )\r
+        {\r
+          FT_MEM_ZERO( last_byte + 1, bits / 8 );\r
+          bits %= 8;\r
+        }\r
+\r
+        if ( bits > 0 )\r
+        {\r
+          while ( bits-- > 0 )\r
+            mask |= 1 << bits;\r
+\r
+          *last_byte &= ~mask;\r
+        }\r
+      }\r
+\r
+      return FT_Err_Ok;\r
+    }\r
+\r
+    new_pitch = ( bitmap->width + xpixels + ppb - 1 ) / ppb;\r
+\r
+    if ( FT_ALLOC( buffer, new_pitch * ( bitmap->rows + ypixels ) ) )\r
+      return error;\r
+\r
+    if ( bitmap->pitch > 0 )\r
+    {\r
+      for ( i = 0; i < bitmap->rows; i++ )\r
+        FT_MEM_COPY( buffer + new_pitch * ( ypixels + i ),\r
+                     bitmap->buffer + pitch * i, pitch );\r
+    }\r
+    else\r
+    {\r
+      for ( i = 0; i < bitmap->rows; i++ )\r
+        FT_MEM_COPY( buffer + new_pitch * i,\r
+                     bitmap->buffer + pitch * i, pitch );\r
+    }\r
+\r
+    FT_FREE( bitmap->buffer );\r
+    bitmap->buffer = buffer;\r
+\r
+    if ( bitmap->pitch < 0 )\r
+      new_pitch = -new_pitch;\r
+\r
+    /* set pitch only */\r
+    bitmap->pitch = new_pitch;\r
+\r
+    return FT_Err_Ok;\r
+  }\r
+\r
+\r
+  /* documentation is in ftbitmap.h */\r
+\r
+  FT_EXPORT_DEF( FT_Error )\r
+  FT_Bitmap_Embolden( FT_Library  library,\r
+                      FT_Bitmap*  bitmap,\r
+                      FT_Pos      xStrength,\r
+                      FT_Pos      yStrength )\r
+  {\r
+    FT_Error        error;\r
+    unsigned char*  p;\r
+    FT_Int          i, x, y, pitch;\r
+    FT_Int          xstr, ystr;\r
+\r
+\r
+    if ( !library )\r
+      return FT_Err_Invalid_Library_Handle;\r
+\r
+    if ( !bitmap || !bitmap->buffer )\r
+      return FT_Err_Invalid_Argument;\r
+\r
+    xstr = FT_PIX_ROUND( xStrength ) >> 6;\r
+    ystr = FT_PIX_ROUND( yStrength ) >> 6;\r
+\r
+    if ( xstr == 0 && ystr == 0 )\r
+      return FT_Err_Ok;\r
+    else if ( xstr < 0 || ystr < 0 )\r
+      return FT_Err_Invalid_Argument;\r
+\r
+    switch ( bitmap->pixel_mode )\r
+    {\r
+    case FT_PIXEL_MODE_GRAY2:\r
+    case FT_PIXEL_MODE_GRAY4:\r
+      {\r
+        FT_Bitmap  tmp;\r
+        FT_Int     align;\r
+\r
+\r
+        if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY2 )\r
+          align = ( bitmap->width + xstr + 3 ) / 4;\r
+        else\r
+          align = ( bitmap->width + xstr + 1 ) / 2;\r
+\r
+        FT_Bitmap_New( &tmp );\r
+        error = FT_Bitmap_Convert( library, bitmap, &tmp, align );\r
+\r
+        if ( error )\r
+          return error;\r
+\r
+        FT_Bitmap_Done( library, bitmap );\r
+        *bitmap = tmp;\r
+      }\r
+      break;\r
+\r
+    case FT_PIXEL_MODE_MONO:\r
+      if ( xstr > 8 )\r
+        xstr = 8;\r
+      break;\r
+\r
+    case FT_PIXEL_MODE_LCD:\r
+      xstr *= 3;\r
+      break;\r
+\r
+    case FT_PIXEL_MODE_LCD_V:\r
+      ystr *= 3;\r
+      break;\r
+    }\r
+\r
+    error = ft_bitmap_assure_buffer( library->memory, bitmap, xstr, ystr );\r
+    if ( error )\r
+      return error;\r
+\r
+    pitch = bitmap->pitch;\r
+    if ( pitch > 0 )\r
+      p = bitmap->buffer + pitch * ystr;\r
+    else\r
+    {\r
+      pitch = -pitch;\r
+      p = bitmap->buffer + pitch * ( bitmap->rows - 1 );\r
+    }\r
+\r
+    /* for each row */\r
+    for ( y = 0; y < bitmap->rows ; y++ )\r
+    {\r
+      /* \r
+       * Horizontally:\r
+       *\r
+       * From the last pixel on, make each pixel or'ed with the\r
+       * `xstr' pixels before it.\r
+       */\r
+      for ( x = pitch - 1; x >= 0; x-- )\r
+      {\r
+        unsigned char tmp;\r
+\r
+\r
+        tmp = p[x];\r
+        for ( i = 1; i <= xstr; i++ )\r
+        {\r
+          if ( bitmap->pixel_mode == FT_PIXEL_MODE_MONO )\r
+          {\r
+            p[x] |= tmp >> i;\r
+\r
+            /* the maximum value of 8 for `xstr' comes from here */\r
+            if ( x > 0 )\r
+              p[x] |= p[x - 1] << ( 8 - i );\r
+\r
+#if 0\r
+            if ( p[x] == 0xff )\r
+              break;\r
+#endif\r
+          }\r
+          else\r
+          {\r
+            if ( x - i >= 0 )\r
+            {\r
+              if ( p[x] + p[x - i] > bitmap->num_grays - 1 )\r
+              {\r
+                p[x] = bitmap->num_grays - 1;\r
+                break;\r
+              }\r
+              else\r
+              {\r
+                p[x] += p[x - i];\r
+                if ( p[x] == bitmap->num_grays - 1 )\r
+                  break;\r
+              }\r
+            }\r
+            else\r
+              break;\r
+          }\r
+        }\r
+      }\r
+\r
+      /* \r
+       * Vertically:\r
+       *\r
+       * Make the above `ystr' rows or'ed with it.\r
+       */\r
+      for ( x = 1; x <= ystr; x++ )\r
+      {\r
+        unsigned char*  q;\r
+\r
+\r
+        q = p - bitmap->pitch * x;\r
+        for ( i = 0; i < pitch; i++ )\r
+          q[i] |= p[i];\r
+      }\r
+\r
+      p += bitmap->pitch;\r
+    }\r
+\r
+    bitmap->width += xstr;\r
+    bitmap->rows += ystr;\r
+\r
+    return FT_Err_Ok;\r
+  }\r
+\r
+\r
+  /* documentation is in ftbitmap.h */\r
+\r
+  FT_EXPORT_DEF( FT_Error )\r
+  FT_Bitmap_Convert( FT_Library        library,\r
+                     const FT_Bitmap  *source,\r
+                     FT_Bitmap        *target,\r
+                     FT_Int            alignment )\r
+  {\r
+    FT_Error   error = FT_Err_Ok;\r
+    FT_Memory  memory;\r
+\r
+\r
+    if ( !library )\r
+      return FT_Err_Invalid_Library_Handle;\r
+\r
+    memory = library->memory;\r
+\r
+    switch ( source->pixel_mode )\r
+    {\r
+    case FT_PIXEL_MODE_MONO:\r
+    case FT_PIXEL_MODE_GRAY:\r
+    case FT_PIXEL_MODE_GRAY2:\r
+    case FT_PIXEL_MODE_GRAY4:\r
+      {\r
+        FT_Int   pad;\r
+        FT_Long  old_size;\r
+\r
+\r
+        old_size = target->rows * target->pitch;\r
+        if ( old_size < 0 )\r
+          old_size = -old_size;\r
+\r
+        target->pixel_mode = FT_PIXEL_MODE_GRAY;\r
+        target->rows       = source->rows;\r
+        target->width      = source->width;\r
+\r
+        pad = 0;\r
+        if ( alignment > 0 )\r
+        {\r
+          pad = source->width % alignment;\r
+          if ( pad != 0 )\r
+            pad = alignment - pad;\r
+        }\r
+\r
+        target->pitch = source->width + pad;\r
+\r
+        if ( target->rows * target->pitch > old_size             &&\r
+             FT_QREALLOC( target->buffer,\r
+                          old_size, target->rows * target->pitch ) )\r
+          return error;\r
+      }\r
+      break;\r
+\r
+    default:\r
+      error = FT_Err_Invalid_Argument;\r
+    }\r
+\r
+    switch ( source->pixel_mode )\r
+    {\r
+    case FT_PIXEL_MODE_MONO:\r
+      {\r
+        FT_Byte*  s = source->buffer;\r
+        FT_Byte*  t = target->buffer;\r
+        FT_Int    i;\r
+\r
+\r
+        target->num_grays = 2;\r
+\r
+        for ( i = source->rows; i > 0; i-- )\r
+        {\r
+          FT_Byte*  ss = s;\r
+          FT_Byte*  tt = t;\r
+          FT_Int    j;\r
+\r
+\r
+          /* get the full bytes */\r
+          for ( j = source->width >> 3; j > 0; j-- )\r
+          {\r
+            FT_Int  val = ss[0]; /* avoid a byte->int cast on each line */\r
+\r
+\r
+            tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7 );\r
+            tt[1] = (FT_Byte)( ( val & 0x40 ) >> 6 );\r
+            tt[2] = (FT_Byte)( ( val & 0x20 ) >> 5 );\r
+            tt[3] = (FT_Byte)( ( val & 0x10 ) >> 4 );\r
+            tt[4] = (FT_Byte)( ( val & 0x08 ) >> 3 );\r
+            tt[5] = (FT_Byte)( ( val & 0x04 ) >> 2 );\r
+            tt[6] = (FT_Byte)( ( val & 0x02 ) >> 1 );\r
+            tt[7] = (FT_Byte)(   val & 0x01 );\r
+\r
+            tt += 8;\r
+            ss += 1;\r
+          }\r
+\r
+          /* get remaining pixels (if any) */\r
+          j = source->width & 7;\r
+          if ( j > 0 )\r
+          {\r
+            FT_Int  val = *ss;\r
+\r
+\r
+            for ( ; j > 0; j-- )\r
+            {\r
+              tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7);\r
+              val <<= 1;\r
+              tt   += 1;\r
+            }\r
+          }\r
+\r
+          s += source->pitch;\r
+          t += target->pitch;\r
+        }\r
+      }\r
+      break;\r
+\r
+\r
+    case FT_PIXEL_MODE_GRAY:\r
+      {\r
+        FT_Int    width   = source->width;\r
+        FT_Byte*  s       = source->buffer;\r
+        FT_Byte*  t       = target->buffer;\r
+        FT_Int    s_pitch = source->pitch;\r
+        FT_Int    t_pitch = target->pitch;\r
+        FT_Int    i;\r
+\r
+\r
+        target->num_grays = 256;\r
+\r
+        for ( i = source->rows; i > 0; i-- )\r
+        {\r
+          FT_ARRAY_COPY( t, s, width );\r
+\r
+          s += s_pitch;\r
+          t += t_pitch;\r
+        }\r
+      }\r
+      break;\r
+\r
+\r
+    case FT_PIXEL_MODE_GRAY2:\r
+      {\r
+        FT_Byte*  s = source->buffer;\r
+        FT_Byte*  t = target->buffer;\r
+        FT_Int    i;\r
+\r
+\r
+        target->num_grays = 4;\r
+\r
+        for ( i = source->rows; i > 0; i-- )\r
+        {\r
+          FT_Byte*  ss = s;\r
+          FT_Byte*  tt = t;\r
+          FT_Int    j;\r
+\r
+\r
+          /* get the full bytes */\r
+          for ( j = source->width >> 2; j > 0; j-- )\r
+          {\r
+            FT_Int  val = ss[0];\r
+\r
+\r
+            tt[0] = (FT_Byte)( ( val & 0xC0 ) >> 6 );\r
+            tt[1] = (FT_Byte)( ( val & 0x30 ) >> 4 );\r
+            tt[2] = (FT_Byte)( ( val & 0x0C ) >> 2 );\r
+            tt[3] = (FT_Byte)( ( val & 0x03 ) );\r
+\r
+            ss += 1;\r
+            tt += 4;\r
+          }\r
+\r
+          j = source->width & 3;\r
+          if ( j > 0 )\r
+          {\r
+            FT_Int  val = ss[0];\r
+\r
+\r
+            for ( ; j > 0; j-- )\r
+            {\r
+              tt[0]  = (FT_Byte)( ( val & 0xC0 ) >> 6 );\r
+              val  <<= 2;\r
+              tt    += 1;\r
+            }\r
+          }\r
+\r
+          s += source->pitch;\r
+          t += target->pitch;\r
+        }\r
+      }\r
+      break;\r
+\r
+\r
+    case FT_PIXEL_MODE_GRAY4:\r
+      {\r
+        FT_Byte*  s = source->buffer;\r
+        FT_Byte*  t = target->buffer;\r
+        FT_Int    i;\r
+\r
+\r
+        target->num_grays = 16;\r
+\r
+        for ( i = source->rows; i > 0; i-- )\r
+        {\r
+          FT_Byte*  ss = s;\r
+          FT_Byte*  tt = t;\r
+          FT_Int    j;\r
+\r
+\r
+          /* get the full bytes */\r
+          for ( j = source->width >> 1; j > 0; j-- )\r
+          {\r
+            FT_Int  val = ss[0];\r
+\r
+\r
+            tt[0] = (FT_Byte)( ( val & 0xF0 ) >> 4 );\r
+            tt[1] = (FT_Byte)( ( val & 0x0F ) );\r
+\r
+            ss += 1;\r
+            tt += 2;\r
+          }\r
+\r
+          if ( source->width & 1 )\r
+            tt[0] = (FT_Byte)( ( ss[0] & 0xF0 ) >> 4 );\r
+\r
+          s += source->pitch;\r
+          t += target->pitch;\r
+        }\r
+      }\r
+      break;\r
+\r
+\r
+    default:\r
+      ;\r
+    }\r
+\r
+    return error;\r
+  }\r
+\r
+\r
+  /* documentation is in ftbitmap.h */\r
+\r
+  FT_EXPORT_DEF( FT_Error )\r
+  FT_Bitmap_Done( FT_Library  library,\r
+                  FT_Bitmap  *bitmap )\r
+  {\r
+    FT_Memory  memory;\r
+\r
+\r
+    if ( !library )\r
+      return FT_Err_Invalid_Library_Handle;\r
+\r
+    if ( !bitmap )\r
+      return FT_Err_Invalid_Argument;\r
+\r
+    memory = library->memory;\r
+\r
+    FT_FREE( bitmap->buffer );\r
+    *bitmap = null_bitmap;\r
+\r
+    return FT_Err_Ok;\r
+  }\r
+\r
+\r
+/* END */\r
index f169642..6e19e55 100644 (file)
 #endif /* FT_LONG64 */
 
 
-  /* a not-so-fast but working 16.16 fixed point square root function */
+  /* documentation is in ftcalc.h */
 
   FT_EXPORT_DEF( FT_Int32 )
   FT_SqrtFixed( FT_Int32  x )
index 61227b6..2442a41 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Memory debugger (body).                                              */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004 by                                    */
+/*  Copyright 2001, 2002, 2003, 2004, 2005 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #ifdef FT_DEBUG_MEMORY
 
+#define  KEEPALIVE /* `Keep alive' means that freed blocks aren't released
+                    * to the heap.  This is useful to detect double-frees
+                    * or weird heap corruption, but it uses large amounts of
+                    * memory, however.
+                    */
 
 #include <stdio.h>
 #include <stdlib.h>
 
 
-  typedef struct FT_MemNodeRec_*   FT_MemNode;
-  typedef struct FT_MemTableRec_*  FT_MemTable;
+  extern void
+  FT_DumpMemory( FT_Memory  memory );
+
+
+  typedef struct FT_MemSourceRec_*  FT_MemSource;
+  typedef struct FT_MemNodeRec_*    FT_MemNode;
+  typedef struct FT_MemTableRec_*   FT_MemTable;
+
 
 #define FT_MEM_VAL( addr )  ((FT_ULong)(FT_Pointer)( addr ))
 
+
+  typedef struct FT_MemSourceRec_
+  {
+    const char*   file_name;
+    long          line_no;
+
+    FT_Long       cur_blocks;   /* current number of allocated blocks */
+    FT_Long       max_blocks;   /* max. number of allocated blocks    */
+    FT_Long       all_blocks;   /* total number of blocks allocated   */
+
+    FT_Long       cur_size;     /* current cumulative allocated size */
+    FT_Long       max_size;     /* maximum cumulative allocated size */
+    FT_Long       all_size;     /* total cumulative allocated size   */
+
+    FT_Long       cur_max;      /* current maximum allocated size */
+
+    FT_UInt32     hash;
+    FT_MemSource  link;
+
+  } FT_MemSourceRec;
+
+
+/*
+ *  We don't need a resizable array for the memory sources, because
+ *  their number is pretty limited within FreeType.
+ */
+#define FT_MEM_SOURCE_BUCKETS  128
+
+
   typedef struct  FT_MemNodeRec_
   {
-    FT_Byte*     address;
-    FT_Long      size;     /* < 0 if the block was freed */
+    FT_Byte*      address;
+    FT_Long       size;     /* < 0 if the block was freed */
 
-    const char*  alloc_file_name;
-    FT_Long      alloc_line_no;
+    FT_MemSource  source;
 
-    const char*  free_file_name;
-    FT_Long      free_line_no;
+#ifdef KEEPALIVE
+    const char*   free_file_name;
+    FT_Long       free_line_no;
+#endif
 
-    FT_MemNode   link;
+    FT_MemNode    link;
 
   } FT_MemNodeRec;
 
     FT_ULong         alloc_max;
     FT_ULong         alloc_count;
 
-    FT_Bool          bound_total;    
+    FT_Bool          bound_total;
     FT_ULong         alloc_total_max;
-    
+
     FT_Bool          bound_count;
     FT_ULong         alloc_count_max;
 
+    FT_MemSource     sources[FT_MEM_SOURCE_BUCKETS];
+
     const char*      file_name;
     FT_Long          line_no;
 
+    FT_Bool          keep_alive;
+
     FT_Memory        memory;
     FT_Pointer       memory_user;
     FT_Alloc_Func    alloc;
 #define FT_FILENAME( x )  ((x) ? (x) : "unknown file")
 
 
+ /*
+  *  Prime numbers are ugly to handle.  It would be better to implement
+  *  L-Hashing, which is 10% faster and doesn't require divisions.
+  */
   static const FT_UInt  ft_mem_primes[] =
   {
     7,
   };
 
 
+  static FT_ULong
+  ft_mem_closest_prime( FT_ULong  num )
+  {
+    FT_UInt  i;
+
+
+    for ( i = 0;
+          i < sizeof ( ft_mem_primes ) / sizeof ( ft_mem_primes[0] ); i++ )
+      if ( ft_mem_primes[i] > num )
+        return ft_mem_primes[i];
+
+    return FT_MEM_SIZE_MAX;
+  }
+
 
   extern void
-  ft_mem_debug_panic( const char*  fmt, ... )
+  ft_mem_debug_panic( const char*  fmt,
+                      ... )
   {
     va_list  ap;
 
   }
 
 
-  static FT_ULong
-  ft_mem_closest_prime( FT_ULong  num )
-  {
-    FT_UInt  i;
-
-
-    for ( i = 0;
-          i < sizeof ( ft_mem_primes ) / sizeof ( ft_mem_primes[0] ); i++ )
-      if ( ft_mem_primes[i] > num )
-        return ft_mem_primes[i];
-
-    return FT_MEM_SIZE_MAX;
-  }
-
-
   static FT_Pointer
   ft_mem_table_alloc( FT_MemTable  table,
                       FT_Long      size )
     new_size = ft_mem_closest_prime( table->nodes );
     if ( new_size != table->size )
     {
-      FT_MemNode*  new_buckets ;
+      FT_MemNode*  new_buckets;
       FT_ULong     i;
 
 
       new_buckets = (FT_MemNode *)
-                    ft_mem_table_alloc( table,
-                                        new_size * sizeof ( FT_MemNode ) );
+                      ft_mem_table_alloc( table,
+                                          new_size * sizeof ( FT_MemNode ) );
       if ( new_buckets == NULL )
         return;
 
-      FT_MEM_ZERO( new_buckets, sizeof ( FT_MemNode ) * new_size );
+      FT_ARRAY_ZERO( new_buckets, new_size );
 
       for ( i = 0; i < table->size; i++ )
       {
     if ( table == NULL )
       goto Exit;
 
-    FT_MEM_ZERO( table, sizeof ( *table ) );
+    FT_ZERO( table );
 
     table->size  = FT_MEM_SIZE_MIN;
     table->nodes = 0;
     table->free    = memory->free;
 
     table->buckets = (FT_MemNode *)
-                     memory->alloc( memory,
-                                    table->size * sizeof ( FT_MemNode ) );
+                       memory->alloc( memory,
+                                      table->size * sizeof ( FT_MemNode ) );
     if ( table->buckets )
-      FT_MEM_ZERO( table->buckets, sizeof ( FT_MemNode ) * table->size );
+      FT_ARRAY_ZERO( table->buckets, table->size );
     else
     {
       memory->free( memory, table );
     FT_ULong  i;
 
 
+    FT_DumpMemory( table->memory );
+
     if ( table )
     {
       FT_Long    leak_count = 0;
       FT_ULong   leaks = 0;
 
-
+      /* remove all blocks from the table, revealing leaked ones */
       for ( i = 0; i < table->size; i++ )
       {
         FT_MemNode  *pnode = table->buckets + i, next, node = *pnode;
             printf(
               "leaked memory block at address %p, size %8ld in (%s:%ld)\n",
               node->address, node->size,
-              FT_FILENAME( node->alloc_file_name ),
-              node->alloc_line_no );
+              FT_FILENAME( node->source->file_name ),
+              node->source->line_no );
 
             leak_count++;
             leaks += node->size;
           node->address = NULL;
           node->size    = 0;
 
-          free( node );
+          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;
 
+      /* 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;
+      }
+
       printf(
         "FreeType: total memory allocations = %ld\n", table->alloc_total );
       printf(
         "FreeType: maximum memory footprint = %ld\n", table->alloc_max );
 
-      free( table );
+      ft_mem_table_free( table, table );
 
       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" );
     }
   }
   }
 
 
+  static FT_MemSource
+  ft_mem_table_get_source( FT_MemTable  table )
+  {
+    FT_UInt32     hash;
+    FT_MemSource  node, *pnode;
+
+
+    hash  = (FT_UInt32)(void*)table->file_name +
+              (FT_UInt32)( 5 * table->line_no );
+    pnode = &table->sources[hash % FT_MEM_SOURCE_BUCKETS];
+
+    for ( ;; )
+    {
+      node = *pnode;
+      if ( node == NULL )
+        break;
+
+      if ( node->file_name == table->file_name &&
+           node->line_no   == table->line_no   )
+        goto Exit;
+
+      pnode = &node->link;
+    }
+
+    node = (FT_MemSource)ft_mem_table_alloc( table, sizeof ( *node ) );
+    if ( node == NULL )
+      ft_mem_debug_panic(
+        "not enough memory to perform memory debugging\n" );
+
+    node->file_name = table->file_name;
+    node->line_no   = table->line_no;
+
+    node->cur_blocks = 0;
+    node->max_blocks = 0;
+    node->all_blocks = 0;
+
+    node->cur_size   = 0;
+    node->max_size   = 0;
+    node->all_size   = 0;
+
+    node->cur_max    = 0;
+
+    node->link = NULL;
+    node->hash = hash;
+    *pnode     = node;
+
+  Exit:
+    return node;
+  }
+
+
   static void
   ft_mem_table_set( FT_MemTable  table,
                     FT_Byte*     address,
 
     if ( table )
     {
+      FT_MemSource  source;
+
+
       pnode = ft_mem_table_get_nodep( table, address );
       node  = *pnode;
       if ( node )
       {
         if ( node->size < 0 )
         {
-          /* this block was already freed.  This means that our memory is */
-          /* now completely corrupted!                                    */
+          /* This block was already freed.  Our memory is now completely */
+          /* corrupted!                                                  */
+          /* This can only happen in keep-alive mode.                    */
           ft_mem_debug_panic(
             "memory heap corrupted (allocating freed block)" );
         }
         else
         {
-          /* this block was already allocated.  This means that our memory */
+          /* This block was already allocated.  This means that our memory */
           /* is also corrupted!                                            */
           ft_mem_debug_panic(
-            "memory heap corrupted (re-allocating allocated block)" );
+            "memory heap corrupted (re-allocating allocated block at"
+            " %p, of size %ld)\n"
+            "org=%s:%d new=%s:%d\n",
+            node->address, node->size,
+            FT_FILENAME( node->source->file_name ), node->source->line_no,
+            FT_FILENAME( table->file_name ), table->line_no );
         }
       }
 
       node->address = address;
       node->size    = size;
 
-      node->alloc_file_name = table->file_name;
-      node->alloc_line_no   = table->line_no;
+      node->source = source = ft_mem_table_get_source( table );
+
+      source->all_blocks++;
+      source->cur_blocks++;
+      if ( source->cur_blocks > source->max_blocks )
+        source->max_blocks = source->cur_blocks;
+
+      if ( size > (FT_ULong)source->cur_max )
+        source->cur_max = size;
+
+      source->all_size += size;
+      source->cur_size += size;
+      if ( source->cur_size > source->max_size )
+        source->max_size = source->cur_size;
 
       node->free_file_name = NULL;
       node->free_line_no   = 0;
       node  = *pnode;
       if ( node )
       {
+        FT_MemSource  source;
+
+
         if ( node->size < 0 )
           ft_mem_debug_panic(
             "freeing memory block at %p more than once at (%s:%ld)\n"
             "block allocated at (%s:%ld) and released at (%s:%ld)",
             address,
             FT_FILENAME( table->file_name ), table->line_no,
-            FT_FILENAME( node->alloc_file_name ), node->alloc_line_no,
+            FT_FILENAME( node->source->file_name ), node->source->line_no,
             FT_FILENAME( node->free_file_name ), node->free_line_no );
 
-        /* we simply invert the node's size to indicate that the node */
-        /* was freed.  We also change its contents.                   */
+        /* scramble the node's content for additional safety */
         FT_MEM_SET( address, 0xF3, node->size );
-
         table->alloc_current -= node->size;
-        node->size            = -node->size;
-        node->free_file_name  = table->file_name;
-        node->free_line_no    = table->line_no;
+
+        source = node->source;
+
+        source->cur_blocks--;
+        source->cur_size -= node->size;
+
+        if ( table->keep_alive )
+        {
+          /* we simply invert the node's size to indicate that the node */
+          /* was freed.                                                 */
+          node->size           = -node->size;
+          node->free_file_name = table->file_name;
+          node->free_line_no   = table->line_no;
+        }
+        else
+        {
+          table->nodes--;
+
+          *pnode = node->link;
+
+          node->size   = 0;
+          node->source = NULL;
+
+          ft_mem_table_free( table, node );
+
+          if ( table->nodes * 3 < table->size  ||
+               table->size  * 3 < table->nodes )
+            ft_mem_table_resize( table );
+        }
       }
       else
         ft_mem_debug_panic(
       ft_mem_debug_panic( "negative block size allocation (%ld)", size );
 
     /* return NULL if the maximum number of allocations was reached */
-    if ( table->bound_count &&
+    if ( table->bound_count                           &&
          table->alloc_count >= table->alloc_count_max )
       return NULL;
 
     /* return NULL if this allocation would overflow the maximum heap size */
-    if ( table->bound_total && 
+    if ( table->bound_total                                             &&
          table->alloc_current + (FT_ULong)size > table->alloc_total_max )
-      return NULL;         
+      return NULL;
 
     block = (FT_Byte *)ft_mem_table_alloc( table, size );
     if ( block )
     table->file_name = NULL;
     table->line_no   = 0;
 
-    return (FT_Pointer) block;
+    return (FT_Pointer)block;
   }
 
 
 
     ft_mem_table_remove( table, (FT_Byte*)block );
 
-    /* we never really free the block */
+    if ( !table->keep_alive )
+      ft_mem_table_free( table, block );
+
+    table->alloc_count--;
+
     table->file_name = NULL;
     table->line_no   = 0;
   }
 #endif
 
     /* while the following is allowed in ANSI C also, we abort since */
-    /* such code shouldn't be in FreeType...                         */
+    /* such case should be handled by FreeType.                      */
     if ( new_size <= 0 )
       ft_mem_debug_panic(
         "trying to reallocate %p to size 0 (current is %ld) in (%s:%ld)",
         block, cur_size, file_name, line_no );
 
-    /* check 'cur_size' value */
+    /* check `cur_size' value */
     pnode = ft_mem_table_get_nodep( table, (FT_Byte*)block );
     node  = *pnode;
     if ( !node )
       if ( table )
       {
         const char*  p;
-        
+
+
         memory->user    = table;
         memory->alloc   = ft_mem_debug_alloc;
         memory->realloc = ft_mem_debug_realloc;
         memory->free    = ft_mem_debug_free;
-        
+
         p = getenv( "FT2_ALLOC_TOTAL_MAX" );
         if ( p != NULL )
         {
-          FT_Long   total_max = ft_atol(p);
-          
+          FT_Long   total_max = ft_atol( p );
+
+
           if ( total_max > 0 )
           {
             table->bound_total     = 1;
-            table->alloc_total_max = (FT_ULong) total_max;
+            table->alloc_total_max = (FT_ULong)total_max;
           }
         }
-        
+
         p = getenv( "FT2_ALLOC_COUNT_MAX" );
         if ( p != NULL )
         {
-          FT_Long  total_count = ft_atol(p);
-          
+          FT_Long  total_count = ft_atol( p );
+
+
           if ( total_count > 0 )
           {
             table->bound_count     = 1;
-            table->alloc_count_max = (FT_ULong) total_count;
+            table->alloc_count_max = (FT_ULong)total_count;
           }
         }
 
+        p = getenv( "FT2_KEEP_ALIVE" );
+        if ( p != NULL )
+        {
+          FT_Long  keep_alive = ft_atol( p );
+
+
+          if ( keep_alive > 0 )
+            table->keep_alive = 1;
+        }
+
         result = 1;
       }
     }
       table->file_name = file_name;
       table->line_no   = line_no;
     }
+
     return FT_Alloc( memory, size, P );
   }
 
       table->file_name = file_name;
       table->line_no   = line_no;
     }
+
     return FT_Realloc( memory, current, size, P );
   }
 
       table->file_name = file_name;
       table->line_no   = line_no;
     }
+
     return FT_QRealloc( memory, current, size, P );
   }
 
-  
+
   FT_BASE_DEF( void )
   FT_Free_Debug( FT_Memory    memory,
                  FT_Pointer   block,
       table->file_name = file_name;
       table->line_no   = line_no;
     }
+
     FT_Free( memory, (void **)block );
   }
 
 
+  static int
+  ft_mem_source_compare( const void*  p1,
+                         const void*  p2 )
+  {
+    FT_MemSource  s1 = *(FT_MemSource*)p1;
+    FT_MemSource  s2 = *(FT_MemSource*)p2;
+
+
+    if ( s2->max_size > s1->max_size )
+      return 1;
+    else if ( s2->max_size < s1->max_size )
+      return -1;
+    else
+      return 0;
+  }
+
+
+  extern void
+  FT_DumpMemory( FT_Memory  memory )
+  {
+    FT_MemTable  table = (FT_MemTable)memory->user;
+
+
+    if ( table )
+    {
+      FT_MemSource*  bucket = table->sources;
+      FT_MemSource*  limit  = bucket + FT_MEM_SOURCE_BUCKETS;
+      FT_MemSource*  sources;
+      FT_UInt        nn, count;
+      const char*    fmt;
+
+
+      count = 0;
+      for ( ; bucket < limit; bucket++ )
+      {
+        FT_MemSource  source = *bucket;
+
+
+        for ( ; source; source = source->link )
+          count++;
+      }
+
+      sources = (FT_MemSource*)ft_mem_table_alloc(
+                                 table, sizeof ( *sources ) * count );
+
+      count = 0;
+      for ( bucket = table->sources; bucket < limit; bucket++ )
+      {
+        FT_MemSource  source = *bucket;
+
+
+        for ( ; source; source = source->link )
+          sources[count++] = source;
+      }
+
+      ft_qsort( sources, count, sizeof ( *sources ), ft_mem_source_compare );
+
+      printf( "FreeType Memory Dump: "
+              "current=%ld max=%ld total=%ld count=%ld\n",
+              table->alloc_current, table->alloc_max,
+              table->alloc_total, table->alloc_count );
+      printf( " block  block    sizes    sizes    sizes   source\n" );
+      printf( " count   high      sum  highsum      max   location\n" );
+      printf( "-------------------------------------------------\n" );
+
+      fmt = "%6ld %6ld %8ld %8ld %8ld %s:%d\n";
+
+      for ( nn = 0; nn < count; nn++ )
+      {
+        FT_MemSource  source = sources[nn];
+
+
+        printf( fmt,
+                source->cur_blocks, source->max_blocks,
+                source->cur_size, source->max_size, source->cur_max,
+                FT_FILENAME( source->file_name ),
+                source->line_no );
+      }
+      printf( "------------------------------------------------\n" );
+
+      ft_mem_table_free( table, sources );
+    }
+  }
+
 #else  /* !FT_DEBUG_MEMORY */
 
   /* ANSI C doesn't like empty source files */
index a6c1841..160f20b 100644 (file)
@@ -48,6 +48,8 @@
 
 #if defined( FT_DEBUG_LEVEL_ERROR )
 
+  /* documentation is in ftdebug.h */
+
   FT_EXPORT_DEF( void )
   FT_Message( const char*  fmt, ... )
   {
@@ -60,6 +62,8 @@
   }
 
 
+  /* documentation is in ftdebug.h */
+
   FT_EXPORT_DEF( void )
   FT_Panic( const char*  fmt, ... )
   {
   /* value of the `FT2_DEBUG' environment variable.  It must be a list of  */
   /* toggles, separated by spaces, `;', or `,'.  Example:                  */
   /*                                                                       */
-  /*    export FT2_DEBUG="any:3 memory:6 stream:5"                         */
+  /*    export FT2_DEBUG="any:3 memory:7 stream:5"                         */
   /*                                                                       */
   /* This requests that all levels be set to 3, except the trace level for */
-  /* the memory and stream components which are set to 6 and 5,            */
+  /* 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 */
   /* available toggle names.                                               */
   /*                                                                       */
-  /* The level must be between 0 and 6; 0 means quiet (except for serious  */
-  /* runtime errors), and 6 means _very_ verbose.                          */
+  /* The level must be between 0 and 7; 0 means quiet (except for serious  */
+  /* runtime errors), and 7 means _very_ verbose.                          */
   /*                                                                       */
   FT_BASE_DEF( void )
   ft_debug_init( void )
           if ( *p )
           {
             level = *p++ - '0';
-            if ( level < 0 || level > 6 )
+            if ( level < 0 || level > 7 )
               level = -1;
           }
 
index 1b22ab6..af0eadf 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType convenience functions to handle glyphs (body).              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -31,6 +31,7 @@
 #include <ft2build.h>
 #include FT_GLYPH_H
 #include FT_OUTLINE_H
+#include FT_BITMAP_H
 #include FT_INTERNAL_OBJECTS_H
 
 
   /*************************************************************************/
   /*************************************************************************/
 
-  static FT_Error
-  ft_bitmap_copy( FT_Memory   memory,
-                  FT_Bitmap*  source,
-                  FT_Bitmap*  target )
-  {
-    FT_Error  error;
-    FT_Int    pitch = source->pitch;
-    FT_ULong  size;
-
-
-    *target = *source;
-
-    if ( pitch < 0 )
-      pitch = -pitch;
-
-    size = (FT_ULong)( pitch * source->rows );
-
-    if ( !FT_ALLOC( target->buffer, size ) )
-      FT_MEM_COPY( target->buffer, source->buffer, size );
-
-    return error;
-  }
-
-
   FT_CALLBACK_DEF( FT_Error )
   ft_bitmap_glyph_init( FT_Glyph      bitmap_glyph,
                         FT_GlyphSlot  slot )
     FT_BitmapGlyph  glyph   = (FT_BitmapGlyph)bitmap_glyph;
     FT_Error        error   = FT_Err_Ok;
     FT_Library      library = FT_GLYPH( glyph )->library;
-    FT_Memory       memory  = library->memory;
 
 
     if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
       goto Exit;
     }
 
-    /* grab the bitmap in the slot - do lazy copying whenever possible */
-    glyph->bitmap = slot->bitmap;
-    glyph->left   = slot->bitmap_left;
-    glyph->top    = slot->bitmap_top;
+    glyph->left = slot->bitmap_left;
+    glyph->top  = slot->bitmap_top;
 
+    /* do lazy copying whenever possible */
     if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
+    {
+      glyph->bitmap = slot->bitmap;
       slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
+    }
     else
     {
-      /* copy the bitmap into a new buffer */
-      error = ft_bitmap_copy( memory, &slot->bitmap, &glyph->bitmap );
+      FT_Bitmap_New( &glyph->bitmap );
+      error = FT_Bitmap_Copy( library, &slot->bitmap, &glyph->bitmap );
     }
 
   Exit:
   ft_bitmap_glyph_copy( FT_Glyph  bitmap_source,
                         FT_Glyph  bitmap_target )
   {
-    FT_BitmapGlyph  source = (FT_BitmapGlyph)bitmap_source;
-    FT_BitmapGlyph  target = (FT_BitmapGlyph)bitmap_target;
-    FT_Memory       memory = bitmap_source->library->memory;
+    FT_Library      library = bitmap_source->library;
+    FT_BitmapGlyph  source  = (FT_BitmapGlyph)bitmap_source;
+    FT_BitmapGlyph  target  = (FT_BitmapGlyph)bitmap_target;
 
 
     target->left = source->left;
     target->top  = source->top;
 
-    return ft_bitmap_copy( memory, &source->bitmap, &target->bitmap );
+    return FT_Bitmap_Copy( library, &source->bitmap, &target->bitmap );
   }
 
 
   FT_CALLBACK_DEF( void )
   ft_bitmap_glyph_done( FT_Glyph  bitmap_glyph )
   {
-    FT_BitmapGlyph  glyph  = (FT_BitmapGlyph)bitmap_glyph;
-    FT_Memory       memory = FT_GLYPH( glyph )->library->memory;
+    FT_BitmapGlyph  glyph   = (FT_BitmapGlyph)bitmap_glyph;
+    FT_Library      library = FT_GLYPH( glyph )->library;
 
 
-    FT_FREE( glyph->bitmap.buffer );
+    FT_Bitmap_Done( library, &glyph->bitmap );
   }
 
 
     if ( error )
       goto Exit;
 
-    /* copy it */
-    FT_ARRAY_COPY( target->points, source->points, source->n_points );
-
-    FT_ARRAY_COPY( target->tags, source->tags, source->n_points );
-
-    FT_ARRAY_COPY( target->contours, source->contours, source->n_contours );
-
-    /* copy all flags, except the `FT_OUTLINE_OWNER' one */
-    target->flags = source->flags | FT_OUTLINE_OWNER;
+    FT_Outline_Copy( source, target );
 
   Exit:
     return error;
 
 
   FT_CALLBACK_DEF( void )
-  ft_outline_glyph_transform( FT_Glyph    outline_glyph,
-                              FT_Matrix*  matrix,
-                              FT_Vector*  delta )
+  ft_outline_glyph_transform( FT_Glyph          outline_glyph,
+                              const FT_Matrix*  matrix,
+                              const FT_Vector*  delta )
   {
     FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;
 
 
     /* create result bitmap glyph */
     error = ft_new_glyph( glyph->library, &ft_bitmap_glyph_class,
-                          (FT_Glyph*)&bitmap );
+                          (FT_Glyph*)(void*)&bitmap );
     if ( error )
       goto Exit;
 
index 79ba9f0..ac009b7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType initialization layer (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2005 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -55,9 +55,9 @@
 
 #undef  FT_USE_MODULE
 #ifdef __cplusplus
-#define FT_USE_MODULE( x )  extern "C" const FT_Module_Class*  x;
+#define FT_USE_MODULE( x )  extern "C" const FT_Module_Class  x;
 #else
-#define FT_USE_MODULE( x )  extern const FT_Module_Class*  x;
+#define FT_USE_MODULE( x )  extern const FT_Module_Class  x;
 #endif
 
 
@@ -65,7 +65,7 @@
 
 
 #undef  FT_USE_MODULE
-#define FT_USE_MODULE( x )  (const FT_Module_Class*)&x,
+#define FT_USE_MODULE( x )  (const FT_Module_Class*)&(x),
 
   static
   const FT_Module_Class*  const ft_default_modules[] =
index c714753..0c45372 100644 (file)
 #include FT_FREETYPE_H
 #include FT_INTERNAL_STREAM_H
 
-#ifdef __GNUC__
-#include "../truetype/ttobjs.h"
-#include "../type1/t1objs.h"
+#if defined( __GNUC__ ) || defined( __IBMC__ )
   /* This is for Mac OS X.  Without redefinition, OS_INLINE */
   /* expands to `static inline' which doesn't survive the   */
   /* -ansi compilation flag of GCC.                         */
 #define OS_INLINE  static __inline__
 #include <Carbon/Carbon.h>
 #else
-#include "truetype/ttobjs.h"
-#include "type1/t1objs.h"
 #include <Resources.h>
 #include <Fonts.h>
 #include <Errors.h>
                            FT_Long       face_index,
                            FT_Face      *aface )
   {
+#if defined( __MWERKS__ ) && !TARGET_RT_MAC_MACHO
     FT_Open_Args  args;
-    FT_Error      error;
     FT_Stream     stream;
     FILE*         file;
     FT_Memory     memory;
+#endif
+    FT_Error      error;
 
 
     /* test for valid `library' and `aface' delayed to FT_Open_Face() */
index bbd6ce6..1bf813a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType private base classes (body).                            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 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 @@
 #include <ft2build.h>
 #include FT_LIST_H
 #include FT_OUTLINE_H
+#include FT_INTERNAL_VALIDATE_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_RFORK_H
@@ -67,7 +68,7 @@
     valid->base  = base;
     valid->limit = limit;
     valid->level = level;
-    valid->error = 0;
+    valid->error = FT_Err_Ok;
   }
 
 
     FT_ZERO( &slot->metrics );
     FT_ZERO( &slot->outline );
 
-    slot->bitmap.width = 0;
-    slot->bitmap.rows  = 0;
-    slot->bitmap.pitch = 0;
+    slot->bitmap.width      = 0;
+    slot->bitmap.rows       = 0;
+    slot->bitmap.pitch      = 0;
     slot->bitmap.pixel_mode = 0;
-    /* don't touch 'slot->bitmap.buffer'! */
+    /* `slot->bitmap.buffer' has been handled by ft_glyphslot_free_bitmap */
 
     slot->bitmap_left   = 0;
     slot->bitmap_top    = 0;
 
     slot->linearHoriAdvance = 0;
     slot->linearVertAdvance = 0;
+    slot->lsb_delta         = 0;
+    slot->rsb_delta         = 0;
   }
 
 
     FT_GlyphSlot      slot;
 
 
-    if ( !face || !aslot || !face->driver )
+    if ( !face || !face->driver )
       return FT_Err_Invalid_Argument;
 
-    *aslot = 0;
-
     driver = face->driver;
     clazz  = driver->clazz;
     memory = driver->root.memory;
         goto Exit;
       }
 
-      *aslot = slot;
+      slot->next  = face->glyph;
+      face->glyph = slot;
+
+      if ( aslot )
+        *aslot = slot;
     }
+    else if ( aslot )
+      *aslot = 0;
+
 
   Exit:
     FT_TRACE4(( "FT_New_GlyphSlot: Return %d\n", error ));
   {
     if ( slot )
     {
-      FT_Driver      driver = slot->face->driver;
-      FT_Memory      memory = driver->root.memory;
-      FT_GlyphSlot*  parent;
-      FT_GlyphSlot   cur;
+      FT_Driver     driver = slot->face->driver;
+      FT_Memory     memory = driver->root.memory;
+      FT_GlyphSlot  prev;
+      FT_GlyphSlot  cur;
 
 
       /* Remove slot from its parent face's list */
-      parent = &slot->face->glyph;
-      cur    = *parent;
+      prev = NULL;
+      cur  = slot->face->glyph;
 
       while ( cur )
       {
         if ( cur == slot )
         {
-          *parent = cur->next;
+          if ( !prev )
+            slot->face->glyph = cur->next;
+          else
+            prev->next = cur->next;
+
           ft_glyphslot_done( slot );
           FT_FREE( slot );
           break;
         }
-        cur = cur->next;
+        prev = cur;
+        cur  = cur->next;
       }
     }
   }
   }
 
 
+  static void
+  ft_cmap_done_internal( FT_CMap  cmap );
+
+
   static void
   destroy_charmaps( FT_Face    face,
                     FT_Memory  memory )
       FT_CMap  cmap = FT_CMAP( face->charmaps[n] );
 
 
-      FT_CMap_Done( cmap );
+      ft_cmap_done_internal( cmap );
 
       face->charmaps[n] = NULL;
     }
      *  when found.  Otherwise, a 16-bit one is returned when found.
      */
 
-    /* since the `interesting' table, with id's 3,10, is normally the */
-    /* last one, we loop backwards. This looses with type1 fonts with */
-    /* non-BMP characters (<.0001%), this wins with .ttf with non-BMP */
-    /* chars (.01% ?), and this is the same about 99.99% of the time! */
+    /* Since the `interesting' table, with IDs (3,10), is normally the */
+    /* last one, we loop backwards.  This looses with type1 fonts with */
+    /* non-BMP characters (<.0001%), this wins with .ttf with non-BMP  */
+    /* chars (.01% ?), and this is the same about 99.99% of the time!  */
 
     cur = first + face->num_charmaps;  /* points after the last one */
 
              ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
                cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32    )      )
 
-        /* Hurray! We found a UCS-4 charmap. We can stop the scan! */
+        /* Hurray!  We found a UCS-4 charmap.  We can stop the scan! */
         {
           face->charmap = cur[0];
           return 0;
       }
     }
 
-    /* We do not have any UCS-4 charmap. Sigh.                           */
-    /* Let's see if we have  some other kind of Unicode charmap, though. */
+    /* We do not have any UCS-4 charmap.  Sigh.                         */
+    /* Let's see if we have some other kind of Unicode charmap, though. */
     if ( unicmap != NULL )
     {
       face->charmap = unicmap[0];
     /* test for valid `library' delayed to */
     /* FT_Stream_New()                     */
 
-    if ( !aface || !args )
+    if ( ( !aface && face_index >= 0 ) || !args )
       return FT_Err_Invalid_Argument;
 
-    *aface = 0;
-
     external_stream = FT_BOOL( ( args->flags & FT_OPEN_STREAM ) &&
                                args->stream                     );
 
     FT_List_Add( &face->driver->faces_list, node );
 
     /* now allocate a glyph slot object for the face */
-    {
-      FT_GlyphSlot  slot;
-
-
-      FT_TRACE4(( "FT_Open_Face: Creating glyph slot\n" ));
-
-      error = FT_New_GlyphSlot( face, &slot );
-      if ( error )
-        goto Fail;
+    FT_TRACE4(( "FT_Open_Face: Creating glyph slot\n" ));
 
-      face->glyph = slot;
-    }
+    error = FT_New_GlyphSlot( face, NULL );
+    if ( error )
+      goto Fail;
 
     /* finally, allocate a size object for the face */
     {
       internal->transform_delta.y = 0;
     }
 
-    *aface = face;
+    if ( aface )
+      *aface = face;
     goto Exit;
 
   Fail:
     if ( !filepathname )
       return FT_Err_Invalid_Argument;
 
+    open.stream   = NULL;
     open.flags    = FT_OPEN_PATHNAME;
     open.pathname = (char*)filepathname;
 
       FT_UShort  x_ppem = (FT_UShort)( ( dim_x + 32 ) >> 6 );
       FT_UShort  y_ppem = (FT_UShort)( ( dim_y + 32 ) >> 6 );
 
+
+      /* Don't take, say, 12.5x12.5 equal to 13x13.  If working with */
+      /* fractional font sizes this would hide slightly different    */
+      /* font metrics.  Consequently, the next two lines are         */
+      /* disabled.                                                   */
+#if 0
       if ( x_ppem == metrics->x_ppem && y_ppem == metrics->y_ppem )
         return FT_Err_Ok;
+#endif
 
       metrics->x_ppem = x_ppem;
       metrics->y_ppem = y_ppem;
 
           if ( kern_mode != FT_KERNING_UNFITTED )
           {
+            /* we scale down kerning values for small ppem values */
+            /* to avoid that rounding makes them too big.         */
+            /* `25' has been determined heuristically.            */
+            if ( face->size->metrics.x_ppem < 25 )
+              akerning->x = FT_MulDiv( akerning->x,
+                                       face->size->metrics.x_ppem, 25 );
+            if ( face->size->metrics.y_ppem < 25 )
+              akerning->y = FT_MulDiv( akerning->y,
+                                       face->size->metrics.y_ppem, 25 );
+
             akerning->x = FT_PIX_ROUND( akerning->x );
             akerning->y = FT_PIX_ROUND( akerning->y );
           }
   }
 
 
+  static void
+  ft_cmap_done_internal( FT_CMap  cmap )
+  {
+    FT_CMap_Class  clazz  = cmap->clazz;
+    FT_Face        face   = cmap->charmap.face;
+    FT_Memory      memory = FT_FACE_MEMORY(face);
+
+
+    if ( clazz->done )
+      clazz->done( cmap );
+
+    FT_FREE( cmap );
+  }
+
+
   FT_BASE_DEF( void )
   FT_CMap_Done( FT_CMap  cmap )
   {
     if ( cmap )
     {
-      FT_CMap_Class  clazz  = cmap->clazz;
-      FT_Face        face   = cmap->charmap.face;
-      FT_Memory      memory = FT_FACE_MEMORY(face);
+      FT_Face    face   = cmap->charmap.face;
+      FT_Memory  memory = FT_FACE_MEMORY( face );
+      FT_Error   error;
+      FT_Int     i, j;
+
 
+      for ( i = 0; i < face->num_charmaps; i++ )
+      {
+        if ( (FT_CMap)face->charmaps[i] == cmap )
+        {
+          FT_CharMap  last_charmap = face->charmaps[face->num_charmaps - 1];
+
+
+          if ( FT_RENEW_ARRAY( face->charmaps,
+                               face->num_charmaps,
+                               face->num_charmaps - 1 ) )
+            return;
+
+          /* remove it from our list of charmaps */
+          for ( j = i + 1; j < face->num_charmaps; j++ )
+          {
+            if ( j == face->num_charmaps - 1 )
+              face->charmaps[j - 1] = last_charmap;
+            else
+              face->charmaps[j - 1] = face->charmaps[j];
+          }
+
+          face->num_charmaps--;
+
+          if ( (FT_CMap)face->charmap == cmap )
+            face->charmap = NULL;
 
-      if ( clazz->done )
-        clazz->done( cmap );
+          ft_cmap_done_internal( cmap );
 
-      FT_FREE( cmap );
+          break;
+        }
+      }
     }
   }
 
                FT_CharMap      charmap,
                FT_CMap        *acmap )
   {
-    FT_Error   error = 0;
+    FT_Error   error = FT_Err_Ok;
     FT_Face    face;
     FT_Memory  memory;
     FT_CMap    cmap;
       /* add it to our list of charmaps */
       if ( FT_RENEW_ARRAY( face->charmaps,
                            face->num_charmaps,
-                           face->num_charmaps+1 ) )
+                           face->num_charmaps + 1 ) )
         goto Fail;
 
       face->charmaps[face->num_charmaps++] = (FT_CharMap)cmap;
     return error;
 
   Fail:
-    FT_CMap_Done( cmap );
+    ft_cmap_done_internal( cmap );
     cmap = NULL;
     goto Exit;
   }
   }
 
 
+  /* documentation is in tttables.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Sfnt_Table_Info( FT_Face    face,
+                      FT_UInt    table_index,
+                      FT_ULong  *tag,
+                      FT_ULong  *length )
+  {
+    FT_Service_SFNT_Table  service;
+
+
+    if ( !face || !FT_IS_SFNT( face ) )
+      return FT_Err_Invalid_Face_Handle;
+
+    FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
+    if ( service == NULL )
+      return FT_Err_Unimplemented_Feature;
+
+    return service->table_info( face, table_index, tag, length );
+  }
+
+
+  /* documentation is in tttables.h */
+
   FT_EXPORT_DEF( FT_ULong )
   FT_Get_CMap_Language_ID( FT_CharMap  charmap )
   {
   }
 
 
+  /* documentation is in ftsizes.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Activate_Size( FT_Size  size )
   {
diff --git a/reactos/lib/freetype/src/base/ftotval.c b/reactos/lib/freetype/src/base/ftotval.c
new file mode 100644 (file)
index 0000000..eb6be68
--- /dev/null
@@ -0,0 +1,72 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ftotval.c                                                              */\r
+/*                                                                         */\r
+/*    FreeType API for validating OpenType tables (body).                  */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+#include <ft2build.h>\r
+#include FT_INTERNAL_OBJECTS_H\r
+#include FT_SERVICE_OPENTYPE_VALIDATE_H\r
+\r
+\r
+  /* documentation is in ftotval.h */\r
+\r
+  FT_EXPORT_DEF( FT_Error )\r
+  FT_OpenType_Validate( FT_Face    face,\r
+                        FT_UInt    validation_flags,\r
+                        FT_Bytes  *BASE_table,\r
+                        FT_Bytes  *GDEF_table,\r
+                        FT_Bytes  *GPOS_table,\r
+                        FT_Bytes  *GSUB_table,\r
+                        FT_Bytes  *JSTF_table )\r
+  {\r
+    FT_Service_OTvalidate  service;\r
+    FT_Error               error;\r
+\r
+\r
+    if ( !face )\r
+    {\r
+      error = FT_Err_Invalid_Face_Handle;\r
+      goto Exit;\r
+    }\r
+\r
+    if ( !( BASE_table &&\r
+            GDEF_table &&\r
+            GPOS_table &&\r
+            GSUB_table &&\r
+            JSTF_table ) )\r
+    {\r
+      error = FT_Err_Invalid_Argument;\r
+      goto Exit;\r
+    }\r
+\r
+    FT_FACE_FIND_GLOBAL_SERVICE( face, service, OPENTYPE_VALIDATE );\r
+\r
+    if ( service )\r
+      error = service->validate( face,\r
+                                 validation_flags,\r
+                                 BASE_table,\r
+                                 GDEF_table,\r
+                                 GPOS_table,\r
+                                 GSUB_table,\r
+                                 JSTF_table );\r
+    else\r
+      error = FT_Err_Invalid_Argument;\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+/* END */\r
index 5cae931..d2e53cd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType outline management (body).                                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   /* documentation is in ftoutln.h */
 
   FT_EXPORT_DEF( FT_Error )
-  FT_Outline_Copy( FT_Outline*  source,
-                   FT_Outline  *target )
+  FT_Outline_Copy( const FT_Outline*  source,
+                   FT_Outline        *target )
   {
     FT_Int  is_owner;
 
          source->n_contours != target->n_contours )
       return FT_Err_Invalid_Argument;
 
+    if ( source == target )
+      return FT_Err_Ok;
+
     FT_ARRAY_COPY( target->points, source->points, source->n_points );
 
     FT_ARRAY_COPY( target->tags, source->tags, source->n_points );
   FT_Outline_Done_Internal( FT_Memory    memory,
                             FT_Outline*  outline )
   {
-    if ( outline )
+    if ( memory && outline )
     {
       if ( outline->flags & FT_OUTLINE_OWNER )
       {
   /* documentation is in ftoutln.h */
 
   FT_EXPORT_DEF( void )
-  FT_Outline_Get_CBox( FT_Outline*  outline,
-                       FT_BBox     *acbox )
+  FT_Outline_Get_CBox( const FT_Outline*  outline,
+                       FT_BBox           *acbox )
   {
     FT_Pos  xMin, yMin, xMax, yMax;
 
   /* documentation is in ftoutln.h */
 
   FT_EXPORT_DEF( void )
-  FT_Outline_Translate( FT_Outline*  outline,
-                        FT_Pos       xOffset,
-                        FT_Pos       yOffset )
+  FT_Outline_Translate( const FT_Outline*  outline,
+                        FT_Pos             xOffset,
+                        FT_Pos             yOffset )
   {
     FT_UShort   n;
     FT_Vector*  vec = outline->points;
 
 
+    if ( !outline )
+      return;
+
     for ( n = 0; n < outline->n_points; n++ )
     {
       vec->x += xOffset;
     FT_Int     first, last;
 
 
+    if ( !outline )
+      return;
+
     first = 0;
 
     for ( n = 0; n < outline->n_contours; n++ )
     if ( !library )
       return FT_Err_Invalid_Library_Handle;
 
-    if ( !params )
+    if ( !outline || !params )
       return FT_Err_Invalid_Argument;
 
     renderer = library->cur_renderer;
   /* documentation is in ftoutln.h */
 
   FT_EXPORT_DEF( FT_Error )
-  FT_Outline_Get_Bitmap( FT_Library   library,
-                         FT_Outline*  outline,
-                         FT_Bitmap   *abitmap )
+  FT_Outline_Get_Bitmap( FT_Library        library,
+                         FT_Outline*       outline,
+                         const FT_Bitmap  *abitmap )
   {
     FT_Raster_Params  params;
 
   /* documentation is in ftoutln.h */
 
   FT_EXPORT_DEF( void )
-  FT_Vector_Transform( FT_Vector*  vector,
-                       FT_Matrix*  matrix )
+  FT_Vector_Transform( FT_Vector*        vector,
+                       const FT_Matrix*  matrix )
   {
     FT_Pos xz, yz;
 
   /* documentation is in ftoutln.h */
 
   FT_EXPORT_DEF( void )
-  FT_Outline_Transform( FT_Outline*  outline,
-                        FT_Matrix*   matrix )
+  FT_Outline_Transform( const FT_Outline*  outline,
+                        const FT_Matrix*   matrix )
   {
-    FT_Vector*  vec = outline->points;
-    FT_Vector*  limit = vec + outline->n_points;
+    FT_Vector*  vec;
+    FT_Vector*  limit;
 
 
+    if ( !outline || !matrix )
+      return;
+
+    vec   = outline->points;
+    limit = vec + outline->n_points;
+
     for ( ; vec < limit; vec++ )
       FT_Vector_Transform( vec, matrix );
   }
 
 
-  typedef struct  FT_OrientationExtremumRec_
-  {
-    FT_Int   index;
-    FT_Long  pos;
-    FT_Int   first;
-    FT_Int   last;
+  /* documentation is in ftoutln.h */
 
-  } FT_OrientationExtremumRec;
+  FT_EXPORT_DEF( FT_Error )
+  FT_Outline_Embolden( FT_Outline*  outline,
+                       FT_Pos       strength )
+  {
+    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;
 
 
-  static FT_Orientation
-  ft_orientation_extremum_compute( FT_OrientationExtremumRec*  extremum,
-                                   FT_Outline*                 outline )
-  {
-    FT_Vector  *point, *first, *last, *prev, *next;
-    FT_Vector*  points = outline->points;
-    FT_Angle    angle_in, angle_out;
+    if ( !outline )
+      return FT_Err_Invalid_Argument;
 
+    if ( strength == 0 )
+      return FT_Err_Ok;
 
-    /* compute the previous and next points in the same contour */
-    point = points + extremum->index;
-    first = points + extremum->first;
-    last  = points + extremum->last;
+    if ( FT_Outline_Get_Orientation( outline ) == FT_ORIENTATION_TRUETYPE )
+      rotate = -FT_ANGLE_PI2;
+    else
+      rotate = FT_ANGLE_PI2;
 
-    prev = point;
-    next = point;
+    points = outline->points;
 
-    do
+    first = 0;
+    for ( c = 0; c < outline->n_contours; c++ )
     {
-      prev = ( prev == first ) ? last : prev - 1;
-      if ( prev == point )
-        return FT_ORIENTATION_TRUETYPE;  /* degenerate case */
+      int  last = outline->contours[c];
 
-    } while ( prev->x != point->x || prev->y != point->y );
 
-    do
-    {
-      next = ( next == last ) ? first : next + 1;
-      if ( next == point )
-        return FT_ORIENTATION_TRUETYPE;  /* shouldn't happen */
+      v_first = points[first];
+      v_prev  = points[last];
+      v_cur   = v_first;
 
-    } while ( next->x != point->x || next->y != point->y );
+      for ( n = first; n <= last; n++ )
+      {
+        FT_Vector  in, out;
+        FT_Angle   angle_diff;
+        FT_Pos     d;
+        FT_Fixed   scale;
 
-    /* now compute the orientation of the `out' vector relative */
-    /* to the `in' vector.                                      */
-    angle_in  = FT_Atan2( point->x - prev->x,  point->y - prev->y );
-    angle_out = FT_Atan2( next->x  - point->x, next->y  - point->y );
 
-    return ( FT_Angle_Diff( angle_in, angle_out ) >= 0 )
-             ? FT_ORIENTATION_TRUETYPE
-             : FT_ORIENTATION_POSTSCRIPT;
-  }
+        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;
 
-  FT_EXPORT_DEF( FT_Orientation )
-  FT_Outline_Get_Orientation( FT_Outline*  outline )
-  {
-    FT_Orientation  result = FT_ORIENTATION_TRUETYPE;
+        out.x = v_next.x - v_cur.x;
+        out.y = v_next.y - v_cur.y;
 
+        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 );
 
-    if ( outline && outline->n_points > 0 )
-    {
-      FT_OrientationExtremumRec  xmin, ymin, xmax, ymax;
-      FT_Int                     n;
-      FT_Int                     first, last;
-      FT_Vector*                 points = outline->points;
+        if ( scale < 0x4000L && scale > -0x4000L )
+          in.x = in.y = 0;
+        else
+        {
+          d = FT_DivFix( strength, scale );
 
+          FT_Vector_From_Polar( &in, d, angle_in + angle_diff / 2 - rotate );
+        }
 
-      xmin.pos = ymin.pos = +32768L;
-      xmax.pos = ymax.pos = -32768L;
+        outline->points[n].x = v_cur.x + strength + in.x;
+        outline->points[n].y = v_cur.y + strength + in.y;
 
-      xmin.index = ymin.index = xmax.index = ymax.index = -1;
+        v_prev = v_cur;
+        v_cur  = v_next;
+      }
 
-      first = 0;
-      for ( n = 0; n < outline->n_contours; n++, first = last + 1 )
-      {
-        last = outline->contours[n];
+      first = last + 1;
+    }
 
-        /* skip single-point contours; these are degenerated cases */
-        if ( last > first + 1 )
-        {
-          FT_Int  i;
+    return FT_Err_Ok;
+  }
 
 
-          for ( i = first; i < last; i++ )
-          {
-            FT_Pos  x = points[i].x;
-            FT_Pos  y = points[i].y;
+  /* documentation is in ftoutln.h */
 
+  FT_EXPORT_DEF( FT_Orientation )
+  FT_Outline_Get_Orientation( FT_Outline*  outline )
+  {
+    FT_Pos      xmin       = 32768L;
+    FT_Vector*  xmin_point = NULL;
+    FT_Vector*  xmin_first = NULL;
+    FT_Vector*  xmin_last  = NULL;
 
-            if ( x < xmin.pos )
-            {
-              xmin.pos   = x;
-              xmin.index = i;
-              xmin.first = first;
-              xmin.last  = last;
-            }
-            if ( x > xmax.pos )
-            {
-              xmax.pos   = x;
-              xmax.index = i;
-              xmax.first = first;
-              xmax.last  = last;
-            }
-            if ( y < ymin.pos )
-            {
-              ymin.pos   = y;
-              ymin.index = i;
-              ymin.first = first;
-              ymin.last  = last;
-            }
-            if ( y > ymax.pos )
-            {
-              ymax.pos   = y;
-              ymax.index = i;
-              ymax.first = first;
-              ymax.last  = last;
-            }
-          }
-        }
+    short*      contour;
+
+    FT_Vector*  first;
+    FT_Vector*  last;
+    FT_Vector*  prev;
+    FT_Vector*  next;
+
+
+    if ( !outline || outline->n_points <= 0 )
+      return FT_ORIENTATION_TRUETYPE;
+
+    first = outline->points;
+    for ( contour = outline->contours;
+          contour < outline->contours + outline->n_contours;
+          contour++, first = last + 1 )
+    {
+      FT_Vector*  point;
 
-        if ( xmin.index >= 0 )
-          result = ft_orientation_extremum_compute( &xmin, outline );
 
-        else if ( xmax.index >= 0 )
-          result = ft_orientation_extremum_compute( &xmax, outline );
+      last = outline->points + *contour;
 
-        else if ( ymin.index >= 0 )
-          result = ft_orientation_extremum_compute( &ymin, outline );
+      /* skip degenerate contours */
+      if ( last < first + 2 )
+        continue;
 
-        else if ( ymax.index >= 0 )
-          result = ft_orientation_extremum_compute( &ymax, outline );
+      for ( point = first; point <= last; point++ )
+      {
+        if ( point->x < xmin )
+        {
+          xmin       = point->x;
+          xmin_point = point;
+          xmin_first = first;
+          xmin_last  = last;
+        }
       }
     }
 
-    return result;
+    if ( !xmin_point )
+      return FT_ORIENTATION_TRUETYPE;
+
+    prev = ( xmin_point == xmin_first ) ? xmin_last : xmin_point - 1;
+    next = ( xmin_point == xmin_last ) ? xmin_first : xmin_point + 1;
+
+    if ( FT_Atan2( prev->x - xmin_point->x, prev->y - xmin_point->y ) >
+         FT_Atan2( next->x - xmin_point->x, next->y - xmin_point->y ) )
+      return FT_ORIENTATION_POSTSCRIPT;
+    else
+      return FT_ORIENTATION_TRUETYPE;
   }
 
 
index fb959e3..9e930dd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing PFR-specific data (body).                 */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -33,6 +33,8 @@
   }
 
 
+  /* documentation is in ftpfr.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Get_PFR_Metrics( FT_Face    face,
                       FT_UInt   *aoutline_resolution,
@@ -78,6 +80,8 @@
   }
 
 
+  /* documentation is in ftpfr.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Get_PFR_Kerning( FT_Face     face,
                       FT_UInt     left,
   }
 
 
+  /* documentation is in ftpfr.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Get_PFR_Advance( FT_Face   face,
                       FT_UInt   gindex,
index cf790cc..50dcf85 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Embedded resource forks accessor (body).                             */
 /*                                                                         */
-/*  Copyright 2004 by                                                      */
+/*  Copyright 2004, 2005 by                                                */
 /*  Masatake YAMATO and Redhat K.K.                                        */
 /*                                                                         */
 /*  FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are     */
   {
     FT_Int32   magic_from_stream;
     FT_Error   error;
-    FT_Int32   version_number;
+    FT_Int32   version_number = 0;
     FT_UShort  n_of_entries;
 
     int        i;
-    FT_UInt32  entry_id, entry_offset, entry_length;
+    FT_UInt32  entry_id, entry_offset, entry_length = 0;
 
     const FT_UInt32  resource_fork_entry_id = 0x2;
 
     FT_UNUSED( library );
     FT_UNUSED( base_file_name );
+    FT_UNUSED( version_number );
+    FT_UNUSED( entry_length   );
 
 
-    if ( FT_READ_LONG ( magic_from_stream ) )
+    if ( FT_READ_LONG( magic_from_stream ) )
       return error;
     if ( magic_from_stream != magic )
       return FT_Err_Unknown_File_Format;
                                              char *      file_name,
                                              FT_Long    *result_offset )
   {
-    FT_Memory     memory;
     FT_Open_Args  args2;
     FT_Stream     stream2;
     char *        nouse = NULL;
     FT_Error      error;
 
 
-    memory = library->memory;
-
     args2.flags    = FT_OPEN_PATHNAME;
     args2.pathname = file_name;
     error = FT_Stream_New( library, &args2, &stream2 );
     char*        tmp;
     const char*  slash;
     unsigned     new_length;
-    FT_ULong     error;
+    FT_ULong     error = FT_Err_Ok;
+
+    FT_UNUSED( error );
+
 
     new_length = ft_strlen( original_name ) + ft_strlen( insertion );
     if ( FT_ALLOC( new_name, new_length + 1 ) )
   {
     int  i;
 
+    FT_UNUSED( library );
+    FT_UNUSED( stream );
+    FT_UNUSED( base_name );
+
 
     for ( i = 0; i < FT_RACCESS_N_RULES; i++ )
     {
index 932fe1b..3b7b29f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    I/O stream support (body).                                           */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2004 by                                     */
+/*  Copyright 2000-2001, 2002, 2004, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   FT_Stream_Close( FT_Stream  stream )
   {
     if ( stream && stream->close )
-    {
       stream->close( stream );
-      stream->close = NULL;
-    }
   }
 
 
   }
 
 
+  FT_BASE_DEF( FT_ULong )
+  FT_Stream_TryRead( FT_Stream  stream,
+                     FT_Byte*   buffer,
+                     FT_ULong   count )
+  {
+    FT_ULong  read_bytes = 0;
+
+
+    if ( stream->pos >= stream->size )
+      goto Exit;
+
+    if ( stream->read )
+      read_bytes = stream->read( stream, stream->pos, buffer, count );
+    else
+    {
+      read_bytes = stream->size - stream->pos;
+      if ( read_bytes > count )
+        read_bytes = count;
+
+      FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes );
+    }
+
+    stream->pos += read_bytes;
+
+  Exit:
+    return read_bytes;
+  }
+
+
   FT_BASE_DEF( FT_Error )
   FT_Stream_ExtractFrame( FT_Stream  stream,
                           FT_ULong   count,
index 10aad2d..26ff215 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType path stroker (body).                                        */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by                                          */
+/*  Copyright 2002, 2003, 2004, 2005 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -24,6 +24,9 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 
+
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_StrokerBorder )
   FT_Outline_GetInsideBorder( FT_Outline*  outline )
   {
@@ -35,6 +38,8 @@
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_StrokerBorder )
   FT_Outline_GetOutsideBorder( FT_Outline*  outline )
   {
 
   } FT_StrokeTags;
 
+#define  FT_STROKE_TAG_BEGIN_END  (FT_STROKE_TAG_BEGIN|FT_STROKE_TAG_END)
 
   typedef struct  FT_StrokeBorderRec_
   {
 
 
   static void
-  ft_stroke_border_close( FT_StrokeBorder  border )
+  ft_stroke_border_close( FT_StrokeBorder  border,
+                          FT_Bool          reverse )
   {
+    FT_UInt  start = border->start;
+    FT_UInt  count = border->num_points;
+
+
     FT_ASSERT( border->start >= 0 );
 
     /* don't record empty paths! */
-    if ( border->num_points > (FT_UInt)border->start )
+    if ( count <= start + 1U )
+      border->num_points = start;
+    else
     {
-      border->tags[border->start         ] |= FT_STROKE_TAG_BEGIN;
-      border->tags[border->num_points - 1] |= FT_STROKE_TAG_END;
+      /* copy the last point to the start of this sub-path, since */
+      /* it contains the `adjusted' starting coordinates          */
+      border->num_points    = --count;
+      border->points[start] = border->points[count];
+
+      if ( reverse )
+      {
+        /* reverse the points */
+        {
+          FT_Vector*  vec1 = border->points + start + 1;
+          FT_Vector*  vec2 = border->points + count - 1;
+
+
+          for ( ; vec1 < vec2; vec1++, vec2-- )
+          {
+            FT_Vector  tmp;
+
+
+            tmp   = *vec1;
+            *vec1 = *vec2;
+            *vec2 = tmp;
+          }
+        }
+
+        /* then the tags */
+        {
+          FT_Byte*  tag1 = border->tags + start + 1;
+          FT_Byte*  tag2 = border->tags + count - 1;
+
+
+          for ( ; tag1 < tag2; tag1++, tag2-- )
+          {
+            FT_Byte  tmp;
+
+
+            tmp   = *tag1;
+            *tag1 = *tag2;
+            *tag2 = tmp;
+          }
+        }
+      }
+
+      border->tags[start    ] |= FT_STROKE_TAG_BEGIN;
+      border->tags[count - 1] |= FT_STROKE_TAG_END;
     }
 
     border->start   = -1;
   {
     /* close current open path if any ? */
     if ( border->start >= 0 )
-      ft_stroke_border_close( border );
+      ft_stroke_border_close( border, 0 );
 
     border->start   = border->num_points;
     border->movable = 0;
   } FT_StrokerRec;
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_New( FT_Memory    memory,
                   FT_Stroker  *astroker )
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( void )
   FT_Stroker_Set( FT_Stroker           stroker,
                   FT_Fixed             radius,
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( void )
   FT_Stroker_Rewind( FT_Stroker  stroker )
   {
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( void )
   FT_Stroker_Done( FT_Stroker  stroker )
   {
 
     phi = stroker->angle_in + theta;
 
-    thcos  = FT_Cos( theta );
-    sigma  = FT_MulFix( stroker->miter_limit, thcos );
+    thcos = FT_Cos( theta );
+    sigma = FT_MulFix( stroker->miter_limit, thcos );
 
+    /* TODO: find better criterion to switch off the optimization */
     if ( sigma < 0x10000L )
     {
       FT_Vector_From_Polar( &delta, stroker->radius,
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_LineTo( FT_Stroker  stroker,
                      FT_Vector*  to )
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_ConicTo( FT_Stroker  stroker,
                       FT_Vector*  control,
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_CubicTo( FT_Stroker  stroker,
                       FT_Vector*  control1,
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_BeginSubPath( FT_Stroker  stroker,
                            FT_Vector*  to,
           *dst_tag   = *src_tag;
 
           if ( open )
-            dst_tag[0] &= ~( FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END );
+            dst_tag[0] &= ~FT_STROKE_TAG_BEGIN_END;
           else
           {
-            /* switch begin/end tags if necessary.. */
-            if ( dst_tag[0] & ( FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END ) )
-              dst_tag[0] ^= ( FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END );
+            FT_Byte  ttag = (FT_Byte)( dst_tag[0] & FT_STROKE_TAG_BEGIN_END );
+
+
+            /* switch begin/end tags if necessary */
+            if ( ttag == FT_STROKE_TAG_BEGIN ||
+                 ttag == FT_STROKE_TAG_END   )
+              dst_tag[0] ^= FT_STROKE_TAG_BEGIN_END;
+
           }
 
           src_point--;
   }
 
 
+  /* documentation is in ftstroke.h */
+
   /* there's a lot of magic in this function! */
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_EndSubPath( FT_Stroker  stroker )
 
       /* Now end the right subpath accordingly.  The left one is */
       /* rewind and doesn't need further processing.             */
-      ft_stroke_border_close( right );
+      ft_stroke_border_close( right, 0 );
     }
     else
     {
         if ( turn < 0 )
           inside_side = 1;
 
-        /* IMPORTANT: WE DO NOT PROCESS THE INSIDE BORDER HERE! */
-        /* process the inside side                              */
-        /* error = ft_stroker_inside( stroker, inside_side );   */
-        /* if ( error )                                         */
-        /*   goto Exit;                                         */
+        error = ft_stroker_inside( stroker, inside_side );
+        if ( error )
+          goto Exit;
 
         /* process the outside side */
         error = ft_stroker_outside( stroker, 1 - inside_side );
       }
 
       /* then end our two subpaths */
-      ft_stroke_border_close( stroker->borders + 0 );
-      ft_stroke_border_close( stroker->borders + 1 );
+      ft_stroke_border_close( stroker->borders + 0, 1 );
+      ft_stroke_border_close( stroker->borders + 1, 0 );
     }
 
   Exit:
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_GetBorderCounts( FT_Stroker        stroker,
                               FT_StrokerBorder  border,
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_GetCounts( FT_Stroker  stroker,
                         FT_UInt    *anum_points,
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( void )
   FT_Stroker_ExportBorder( FT_Stroker        stroker,
                            FT_StrokerBorder  border,
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( void )
   FT_Stroker_Export( FT_Stroker   stroker,
                      FT_Outline*  outline )
   }
 
 
+  /* documentation is in ftstroke.h */
+
   /*
    *  The following is very similar to FT_Outline_Decompose, except
    *  that we do support opened paths, and do not scale the outline.
 
     for ( n = 0; n < outline->n_contours; n++ )
     {
-      FT_Int  last;  /* index of last point in contour */
+      FT_UInt  last;  /* index of last point in contour */
 
 
       last  = outline->contours[n];
       limit = outline->points + last;
 
+      /* skip empty points; we don't stroke these */
+      if ( last <= first )
+      {
+        first = last + 1;
+        continue;
+      }
+
       v_start = outline->points[first];
       v_last  = outline->points[last];
 
   extern const FT_Glyph_Class  ft_outline_glyph_class;
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Glyph_Stroke( FT_Glyph    *pglyph,
                    FT_Stroker   stroker,
   }
 
 
+  /* documentation is in ftstroke.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,
                          FT_Stroker   stroker,
index cee3682..020bfdf 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType synthesizing code for emboldening and slanting (body).      */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003 by                                     */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 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_SYNTHESIS_H
 #include FT_INTERNAL_OBJECTS_H
-#include FT_INTERNAL_CALC_H
 #include FT_OUTLINE_H
-#include FT_TRIGONOMETRY_H
-#include FT_SYNTHESIS_H
-
-
-#define FT_BOLD_THRESHOLD  0x0100
+#include FT_BITMAP_H
 
 
   /*************************************************************************/
@@ -35,6 +31,8 @@
   /*************************************************************************/
   /*************************************************************************/
 
+  /* documentation is in ftsynth.h */
+
   FT_EXPORT_DEF( void )
   FT_GlyphSlot_Oblique( FT_GlyphSlot  slot )
   {
   /*************************************************************************/
 
 
-
-  static int
-  ft_test_extrema( FT_Outline*  outline,
-                   int          n )
-  {
-    FT_Vector  *prev, *cur, *next;
-    FT_Pos      product;
-    FT_Int      c, first, last;
-
-
-    /* we need to compute the `previous' and `next' point */
-    /* for these extrema.                                 */
-    cur  = outline->points + n;
-    prev = cur - 1;
-    next = cur + 1;
-
-    first = 0;
-    for ( c = 0; c < outline->n_contours; c++ )
-    {
-      last = outline->contours[c];
-
-      if ( n == first )
-        prev = outline->points + last;
-
-      if ( n == last )
-        next = outline->points + first;
-
-      first = last + 1;
-    }
-
-    product = FT_MulDiv( cur->x - prev->x,   /* in.x  */
-                         next->y - cur->y,   /* out.y */
-                         0x40 )
-              -
-              FT_MulDiv( cur->y - prev->y,   /* in.y  */
-                         next->x - cur->x,   /* out.x */
-                         0x40 );
-
-    if ( product )
-      product = product > 0 ? 1 : -1;
-
-    return product;
-  }
-
-
-  /* Compute the orientation of path filling.  It differs between TrueType */
-  /* and Type1 formats.  We could use the `FT_OUTLINE_REVERSE_FILL' flag,  */
-  /* but it is better to re-compute it directly (it seems that this flag   */
-  /* isn't correctly set for some weird composite glyphs currently).       */
-  /*                                                                       */
-  /* We do this by computing bounding box points, and computing their      */
-  /* curvature.                                                            */
-  /*                                                                       */
-  /* The function returns either 1 or -1.                                  */
-  /*                                                                       */
-  static int
-  ft_get_orientation( FT_Outline*  outline )
-  {
-    FT_BBox  box;
-    FT_BBox  indices;
-    int      n, last;
-
-
-    indices.xMin = -1;
-    indices.yMin = -1;
-    indices.xMax = -1;
-    indices.yMax = -1;
-
-    box.xMin = box.yMin =  32767;
-    box.xMax = box.yMax = -32768;
-
-    /* is it empty ? */
-    if ( outline->n_contours < 1 )
-      return 1;
-
-    last = outline->contours[outline->n_contours - 1];
-
-    for ( n = 0; n <= last; n++ )
-    {
-      FT_Pos  x, y;
-
-
-      x = outline->points[n].x;
-      if ( x < box.xMin )
-      {
-        box.xMin     = x;
-        indices.xMin = n;
-      }
-      if ( x > box.xMax )
-      {
-        box.xMax     = x;
-        indices.xMax = n;
-      }
-
-      y = outline->points[n].y;
-      if ( y < box.yMin )
-      {
-        box.yMin     = y;
-        indices.yMin = n;
-      }
-      if ( y > box.yMax )
-      {
-        box.yMax     = y;
-        indices.yMax = n;
-      }
-    }
-
-    /* test orientation of the xmin */
-    n = ft_test_extrema( outline, indices.xMin );
-    if ( n )
-      goto Exit;
-
-    n = ft_test_extrema( outline, indices.yMin );
-    if ( n )
-      goto Exit;
-
-    n = ft_test_extrema( outline, indices.xMax );
-    if ( n )
-      goto Exit;
-
-    n = ft_test_extrema( outline, indices.yMax );
-    if ( !n )
-      n = 1;
-
-  Exit:
-    return n;
-  }
-
+  /* documentation is in ftsynth.h */
 
   FT_EXPORT_DEF( void )
   FT_GlyphSlot_Embolden( FT_GlyphSlot  slot )
   {
-    FT_Vector*   points;
-    FT_Vector    v_prev, v_first, v_next, v_cur;
-    FT_Pos       distance;
-    FT_Outline*  outline = &slot->outline;
-    FT_Face      face = FT_SLOT_FACE( slot );
-    FT_Angle     rotate, angle_in, angle_out;
-    FT_Int       c, n, first, orientation;
+    FT_Library  library = slot->library;
+    FT_Face     face    = FT_SLOT_FACE( slot );
+    FT_Error    error   = FT_Err_Ok;
+    FT_Pos      xstr, ystr;
 
 
-    /* only embolden outline glyph images */
-    if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
-      return;
+    /* some reasonable strength */
+    xstr = FT_MulFix( face->units_per_EM,
+                      face->size->metrics.y_scale ) / 42;
+    ystr = xstr;
 
-    /* compute control distance */
-    distance = FT_MulFix( face->units_per_EM / 60,
-                          face->size->metrics.y_scale );
-
-    orientation = ft_get_orientation( outline );
-    rotate      = FT_ANGLE_PI2*orientation;
-
-    points = outline->points;
-
-    first = 0;
-    for ( c = 0; c < outline->n_contours; c++ )
+    if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
     {
-      int  last = outline->contours[c];
-
-
-      v_first = points[first];
-      v_prev  = points[last];
-      v_cur   = v_first;
+      error = FT_Outline_Embolden( &slot->outline, xstr );
+      xstr = xstr * 4;  /* according to the documentation */
+      ystr = xstr;
+    }
+    else if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
+    {
+      xstr = FT_PIX_FLOOR( xstr );
+      if ( xstr == 0 )
+        xstr = 1 << 6;
+      ystr = FT_PIX_FLOOR( ystr );
 
-      for ( n = first; n <= last; n++ )
+      /* slot must be bitmap-owner */
+      if ( !( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
       {
-        FT_Pos     d;
-        FT_Vector  in, out;
-        FT_Fixed   scale;
-        FT_Angle   angle_diff;
-
+        FT_Bitmap  bitmap;
 
-        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;
+        FT_Bitmap_New( &bitmap );
+        error = FT_Bitmap_Copy( library, &slot->bitmap, &bitmap );
 
-        out.x = v_next.x - v_cur.x;
-        out.y = v_next.y - v_cur.y;
-
-        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 );
-
-        if ( scale < 0x400L && scale > -0x400L )
+        if ( !error )
         {
-          if ( scale >= 0 )
-            scale = 0x400L;
-          else
-            scale = -0x400L;
+          slot->bitmap = bitmap;
+          slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
         }
-
-        d = FT_DivFix( distance, scale );
-
-        FT_Vector_From_Polar( &in, d, angle_in + angle_diff/2 - rotate );
-
-        outline->points[n].x = v_cur.x + distance + in.x;
-        outline->points[n].y = v_cur.y + distance + in.y;
-
-        v_prev = v_cur;
-        v_cur  = v_next;
       }
 
-      first = last + 1;
+      if ( !error )
+        error = FT_Bitmap_Embolden( library, &slot->bitmap, xstr, ystr );
     }
+    else
+      error = FT_Err_Invalid_Argument;
 
-    slot->metrics.horiAdvance =
-      ( slot->metrics.horiAdvance + distance*4 ) & ~63;
+    /* modify the metrics accordingly */
+    if ( !error )
+    {
+      slot->advance.x += xstr;
+      slot->advance.y += ystr;
+
+      slot->metrics.width        += xstr;
+      slot->metrics.height       += ystr;
+      slot->metrics.horiBearingY += ystr;
+      slot->metrics.horiAdvance  += xstr;
+      slot->metrics.vertBearingX -= xstr / 2;
+      slot->metrics.vertBearingY += ystr;
+      slot->metrics.vertAdvance  += ystr;
+
+      if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
+        slot->bitmap_top += ystr >> 6;
+    }
   }
 
 
index 5347dd8..1ab3438 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType trigonometric functions (body).                             */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003 by                                          */
+/*  Copyright 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,       */
     if ( theta >= 0 )
       theta = FT_PAD_ROUND( theta, 32 );
     else
-      theta = - FT_PAD_ROUND( -theta, 32 );
+      theta = -FT_PAD_ROUND( -theta, 32 );
 
     vec->x = x;
     vec->y = theta;
   {
     FT_Angle  delta = angle2 - angle1;
 
+
     delta %= FT_ANGLE_2PI;
     if ( delta < 0 )
       delta += FT_ANGLE_2PI;
index 553b84f..3975584 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for PS names support (body).                   */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   }
 
 
+  /* documentation is in t1tables.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Get_PS_Font_Private( FT_Face         face,
+                          PS_PrivateRec*  afont_private )
+  {
+    FT_Error  error = FT_Err_Invalid_Argument;
+
+
+    if ( face )
+    {
+      FT_Service_PsInfo  service = NULL;
+
+
+      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
+
+      if ( service && service->ps_get_font_private )
+        error = service->ps_get_font_private( face, afont_private );
+    }
+
+    return error;
+  }
+
+
 /* END */
index 9d3ec43..5b3aa8b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for memory and list management (body).         */
 /*                                                                         */
-/*  Copyright 2002, 2004 by                                                */
+/*  Copyright 2002, 2004, 2005 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 @@
 #include <ft2build.h>
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_OBJECTS_H
 #include FT_LIST_H
 
 
@@ -77,6 +78,8 @@
   }
 
 
+  /* documentation is in ftmemory.h */
+
   FT_BASE_DEF( FT_Error )
   FT_QAlloc( FT_Memory  memory,
              FT_Long    size,
   }
 
 
+  /* documentation is in ftmemory.h */
+
   FT_BASE_DEF( FT_Error )
   FT_QRealloc( FT_Memory  memory,
                FT_Long    current,
   }
 
 
+  FT_BASE( 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;
+  }
+
+
 /* END */
index 46f618c..bc2e90e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing Windows FNT specific info (body).         */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -22,6 +22,8 @@
 #include FT_SERVICE_WINFNT_H
 
 
+  /* documentation is in ftwinfnt.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Get_WinFNT_Header( FT_Face               face,
                         FT_WinFNT_HeaderRec  *header )
index 04e8023..a4bf767 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for X11 support (body).                        */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -21,6 +21,9 @@
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_XFREE86_NAME_H
 
+
+  /* documentation is in ftxf86.h */
+
   FT_EXPORT_DEF( const char* )
   FT_Get_X11_Font_Format( FT_Face  face )
   {
index 8017e85..a92cb0d 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004 by
+# Copyright 1996-2000, 2002, 2003, 2004, 2005 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -50,12 +50,15 @@ BASE_SRC := $(BASE_DIR)/ftapi.c    \
 # object.  It will then be linked to the final executable only if one of its
 # symbols is used by the application.
 #
-BASE_EXT_SRC := $(BASE_DIR)/ftbbox.c   \
+BASE_EXT_SRC := $(BASE_DIR)/ftbitmap.c \
+                $(BASE_DIR)/ftbbox.c   \
                 $(BASE_DIR)/ftbdf.c    \
                 $(BASE_DIR)/ftglyph.c  \
                 $(BASE_DIR)/ftmm.c     \
+                $(BASE_DIR)/ftotval.c  \
                 $(BASE_DIR)/ftpfr.c    \
                 $(BASE_DIR)/ftstroke.c \
+                $(BASE_DIR)/ftsynth.c  \
                 $(BASE_DIR)/fttype1.c  \
                 $(BASE_DIR)/ftwinfnt.c \
                 $(BASE_DIR)/ftxf86.c
index 8b1714d..da23ccd 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/bdf Jamfile (c) 2002 David Turner
+# FreeType 2 src/bdf Jamfile
 #
+# Copyright 2002 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) bdf ;
 
index 8f33d53..e14306e 100644 (file)
@@ -2,7 +2,7 @@
 
     FreeType font driver for bdf files
 
-    Copyright (C) 2001, 2002, 2003, 2004 by
+    Copyright (C) 2001, 2002, 2003, 2004, 2005 by
     Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -416,13 +416,13 @@ THE SOFTWARE.
 
         FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) );
 
-        bsize->height = font->font_ascent + font->font_descent;
+        bsize->height = (FT_Short)( font->font_ascent + font->font_descent );
 
         prop = bdf_get_font_property( font, "AVERAGE_WIDTH" );
         if ( prop )
           bsize->width = (FT_Short)( ( prop->value.int32 + 5 ) / 10 );
         else
-          bsize->width = bsize->height * 2/3;
+          bsize->width = (FT_Short)( bsize->height * 2/3 );
 
         prop = bdf_get_font_property( font, "POINT_SIZE" );
         if ( prop )
@@ -586,13 +586,9 @@ THE SOFTWARE.
     FT_Face   root = FT_FACE( face );
 
     FT_UNUSED( char_width );
-    FT_UNUSED( char_height );
-
 
-    FT_TRACE4(( "rec %d - pres %d\n",
-                size->metrics.y_ppem, root->available_sizes->y_ppem ));
 
-    if ( size->metrics.y_ppem == root->available_sizes->y_ppem >> 6 )
+    if ( char_height == (FT_UInt)root->available_sizes->height )
     {
       size->metrics.ascender    = face->bdffont->font_ascent << 6;
       size->metrics.descender   = -face->bdffont->font_descent << 6;
@@ -614,12 +610,30 @@ THE SOFTWARE.
                       FT_UInt     horz_resolution,
                       FT_UInt     vert_resolution )
   {
+    BDF_Face  face = (BDF_Face)FT_SIZE_FACE( size );
+    FT_Face   root = FT_FACE( face );
+
     FT_UNUSED( char_width );
     FT_UNUSED( char_height );
     FT_UNUSED( horz_resolution );
     FT_UNUSED( vert_resolution );
 
-    return BDF_Set_Pixel_Size( size, 0, 0 );
+
+    FT_TRACE4(( "rec %d - pres %d\n",
+                size->metrics.y_ppem, root->available_sizes->y_ppem ));
+
+    if ( size->metrics.y_ppem == root->available_sizes->y_ppem >> 6 )
+    {
+      size->metrics.ascender    = face->bdffont->font_ascent << 6;
+      size->metrics.descender   = -face->bdffont->font_descent << 6;
+      size->metrics.height      = ( face->bdffont->font_ascent +
+                                    face->bdffont->font_descent ) << 6;
+      size->metrics.max_advance = face->bdffont->bbx.width << 6;
+
+      return BDF_Err_Ok;
+    }
+    else
+      return BDF_Err_Invalid_Pixel_Size;
   }
 
 
@@ -629,13 +643,11 @@ THE SOFTWARE.
                   FT_UInt       glyph_index,
                   FT_Int32      load_flags )
   {
-    BDF_Face        face   = (BDF_Face)FT_SIZE_FACE( size );
-    FT_Error        error  = BDF_Err_Ok;
-    FT_Bitmap*      bitmap = &slot->bitmap;
-    bdf_glyph_t     glyph;
-    int             bpp    = face->bdffont->bpp;
-    int             i, j, count;
-    unsigned char   *p, *pp;
+    BDF_Face     face   = (BDF_Face)FT_SIZE_FACE( size );
+    FT_Error     error  = BDF_Err_Ok;
+    FT_Bitmap*   bitmap = &slot->bitmap;
+    bdf_glyph_t  glyph;
+    int          bpp    = face->bdffont->bpp;
 
     FT_UNUSED( load_flags );
 
@@ -657,109 +669,27 @@ THE SOFTWARE.
 
     bitmap->rows  = glyph.bbx.height;
     bitmap->width = glyph.bbx.width;
+    bitmap->pitch = glyph.bpr;
 
-    if ( bpp == 1 )
-    {
-      bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
-      bitmap->pitch      = glyph.bpr;
+    /* note: we don't allocate a new array to hold the bitmap; */
+    /*       we can simply point to it                         */
+    ft_glyphslot_set_bitmap( slot, glyph.bitmap );
 
-     /* note: we don't allocate a new array to hold the bitmap, we */
-     /*       can simply point to it                               */
-      ft_glyphslot_set_bitmap( slot, glyph.bitmap );
-    }
-    else
+    switch ( bpp )
     {
-      /* blow up pixmap to have 8 bits per pixel */
+    case 1:
+      bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
+      break;
+    case 2:
+      bitmap->pixel_mode = FT_PIXEL_MODE_GRAY2;
+      break;
+    case 4:
+      bitmap->pixel_mode = FT_PIXEL_MODE_GRAY4;
+      break;
+    case 8:
       bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
-      bitmap->pitch      = bitmap->width;
-
-      error = ft_glyphslot_alloc_bitmap( slot, bitmap->rows * bitmap->pitch );
-      if ( error )
-        goto Exit;
-
-      switch ( bpp )
-      {
-      case 2:
-        bitmap->num_grays = 4;
-
-        count = 0;
-        p     = glyph.bitmap;
-
-        for ( i = 0; i < bitmap->rows; i++ )
-        {
-          pp = p;
-
-          /* get the full bytes */
-          for ( j = 0; j < ( bitmap->width >> 2 ); j++ )
-          {
-            bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0xC0 ) >> 6 );
-            bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0x30 ) >> 4 );
-            bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0x0C ) >> 2 );
-            bitmap->buffer[count++] = (FT_Byte)(   *pp & 0x03 );
-
-            pp++;
-          }
-
-          /* get remaining pixels (if any) */
-          switch ( bitmap->width & 3 )
-          {
-          case 3:
-            bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0xC0 ) >> 6 );
-            /* fall through */
-          case 2:
-            bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0x30 ) >> 4 );
-            /* fall through */
-          case 1:
-            bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0x0C ) >> 2 );
-            /* fall through */
-          case 0:
-            break;
-          }
-
-          p += glyph.bpr;
-        }
-        break;
-
-      case 4:
-        bitmap->num_grays = 16;
-
-        count = 0;
-        p     = glyph.bitmap;
-
-        for ( i = 0; i < bitmap->rows; i++ )
-        {
-          pp = p;
-
-          /* get the full bytes */
-          for ( j = 0; j < ( bitmap->width >> 1 ); j++ )
-          {
-            bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0xF0 ) >> 4 );
-            bitmap->buffer[count++] = (FT_Byte)(   *pp & 0x0F );
-
-            pp++;
-          }
-
-          /* get remaining pixel (if any) */
-          switch ( bitmap->width & 1 )
-          {
-          case 1:
-            bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0xF0 ) >> 4 );
-            /* fall through */
-          case 0:
-            break;
-          }
-
-          p += glyph.bpr;
-        }
-        break;
-
-      case 8:
-        bitmap->num_grays = 256;
-
-        FT_MEM_COPY( bitmap->buffer, glyph.bitmap,
-                     bitmap->rows * bitmap->pitch );
-        break;
-      }
+      bitmap->num_grays  = 256;
+      break;
     }
 
     slot->bitmap_left = glyph.bbx.x_offset;
index 825385e..31100ed 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright 2000 Computing Research Labs, New Mexico State University
- * Copyright 2001, 2002, 2003, 2004 Francesco Zappa Nardelli
+ * Copyright 2001, 2002, 2003, 2004, 2005 Francesco Zappa Nardelli
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 
     if ( FT_NEW_ARRAY( ht->table, ht->size ) )
       goto Exit;
-    FT_MEM_ZERO( ht->table, sizeof ( hashnode ) * ht->size );
 
     for ( i = 0, bp = obp; i < sz; i++, bp++ )
     {
 
     if ( FT_NEW_ARRAY( ht->table, sz ) )
       goto Exit;
-    FT_MEM_ZERO( ht->table, sizeof ( hashnode ) * sz );
 
   Exit:
     return error;
     char**         field;
     unsigned long  size;
     unsigned long  used;
+    FT_Memory      memory;
 
   } _bdf_list_t;
 
 #define sbitset( m, cc )  ( m[(cc) >> 3]  & ( 1 << ( (cc) & 7 ) ) )
 
 
+  static void
+  _bdf_list_init( _bdf_list_t*  list,
+                  FT_Memory     memory )
+  {
+    FT_ZERO( list );
+    list->memory = memory;
+  }
+
+
+  static void
+  _bdf_list_done( _bdf_list_t*  list )
+  {
+    FT_Memory  memory = list->memory;
+
+
+    if ( memory )
+    {
+      FT_FREE( list->field );
+      FT_ZERO( list );
+    }
+  }
+
+
+  static FT_Error
+  _bdf_list_ensure( _bdf_list_t*  list,
+                    int           num_items )
+  {
+    FT_Error  error = BDF_Err_Ok;
+
+
+    if ( num_items > (int)list->size )
+    {
+      int        oldsize = list->size;
+      int        newsize = oldsize + ( oldsize >> 1 ) + 4;
+      int        bigsize = FT_INT_MAX / sizeof ( char* );
+      FT_Memory  memory  = list->memory;
+
+
+      if ( oldsize == bigsize )
+      {
+        error = BDF_Err_Out_Of_Memory;
+        goto Exit;
+      }
+      else if ( newsize < oldsize || newsize > bigsize )
+        newsize = bigsize;
+
+      if ( FT_RENEW_ARRAY( list->field, oldsize, newsize ) )
+        goto Exit;
+
+      list->size = newsize;
+    }
+
+  Exit:
+    return error;
+  }
+
+
+  static void
+  _bdf_list_shift( _bdf_list_t*   list,
+                   unsigned long  n )
+  {
+    unsigned long  i, u;
+
+
+    if ( list == 0 || list->used == 0 || n == 0 )
+      return;
+
+    if ( n >= list->used )
+    {
+      list->used = 0;
+      return;
+    }
+
+    for ( u = n, i = 0; u < list->used; i++, u++ )
+      list->field[i] = list->field[u];
+    list->used -= n;
+  }
+
+
+  static char *
+  _bdf_list_join( _bdf_list_t*    list,
+                  int             c,
+                  unsigned long  *alen )
+  {
+    unsigned long  i, j;
+    char           *fp, *dp;
+
+
+    *alen = 0;
+
+    if ( list == 0 || list->used == 0 )
+      return 0;
+
+    dp = list->field[0];
+    for ( i = j = 0; i < list->used; i++ )
+    {
+      fp = list->field[i];
+      while ( *fp )
+        dp[j++] = *fp++;
+
+      if ( i + 1 < list->used )
+        dp[j++] = (char)c;
+    }
+    dp[j] = 0;
+
+    *alen = j;
+    return dp;
+  }
+
+
   /* An empty string for empty fields. */
 
   static const char  empty[1] = { 0 };      /* XXX eliminate this */
 
 
-  /* Assume the line is NULL-terminated and that the `list' parameter */
-  /* was initialized the first time it was used.                      */
-
   static FT_Error
-  _bdf_split( char*          separators,
-              char*          line,
-              unsigned long  linelen,
-              _bdf_list_t*   list,
-              FT_Memory      memory )
+  _bdf_list_split( _bdf_list_t*   list,
+                   char*          separators,
+                   char*          line,
+                   unsigned long  linelen )
   {
     int       mult, final_empty;
     char      *sp, *ep, *end;
       /* Resize the list if necessary. */
       if ( list->used == list->size )
       {
-        if ( list->size == 0 )
-        {
-          if ( FT_NEW_ARRAY( list->field, 5 ) )
-            goto Exit;
-        }
-        else
-        {
-          if ( FT_RENEW_ARRAY ( list->field ,
-                                list->size,
-                                list->size + 5 ) )
-            goto Exit;
-        }
-
-        list->size += 5;
+        error = _bdf_list_ensure( list, list->used + 1 );
+        if ( error )
+          goto Exit;
       }
 
       /* Assign the field appropriately. */
     }
 
     /* Finally, NULL-terminate the list. */
-    if ( list->used + final_empty + 1 >= list->size )
+    if ( list->used + final_empty >= list->size )
     {
-      if ( list->used == list->size )
-      {
-        if ( list->size == 0 )
-        {
-          if ( FT_NEW_ARRAY( list->field, 5 ) )
-            goto Exit;
-        }
-        else
-        {
-          if ( FT_RENEW_ARRAY( list->field,
-                               list->size,
-                               list->size + 5 ) )
-            goto Exit;
-        }
-
-        list->size += 5;
-      }
+      error = _bdf_list_ensure( list, list->used + final_empty + 1 );
+      if ( error )
+        goto Exit;
     }
 
     if ( final_empty )
       list->field[list->used++] = (char*)empty;
 
-    if ( list->used == list->size )
-    {
-      if ( list->size == 0 )
-      {
-        if ( FT_NEW_ARRAY( list->field, 5 ) )
-          goto Exit;
-      }
-      else
-      {
-        if ( FT_RENEW_ARRAY( list->field,
-                             list->size,
-                             list->size + 5 ) )
-          goto Exit;
-      }
-
-      list->size += 5;
-    }
-
     list->field[list->used] = 0;
 
   Exit:
   }
 
 
-  static void
-  _bdf_shift( unsigned long  n,
-              _bdf_list_t*   list )
-  {
-    unsigned long  i, u;
-
-
-    if ( list == 0 || list->used == 0 || n == 0 )
-      return;
-
-    if ( n >= list->used )
-    {
-      list->used = 0;
-      return;
-    }
-
-    for ( u = n, i = 0; u < list->used; i++, u++ )
-      list->field[i] = list->field[u];
-    list->used -= n;
-  }
-
-
-  static char *
-  _bdf_join( int             c,
-             unsigned long*  len,
-             _bdf_list_t*    list )
-  {
-    unsigned long  i, j;
-    char           *fp, *dp;
-
-
-    if ( list == 0 || list->used == 0 )
-      return 0;
-
-    *len = 0;
-
-    dp = list->field[0];
-    for ( i = j = 0; i < list->used; i++ )
-    {
-      fp = list->field[i];
-      while ( *fp )
-        dp[j++] = *fp++;
-
-      if ( i + 1 < list->used )
-        dp[j++] = (char)c;
-    }
-    dp[j] = 0;
-
-    *len = j;
-    return dp;
-  }
-
-
-  /* High speed file reader that passes each line to a callback. */
-  static FT_Error
-  bdf_internal_readstream( FT_Stream  stream,
-                           char*      buffer,
-                           int        count,
-                           int       *read_bytes )
-  {
-    int            rbytes;
-    unsigned long  pos   = stream->pos;
-    FT_Error       error = BDF_Err_Ok;
-
-
-    if ( pos > stream->size )
-    {
-      FT_ERROR(( "bdf_internal_readstream:" ));
-      FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
-                 pos, stream->size ));
-      error = BDF_Err_Invalid_Stream_Operation;
-      goto Exit;
-    }
-
-    if ( stream->read )
-      rbytes = stream->read( stream, pos,
-                             (unsigned char *)buffer, count );
-    else
-    {
-      rbytes = stream->size - pos;
-      if ( rbytes > count )
-        rbytes = count;
-
-      FT_MEM_COPY( buffer, stream->base + pos, rbytes );
-    }
-
-    stream->pos = pos + rbytes;
-
-    *read_bytes = rbytes;
-
-  Exit:
-    return error;
-  }
+#define NO_SKIP  256  /* this value cannot be stored in a 'char' */
 
 
   static FT_Error
                    unsigned long    *lno )
   {
     _bdf_line_func_t  cb;
-    unsigned long     lineno;
-    int               n, done, refill, bytes, hold;
-    char              *ls, *le, *pp, *pe, *hp;
-    char              *buf = 0;
+    unsigned long     lineno, buf_size;
+    int               refill, bytes, hold, to_skip;
+    int               start, end, cursor, avail;
+    char*             buf = 0;
     FT_Memory         memory = stream->memory;
     FT_Error          error = BDF_Err_Ok;
 
       goto Exit;
     }
 
-    if ( FT_NEW_ARRAY( buf, 65536L ) )
-      goto Exit;
+    /* initial size and allocation of the input buffer */
+    buf_size = 1024;
 
-    cb     = callback;
-    lineno = 1;
-    buf[0] = 0;
-
-    done = 0;
-    pp = ls = le = buf;
+    if ( FT_NEW_ARRAY( buf, buf_size ) )
+      goto Exit;
 
-    bytes = 65536L;
+    cb      = callback;
+    lineno  = 1;
+    buf[0]  = 0;
+    start   = 0;
+    end     = 0;
+    avail   = 0;
+    cursor  = 0;
+    refill  = 1;
+    to_skip = NO_SKIP;
+    bytes   = 0;        /* make compiler happy */
 
-    while ( !done )
+    for (;;)
     {
-      error = bdf_internal_readstream( stream, pp, bytes, &n );
-      if ( error )
-        goto Exit;
+      if ( refill )
+      {
+        bytes  = (int)FT_Stream_TryRead( stream, (FT_Byte*)buf + cursor,
+                                         (FT_ULong)(buf_size - cursor) );
+        avail  = cursor + bytes;
+        cursor = 0;
+        refill = 0;
+      }
 
-      if ( n == 0 )
-        break;
+      end = start;
 
-      /* Determine the new end of the buffer pages. */
-      pe = pp + n;
+      /* should we skip an optional character like \n or \r? */
+      if ( start < avail && buf[start] == to_skip )
+      {
+        start  += 1;
+        to_skip = NO_SKIP;
+        continue;
+      }
 
-      for ( refill = 0; done == 0 && refill == 0; )
+      /* try to find the end of the line */
+      while ( end < avail && buf[end] != '\n' && buf[end] != '\r' )
+        end++;
+
+      /* if we hit the end of the buffer, try shifting its content */
+      /* or even resizing it                                       */
+      if ( end >= avail )
       {
-        while ( le < pe && *le != '\n' && *le != '\r' )
-          le++;
+        if ( bytes == 0 )  /* last line in file doesn't end in \r or \n */
+          break;           /* ignore it then exit                       */
 
-        if ( le == pe )
+        if ( start == 0 )
         {
-          /* Hit the end of the last page in the buffer.  Need to find */
-          /* out how many pages to shift and how many pages need to be */
-          /* read in.  Adjust the line start and end pointers down to  */
-          /* point to the right places in the pages.                   */
-
-          pp  = buf + ( ( ( ls - buf ) >> 13 ) << 13 );
-          n   = pp - buf;
-          ls -= n;
-          le -= n;
-          n   = pe - pp;
-
-          FT_MEM_MOVE( buf, pp, n );
-
-          pp     = buf + n;
-          bytes  = 65536L - n;
-          refill = 1;
+          /* this line is definitely too long; try resizing the input */
+          /* buffer a bit to handle it.                               */
+          FT_ULong  new_size;
+
+
+          if ( buf_size >= 65536UL )  /* limit ourselves to 64KByte */
+          {
+            error = BDF_Err_Invalid_Argument;
+            goto Exit;
+          }
+
+          new_size = buf_size * 2;
+          if ( FT_RENEW_ARRAY( buf, buf_size, new_size ) )
+            goto Exit;
+
+          cursor   = buf_size;
+          buf_size = new_size;
         }
         else
         {
-          /* Temporarily NULL-terminate the line. */
-          hp   = le;
-          hold = *le;
-          *le  = 0;
-
-          /* XXX: Use encoding independent value for 0x1a */
-          if ( *ls != '#' && *ls != 0x1a                          &&
-               le > ls                                            &&
-               ( error = (*cb)( ls, le - ls, lineno, (void *)&cb,
-                                client_data ) ) != BDF_Err_Ok     )
-            done = 1;
-          else
-          {
-            ls = ++le;
-            /* Handle the case of DOS crlf sequences. */
-            if ( le < pe && hold == '\n' && *le =='\r' )
-              ls = ++le;
-          }
+          bytes = avail - start;
 
-          /* Increment the line number. */
-          lineno++;
+          FT_MEM_COPY( buf, buf + start, bytes );
 
-          /* Restore the character at the end of the line. */
-          *hp = (char)hold;
+          cursor = bytes;
+          avail -= bytes;
+          start  = 0;
         }
+        refill = 1;
+        continue;
+      }
+
+      /* Temporarily NUL-terminate the line. */
+      hold     = buf[end];
+      buf[end] = 0;
+
+      /* XXX: Use encoding independent value for 0x1a */
+      if ( buf[start] != '#' && buf[start] != 0x1a && end > start )
+      {
+        error = (*cb)( buf + start, end - start, lineno,
+                       (void*)&cb, client_data );
+        if ( error )
+          break;
       }
+
+      lineno  += 1;
+      buf[end] = (char)hold;
+      start    = end + 1;
+
+      if ( hold == '\n' )
+        to_skip = '\r';
+      else if ( hold == '\r' )
+        to_skip = '\n';
+      else
+        to_skip = NO_SKIP;
     }
 
-    *lno             = lineno;
+    *lno = lineno;
 
   Exit:
     FT_FREE( buf );
 
     if ( c1->encoding < c2->encoding )
       return -1;
-    else if ( c1->encoding > c2->encoding )
+
+    if ( c1->encoding > c2->encoding )
       return 1;
 
     return 0;
     if ( hash_lookup( name, &(font->proptbl) ) )
       goto Exit;
 
-    if ( font->nuser_props == 0 )
-    {
-      if ( FT_NEW_ARRAY( font->user_props, 1 ) )
-        goto Exit;
-    }
-    else
-    {
-      if ( FT_RENEW_ARRAY( font->user_props,
-                           font->nuser_props,
-                           font->nuser_props + 1 ) )
-        goto Exit;
-    }
+    if ( FT_RENEW_ARRAY( font->user_props,
+                         font->nuser_props,
+                         font->nuser_props + 1 ) )
+      goto Exit;
 
     p = font->user_props + font->nuser_props;
-    FT_MEM_ZERO( p, sizeof ( bdf_property_t ) );
+    FT_ZERO( p );
 
     n = (unsigned long)( ft_strlen( name ) + 1 );
+
     if ( FT_NEW_ARRAY( p->name, n ) )
       goto Exit;
 
     FT_Error   error = BDF_Err_Ok;
 
 
-    if ( font->comments_len == 0 )
-    {
-      if ( FT_NEW_ARRAY( font->comments, len + 1 ) )
-        goto Exit;
-    }
-    else
-    {
-      if ( FT_RENEW_ARRAY( font->comments,
-                           font->comments_len,
-                           font->comments_len + len + 1 ) )
-        goto Exit;
-    }
+    if ( FT_RENEW_ARRAY( font->comments,
+                         font->comments_len,
+                         font->comments_len + len + 1 ) )
+      goto Exit;
 
     cp = font->comments + font->comments_len;
+
     FT_MEM_COPY( cp, comment, len );
-    cp   += len;
-    *cp++ = '\n';
+    cp[len] = '\n';
+
     font->comments_len += len + 1;
 
   Exit:
 
     memory = font->memory;
 
+    _bdf_list_init( &list, memory );
+
     font->spacing = opts->font_spacing;
 
     len = (unsigned long)( ft_strlen( font->name ) + 1 );
     FT_MEM_COPY( name, font->name, len );
 
-    list.size = list.used = 0;
-
-    error = _bdf_split( (char *)"-", name, len, &list, memory );
+    error = _bdf_list_split( &list, (char *)"-", name, len );
     if ( error )
-      goto Exit;
+      goto Fail;
 
     if ( list.used == 15 )
     {
       }
     }
 
-    FT_FREE( list.field );
+  Fail:
+    _bdf_list_done( &list );
 
   Exit:
     return error;
         goto Exit;
       }
 
-      error = _bdf_split( (char *)" +", line, linelen, &p->list, memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
       p->cnt = font->glyphs_size = _bdf_atoul( p->list.field[1], 0, 10 );
       /* encoding can be checked for an unencoded character.      */
       FT_FREE( p->glyph_name );
 
-      error = _bdf_split( (char *)" +", line, linelen, &p->list,memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
-      _bdf_shift( 1, &p->list );
 
-      s = _bdf_join( ' ', &slen, &p->list );
+      _bdf_list_shift( &p->list, 1 );
+
+      s = _bdf_list_join( &p->list, ' ', &slen );
 
       if ( FT_NEW_ARRAY( p->glyph_name, slen + 1 ) )
         goto Exit;
+
       FT_MEM_COPY( p->glyph_name, s, slen + 1 );
 
       p->flags |= _BDF_GLYPH;
         goto Exit;
       }
 
-      error = _bdf_split( (char *)" +", line, linelen, &p->list, memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
+
       p->glyph_enc = _bdf_atol( p->list.field[1], 0, 10 );
 
       /* Check to see whether this encoding has already been encountered. */
                                font->glyphs_size,
                                font->glyphs_size + 64 ) )
             goto Exit;
-          FT_MEM_ZERO( font->glyphs + font->glyphs_size,
-                       sizeof ( bdf_glyph_t ) * 64 ); /* FZ inutile */
+
           font->glyphs_size += 64;
         }
 
           /* Allocate the next unencoded glyph. */
           if ( font->unencoded_used == font->unencoded_size )
           {
-            if ( font->unencoded_size == 0 )
-            {
-              if ( FT_NEW_ARRAY( font->unencoded, 4 ) )
-                goto Exit;
-            }
-            else
-            {
-              if ( FT_RENEW_ARRAY( font->unencoded ,
-                                   font->unencoded_size,
-                                   font->unencoded_size + 4 ) )
-                goto Exit;
-            }
+            if ( FT_RENEW_ARRAY( font->unencoded ,
+                                 font->unencoded_size,
+                                 font->unencoded_size + 4 ) )
+              goto Exit;
+
             font->unencoded_size += 4;
           }
 
         goto Exit;
       }
 
-      error = _bdf_split( (char *)" +", line, linelen, &p->list, memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
+
       glyph->swidth = (unsigned short)_bdf_atoul( p->list.field[1], 0, 10 );
       p->flags |= _BDF_SWIDTH;
 
     /* Expect the DWIDTH (scalable width) field next. */
     if ( ft_memcmp( line, "DWIDTH", 6 ) == 0 )
     {
-      error = _bdf_split( (char *)" +", line, linelen, &p->list,memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
+
       glyph->dwidth = (unsigned short)_bdf_atoul( p->list.field[1], 0, 10 );
 
       if ( !( p->flags & _BDF_SWIDTH ) )
     /* Expect the BBX field next. */
     if ( ft_memcmp( line, "BBX", 3 ) == 0 )
     {
-      error = _bdf_split( (char *)" +", line, linelen, &p->list, memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
 
     char*              name;
     char*              value;
     char               nbuf[128];
-    FT_Memory          memory;
     FT_Error           error = BDF_Err_Ok;
 
     FT_UNUSED( lineno );
     next = (_bdf_line_func_t *)call_data;
     p    = (_bdf_parse_t *)    client_data;
 
-    memory = p->font->memory;
-
     /* Check for the end of the properties. */
     if ( ft_memcmp( line, "ENDPROPERTIES", 13 ) == 0 )
     {
     }
     else
     {
-      error = _bdf_split( (char *)" +", line, linelen, &p->list, memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
       name = p->list.field[0];
 
-      _bdf_shift( 1, &p->list );
-      value = _bdf_join( ' ', &vlen, &p->list );
+      _bdf_list_shift( &p->list, 1 );
+      value = _bdf_list_join( &p->list, ' ', &vlen );
 
       error = _bdf_add_property( p->font, name, value );
       if ( error )
     /* Check for the start of the properties. */
     if ( ft_memcmp( line, "STARTPROPERTIES", 15 ) == 0 )
     {
-      error = _bdf_split( (char *)" +", line, linelen, &p->list, memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
       p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1], 0, 10 );
         goto Exit;
       }
 
-      error = _bdf_split( (char *)" +", line, linelen, &p->list , memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
 
     /* The next thing to check for is the FONT field. */
     if ( ft_memcmp( line, "FONT", 4 ) == 0 )
     {
-      error = _bdf_split( (char *)" +", line, linelen, &p->list , memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
-      _bdf_shift( 1, &p->list );
+      _bdf_list_shift( &p->list, 1 );
 
-      s = _bdf_join( ' ', &slen, &p->list );
+      s = _bdf_list_join( &p->list, ' ', &slen );
       if ( FT_NEW_ARRAY( p->font->name, slen + 1 ) )
         goto Exit;
       FT_MEM_COPY( p->font->name, s, slen + 1 );
         goto Exit;
       }
 
-      error = _bdf_split( (char *)" +", line, linelen, &p->list, memory );
+      error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
 
     FT_Error       error  = BDF_Err_Ok;
 
 
-    if ( FT_ALLOC( p, sizeof ( _bdf_parse_t ) ) )
+    if ( FT_NEW( p ) )
       goto Exit;
 
     memory    = NULL;
     p->minlb  = 32767;
     p->memory = extmemory;  /* only during font creation */
 
+    _bdf_list_init( &p->list, extmemory );
+
     error = _bdf_readstream( stream, _bdf_parse_start,
                              (void *)p, &lineno );
     if ( error )
       }
     }
 
-    /* Free up the list used during the parsing. */
-    if ( memory != NULL )
-      FT_FREE( p->list.field );
-
     if ( p->font != 0 )
     {
       /* Make sure the comments are NULL terminated if they exist. */
   Exit:
     if ( p )
     {
+      _bdf_list_done( &p->list );
+
       memory = extmemory;
+
       FT_FREE( p );
     }
 
index b269c95..340cff7 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/cache Jamfile (c) 2001, 2003, 2004 David Turner
+# FreeType 2 src/cache Jamfile
 #
+# Copyright 2001, 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.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) cache ;
 
index 9a91f35..689cdc6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType basic cache interface (body).                           */
 /*                                                                         */
-/*  Copyright 2003, 2004 by                                                */
+/*  Copyright 2003, 2004, 2005 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 @@
 
   } FTC_BasicAttrRec, *FTC_BasicAttrs;
 
-#define FTC_BASIC_ATTR_COMPARE( a, b )                           \
-          ( FTC_SCALER_COMPARE( &(a)->scaler, &(b)->scaler ) &&  \
-            (a)->load_flags == (b)->load_flags               )
+#define FTC_BASIC_ATTR_COMPARE( a, b )                                 \
+          FT_BOOL( FTC_SCALER_COMPARE( &(a)->scaler, &(b)->scaler ) && \
+                   (a)->load_flags == (b)->load_flags               )
 
 #define FTC_BASIC_ATTR_HASH( a )                                   \
           ( FTC_SCALER_HASH( &(a)->scaler ) + 31*(a)->load_flags )
                          FTC_Node       *anode )
   {
     FTC_BasicQueryRec  query;
-    FTC_INode          node;
+    FTC_INode          node = 0;  /* make compiler happy */
     FT_Error           error;
     FT_UInt32          hash;
 
   {
     FT_Error           error;
     FTC_BasicQueryRec  query;
-    FTC_SNode          node;
+    FTC_SNode          node = 0; /* make compiler happy */
     FT_UInt32          hash;
 
 
index 3a8a40c..ad03680 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType internal cache interface (body).                        */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     FT_Error  error;
     FTC_Node  node;
 
-    /*
-     *  Try to allocate a new cache node.  Note that in case of
-     *  out-of-memory error (OOM), we'll flush the cache a bit,
-     *  then try again.
-     *
-     *  On each try, the `tries' variable gives the number
-     *  of old nodes we want to flush from the manager's global list
-     *  before the next allocation attempt.  It barely doubles on
-     *  each iteration.
-     *
-     */
-    error = cache->clazz.node_new( &node, query, cache );
-    if ( error )
-      goto FlushCache;
 
-  AddNode:
-    /* don't assume that the cache has the same number of buckets, since
-     * our allocation request might have triggered global cache flushing
+    /*
+     * We use the FTC_CACHE_TRYLOOP macros to support out-of-memory
+     * errors (OOM) correctly, i.e., by flushing the cache progressively
+     * in order to make more room.
      */
-    ftc_cache_add( cache, hash, node );
-
-  Exit:
-    *anode = node;
-    return error;
-
-  FlushCache:
-    node = NULL;
-    if ( error != FT_Err_Out_Of_Memory )
-      goto Exit;
 
+    FTC_CACHE_TRYLOOP( cache )
     {
-      FTC_Manager  manager = cache->manager;
-      FT_UInt      count, tries = 1;
-
-
-      for (;;)
-      {
-        error = cache->clazz.node_new( &node, query, cache );
-        if ( !error )
-          break;
-
-        node = NULL;
-        if ( error != FT_Err_Out_Of_Memory )
-          goto Exit;
-
-        count = FTC_Manager_FlushN( manager, tries );
-        if ( count == 0 )
-          goto Exit;
+      error = cache->clazz.node_new( &node, query, cache );
+    }
+    FTC_CACHE_TRYLOOP_END();
 
-        if ( count == tries )
-        {
-          count = tries * 2;
-          if ( count < tries || count > manager->num_nodes )
-            count = manager->num_nodes;
-        }
-        tries = count;
-      }
+    if ( error )
+      node = NULL;
+    else
+    {
+     /* don't assume that the cache has the same number of buckets, since
+      * our allocation request might have triggered global cache flushing
+      */
+      ftc_cache_add( cache, hash, node );
     }
-    goto AddNode;
+
+    *anode = node;
+    return error;
   }
 
 
index b2812c9..02b8148 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType CharMap cache (body)                                        */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
           FT_Set_Charmap( face, old );
       }
 
-      node->indices[char_code - node->first] = gindex;
+      node->indices[char_code - node->first] = (FT_UShort)gindex;
     }
 
   Exit:
index 1f3158e..46d5965 100644 (file)
@@ -47,9 +47,8 @@
 
 
     gnode->family = NULL;
-    if ( family && --family->num_nodes <= 0 )
-      FTC_MruList_Remove( &FTC_GCACHE( cache )->families,
-                          (FTC_MruNode)family );
+    if ( family && --family->num_nodes == 0 )
+      FTC_FAMILY_FREE( family, cache );
   }
 
 
 
     FTC_MRULIST_LOOKUP( &cache->families, query, query->family, error );
     if ( !error )
+    {
+      FTC_Family  family = query->family;
+
+
+      /* prevent the family from being destroyed too early when an        */
+      /* out-of-memory condition occurs during glyph node initialization. */
+      family->num_nodes++;
+
       error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode );
 
+      if ( --family->num_nodes == 0 )
+        FTC_FAMILY_FREE( family, cache );
+    }
     return error;
   }
 
index 97d324c..337bea5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Cache Manager (body).                                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;
 
 
-    return node->scaler.face_id == face_id;
+    return FT_BOOL( node->scaler.face_id == face_id );
   }
 
 
         result++;
       }
 
-      if ( prev == manager->nodes_list )
+      if ( node == first )
         break;
 
       node = prev;
index 2f8c5f8..891c7ab 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType sbits manager (body).                                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   }
 
 
+  /*
+   *  This function tries to load a small bitmap within a given FTC_SNode.
+   *  Note that it returns a non-zero error code _only_ in the case of
+   *  out-of-memory condition.  For all other errors (e.g., corresponding
+   *  to a bad font file), this function will mark the sbit as `unavailable'
+   *  and return a value of 0.
+   *
+   *  You should also read the comment within the @ftc_snode_compare
+   *  function below to see how out-of-memory is handled during a lookup.
+   */
   static FT_Error
   ftc_snode_load( FTC_SNode    snode,
                   FTC_Manager  manager,
 #define CHECK_BYTE( d )  ( temp = (FT_Byte)d, temp == d )
 
       /* horizontal advance in pixels */
-      xadvance = ( slot->metrics.horiAdvance + 32 ) >> 6;
-      yadvance = ( slot->metrics.vertAdvance + 32 ) >> 6;
+      xadvance = ( slot->advance.x + 32 ) >> 6;
+      yadvance = ( slot->advance.y + 32 ) >> 6;
 
       if ( !CHECK_BYTE( bitmap->rows  )     ||
            !CHECK_BYTE( bitmap->width )     ||
       FTC_SBit  sbit = snode->sbits + ( gindex - gnode->gindex );
 
 
+      /*
+       *  The following code illustrates what to do when you want to
+       *  perform operations that may fail within a lookup function.
+       *
+       *  Here, we want to load a small bitmap on-demand; we thus
+       *  need to call the `ftc_snode_load' function which may return
+       *  a non-zero error code only when we are out of memory (OOM).
+       *
+       *  The correct thing to do is to use @FTC_CACHE_TRYLOOP and
+       *  @FTC_CACHE_TRYLOOP_END in order to implement a retry loop
+       *  that is capable of flushing the cache incrementally when
+       *  an OOM errors occur.
+       *
+       *  However, we need to `lock' the node before this operation to
+       *  prevent it from being flushed within the loop.
+       *
+       *  When we exit the loop, we unlock the node, then check the `error' 
+       *  variable.  If it is non-zero, this means that the cache was
+       *  completely flushed and that no usable memory was found to load
+       *  the bitmap.
+       *
+       *  We then prefer to return a value of 0 (i.e., NO MATCH).  This
+       *  ensures that the caller will try to allocate a new node.
+       *  This operation consequently _fail_ and the lookup function
+       *  returns the appropriate OOM error code.
+       *
+       *  Note that `buffer == NULL && width == 255' is a hack used to
+       *  tag `unavailable' bitmaps in the array.  We should never try
+       *  to load these.
+       *
+       */
+
       if ( sbit->buffer == NULL && sbit->width != 255 )
       {
         FT_ULong  size;
+        FT_Error  error;
+
 
+        ftcsnode->ref_count++;  /* lock node to prevent flushing */
+                                /* in retry loop                 */
 
-        if ( !ftc_snode_load( snode, cache->manager,
-                              gindex, &size ) )
+        FTC_CACHE_TRYLOOP( cache )
         {
-          cache->manager->cur_weight += size;
+          error = ftc_snode_load( snode, cache->manager, gindex, &size );
         }
+        FTC_CACHE_TRYLOOP_END();
+
+        ftcsnode->ref_count--;  /* unlock the node */
+
+        if ( error )
+          result = 0;
+        else
+          cache->manager->cur_weight += size;
       }
     }
 
index dcf24c8..6d0bb1b 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/cff Jamfile (c) 2001, 2002 David Turner
+# FreeType 2 src/cff Jamfile
 #
+# Copyright 2001, 2002 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) cff ;
 
index 82e04d2..88169d0 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CFF character mapping table (cmap) support (body).                   */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by                                          */
+/*  Copyright 2002, 2003, 2004, 2005 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)cff->psnames;
 
 
+    /* can't build Unicode map for CID-keyed font */
+    if ( !charset->sids )
+    {
+      error = CFF_Err_Invalid_Argument;
+      goto Exit;
+    }
+
     cmap->num_pairs = 0;
     cmap->pairs     = NULL;
 
       }
     }
 
+  Exit:
     return error;
   }
 
index e1f274e..8298e41 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -67,7 +67,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    Get_Kerning                                                        */
+  /*    cff_get_kerning                                                    */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A driver method used to return the kerning vector between two      */
   /*    They can be implemented by format-specific interfaces.             */
   /*                                                                       */
   FT_CALLBACK_DEF( FT_Error )
-  Get_Kerning( FT_Face     ttface,          /* TT_Face */
-               FT_UInt     left_glyph,
-               FT_UInt     right_glyph,
-               FT_Vector*  kerning )
+  cff_get_kerning( FT_Face     ttface,          /* TT_Face */
+                   FT_UInt     left_glyph,
+                   FT_UInt     right_glyph,
+                   FT_Vector*  kerning )
   {
-    TT_Face        face = (TT_Face)ttface;
-    TT_Kern0_Pair  pair;
+    TT_Face       face = (TT_Face)ttface;
+    SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
 
 
-    if ( !face )
-      return CFF_Err_Invalid_Face_Handle;
-
     kerning->x = 0;
     kerning->y = 0;
 
-    if ( face->kern_pairs )
-    {
-      /* there are some kerning pairs in this font file! */
-      FT_ULong  search_tag = PAIR_TAG( left_glyph, right_glyph );
-      FT_Long   left, right;
-
-
-      left  = 0;
-      right = face->num_kern_pairs - 1;
-
-      while ( left <= right )
-      {
-        FT_Long   middle = left + ( ( right - left ) >> 1 );
-        FT_ULong  cur_pair;
-
+    if ( sfnt )
+      kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );
 
-        pair     = face->kern_pairs + middle;
-        cur_pair = PAIR_TAG( pair->left, pair->right );
-
-        if ( cur_pair == search_tag )
-          goto Found;
-
-        if ( cur_pair < search_tag )
-          left = middle + 1;
-        else
-          right = middle - 1;
-      }
-    }
-
-  Exit:
     return CFF_Err_Ok;
-
-  Found:
-    kerning->x = pair->value;
-    goto Exit;
   }
 
 
 
   static const FT_Service_PsInfoRec  cff_service_ps_info =
   {
-    (PS_GetFontInfoFunc)  NULL,         /* unsupported with CFF fonts */
-    (PS_HasGlyphNamesFunc)cff_ps_has_glyph_names
+    (PS_GetFontInfoFunc)   NULL,        /* unsupported with CFF fonts */
+    (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names,
+    (PS_GetFontPrivateFunc)NULL         /* unsupported with CFF fonts */
   };
 
 
 
     Load_Glyph,
 
-    Get_Kerning,
+    cff_get_kerning,
     0,                      /* FT_Face_AttachFunc      */
     0                       /* FT_Face_GetAdvancesFunc */
   };
index 934dcb0..3c0ef6b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType Glyph Loader (body).                                        */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
 
-    font_matrix = cff->top_font.font_dict.font_matrix;
-    font_offset = cff->top_font.font_dict.font_offset;
+    if ( cff->num_subfonts >= 1 )
+    {
+      FT_Byte  fd_index = cff_fd_select_get( &cff->fd_select, glyph_index );
+
+
+      font_matrix = cff->subfonts[fd_index]->font_dict.font_matrix;
+      font_offset = cff->subfonts[fd_index]->font_dict.font_offset;
+    }
+    else
+    {
+      font_matrix = cff->top_font.font_dict.font_matrix;
+      font_offset = cff->top_font.font_dict.font_offset;
+    }
 
     /* Now, set the metrics -- this is rather simple, as   */
     /* the left side bearing is the xMin, and the top side */
index 350e01f..237915c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType and CFF data/program tables loader (body).                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
       FT_MEM_ZERO( charset->cids, sizeof ( FT_UShort ) * max_cid );
 
       for ( i = 0; i < num_glyphs; i++ )
-        charset->cids[charset->sids[i]] = i;
+        charset->cids[charset->sids[i]] = (FT_UShort)i;
     }
 
   Exit:
     FT_ULong         base_offset;
     CFF_FontRecDict  dict;
 
+
     FT_ZERO( font );
 
     font->stream = stream;
     /* read the Charset and Encoding tables if available */
     if ( font->num_glyphs > 0 )
     {
-      FT_Bool  invert;
+      FT_Bool  invert = FT_BOOL( dict->cid_registry != 0xFFFFU );
 
 
-      invert = dict->cid_registry != 0xFFFFU &&
-               font->charstrings_index.count != dict->cid_count;
       error = cff_charset_load( &font->charset, font->num_glyphs, stream,
                                 base_offset, dict->charset_offset, invert );
       if ( error )
index ec4d1e4..8522c1f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType objects manager (body).                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     sbit_metrics = &size->strike_metrics;
 
     error = sfnt->set_sbit_strike( face,
-                                   metrics->x_ppem, metrics->y_ppem,
+                                   metrics->x_ppem,
+                                   metrics->y_ppem,
                                    &strike_index );
 
     if ( !error )
     {
-      TT_SBit_Strike  strike = face->sbit_strikes + strike_index;
+      /* XXX: TODO: move this code to the SFNT module where it belongs */
 
+#ifdef FT_OPTIMIZE_MEMORY
 
-      sbit_metrics->x_ppem = metrics->x_ppem;
-      sbit_metrics->y_ppem = metrics->y_ppem;
+      FT_Byte*    strike = face->sbit_table + 8 + strike_index*48;
 
-      sbit_metrics->ascender  = strike->hori.ascender << 6;
-      sbit_metrics->descender = strike->hori.descender << 6;
+      sbit_metrics->ascender  = (FT_Char)strike[16] << 6;  /* hori.ascender  */
+      sbit_metrics->descender = (FT_Char)strike[17] << 6;  /* hori.descender */
 
       /* XXX: Is this correct? */
-      sbit_metrics->height = sbit_metrics->ascender -
-                             sbit_metrics->descender;
+      sbit_metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB  */
+                                             strike[18] + /* max_width      */
+                                    (FT_Char)strike[23]   /* min_advance_SB */
+                                                        ) << 6;
+
+#else /* !OPTIMIZE_MEMORY */
+
+      TT_SBit_Strike  strike = face->sbit_strikes + strike_index;
+
+
+      sbit_metrics->ascender  = strike->hori.ascender << 6;
+      sbit_metrics->descender = strike->hori.descender << 6;
 
       /* XXX: Is this correct? */
       sbit_metrics->max_advance = ( strike->hori.min_origin_SB  +
                                     strike->hori.max_width      +
                                     strike->hori.min_advance_SB ) << 6;
 
-      size->strike_index = (FT_UInt)strike_index;
+#endif /* !OPTIMIZE_MEMORY */
+
+      /* XXX: Is this correct? */
+      sbit_metrics->height = sbit_metrics->ascender -
+                             sbit_metrics->descender;
+
+      sbit_metrics->x_ppem = metrics->x_ppem;
+      sbit_metrics->y_ppem = metrics->y_ppem;
+      size->strike_index   = (FT_UInt)strike_index;
     }
     else
     {
     FT_Bool             pure_cff    = 1;
     FT_Bool             sfnt_format = 0;
 
+
 #if 0
     FT_FACE_FIND_GLOBAL_SERVICE( face, sfnt,     SFNT );
     FT_FACE_FIND_GLOBAL_SERVICE( face, psnames,  POSTSCRIPT_NAMES );
       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;
+      }
+
       sfnt_format = 1;
 
       /* now, the font can be either an OpenType/CFF font, or an SVG CEF */
       CFF_FontRecDict  dict;
       FT_Memory        memory = cffface->memory;
       FT_Int32         flags;
+      FT_UInt          i;
 
 
       if ( FT_NEW( cff ) )
       cff->psnames  = (void*)psnames;
 
       /* Complement the root flags with some interesting information. */
-      /* Note that this is only necessary for pure CFF and CEF fonts. */
+      /* Note that this is only necessary for pure CFF and CEF fonts; */
+      /* SFNT based fonts use the `name' table instead.               */
 
       cffface->num_glyphs = cff->num_glyphs;
 
         char*  style_name = NULL;
 
 
-        /* Set up num_faces. */
+        /* set up num_faces */
         cffface->num_faces = cff->num_faces;
 
         /* compute number of glyphs */
         cffface->height    = (FT_Short)(
           ( ( cffface->ascender - cffface->descender ) * 12 ) / 10 );
 
-        if ( dict->units_per_em )
-          cffface->units_per_EM = dict->units_per_em;
-        else
-          cffface->units_per_EM = 1000;
+        if ( !dict->units_per_em )
+          dict->units_per_em = 1000;
+
+        cffface->units_per_EM = dict->units_per_em;
 
         cffface->underline_position  =
           (FT_Short)( dict->underline_position >> 16 );
                                                     psnames );
           char*  fullp  = full;
           char*  family = cffface->family_name;
+          char*  family_name = 0;
+
+
+          if ( dict->family_name )
+          {
+            family_name = cff_index_get_sid_string( &cff->string_index,
+                                                    dict->family_name,
+                                                    psnames);
+            if ( family_name )
+              family = family_name;
+          }
 
           /* We try to extract the style name from the full name.   */
           /* We need to ignore spaces and dashes during the search. */
-          if ( full )
+          if ( full && family )
           {
             while ( *fullp )
             {
 
               if ( !*family && *fullp )
               {
-                /* Rhe full name begins with the same characters as the  */
+                /* The full name begins with the same characters as the  */
                 /* family name, with spaces and dashes removed.  In this */
                 /* case, the remaining string in `fullp' will be used as */
                 /* the style name.                                       */
               }
               break;
             }
+
+            if ( family_name )
+              FT_FREE( family_name );
             FT_FREE( full );
           }
         }
           FT_FREE( weight );
         }
 
+        /* double check */
+        if ( !(flags & FT_STYLE_FLAG_BOLD) && cffface->style_name )
+          if ( !strncmp( cffface->style_name, "Bold", 4 )  ||
+               !strncmp( cffface->style_name, "Black", 5 ) )
+            flags |= FT_STYLE_FLAG_BOLD;
+
         cffface->style_flags = flags;
       }
+      else
+      {
+        if ( !dict->units_per_em )
+          dict->units_per_em = face->root.units_per_EM;
+      }
+
+      /* handle font matrix settings in subfonts (if any) */
+      for ( i = cff->num_subfonts; i > 0; i-- )
+      {
+        CFF_FontRecDict  sub = &cff->subfonts[i - 1]->font_dict;
+        CFF_FontRecDict  top = &cff->top_font.font_dict;
+
+
+        if ( sub->units_per_em )
+        {
+          FT_Matrix  scale;
+
+
+          scale.xx = scale.yy = (FT_Fixed)FT_DivFix( top->units_per_em,
+                                                     sub->units_per_em );
+          scale.xy = scale.yx = 0;
+
+          FT_Matrix_Multiply( &scale, &sub->font_matrix );
+          FT_Vector_Transform( &sub->font_offset, &scale );
+        }
+        else
+        {
+          sub->font_matrix = top->font_matrix;
+          sub->font_offset = top->font_offset;
+        }
+      }
 
 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
       /* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */
index 8f1a98c..fdf7173 100644 (file)
                   FT_Int    power_ten )
   {
     FT_Byte*  p    = start;
-    FT_Long   num, divider, result, exp;
-    FT_Int    sign = 0, exp_sign = 0;
+    FT_Long   num, divider, result, exponent;
+    FT_Int    sign = 0, exponent_sign = 0;
     FT_UInt   nib;
     FT_UInt   phase;
 
     /* read exponent, if any */
     if ( nib == 12 )
     {
-      exp_sign = 1;
-      nib      = 11;
+      exponent_sign = 1;
+      nib           = 11;
     }
 
     if ( nib == 11 )
     {
-      exp = 0;
+      exponent = 0;
 
       for (;;)
       {
         if ( nib >= 10 )
           break;
 
-        exp = exp * 10 + nib;
+        exponent = exponent * 10 + nib;
       }
 
-      if ( exp_sign )
-        exp = -exp;
+      if ( exponent_sign )
+        exponent = -exponent;
 
-      power_ten += (FT_Int)exp;
+      power_ten += (FT_Int)exponent;
     }
 
     /* raise to power of ten if needed */
index 659d157..6bb27d5 100644 (file)
@@ -49,7 +49,7 @@
   CFF_FIELD_STRING  ( 0x116, base_font_name )
   CFF_FIELD_DELTA   ( 0x117, base_font_blend, 16 )
   CFF_FIELD_CALLBACK( 0x118, multiple_master )
-  CFF_FIELD_CALLBACK( 0x119, blend_axit_types )
+  CFF_FIELD_CALLBACK( 0x119, blend_axis_types )
 #endif
 
   CFF_FIELD_CALLBACK( 0x11E, cid_ros )
index a505e3c..ebeaed5 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/cid Jamfile (c) 2001 David Turner
+# FreeType 2 src/cid Jamfile
 #
+# Copyright 2001 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) cid ;
 
index ad29dd5..8d96ea6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 font loader (body).                                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
               if ( !name )
                 break;
 
-              if ( cur[0] == name[0]                     &&
-                   len == ft_strlen( (const char*)name ) )
+              if ( cur[0] == name[0]                                 &&
+                   len == (FT_PtrDist)ft_strlen( (const char*)name ) )
               {
                 FT_PtrDist  n;
 
       }
 
       if ( ft_isdigit( *p ) )
-        val = *p - '0';
+        val = (FT_Byte)( *p - '0' );
       else if ( *p >= 'a' && *p <= 'f' )
-        val = *p - 'a';
+        val = (FT_Byte)( *p - 'a' );
       else if ( *p >= 'A' && *p <= 'F' )
-        val = *p - 'A' + 10;
+        val = (FT_Byte)( *p - 'A' + 10 );
       else if ( *p == ' '  ||
                 *p == '\t' ||
                 *p == '\r' ||
       }
 
       if ( upper_nibble )
-        *d = val << 4;
+        *d = (FT_Byte)( val << 4 );
       else
       {
-        *d += val;
+        *d = (FT_Byte)( *d + val );
         d++;
       }
 
-      upper_nibble = 1 - upper_nibble;
+      upper_nibble = (FT_Byte)( 1 - upper_nibble );
 
       if ( done )
         break;
index 691ec17..3fb47bc 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID objects manager (body).                                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
-    CID_Face            face = (CID_Face)cidface;
-    FT_Error            error;
-    FT_Service_PsCMaps  psnames;
-    PSAux_Service       psaux;
-    PSHinter_Service    pshinter;
+    CID_Face          face = (CID_Face)cidface;
+    FT_Error          error;
+    PSAux_Service     psaux;
+    PSHinter_Service  pshinter;
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
 
     cidface->num_faces = 1;
 
-    FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
-
     psaux = (PSAux_Service)face->psaux;
     if ( !psaux )
     {
index 3f18749..a964d81 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 parser (body).                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
     while ( cur < limit )
     {
+      if ( parser->root.error )
+        break;
+
       if ( *cur == 'S' && ft_strncmp( (char*)cur, "StartData", 9 ) == 0 )
       {
         if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 )
index 7d885a8..377835b 100644 (file)
@@ -78,8 +78,9 @@
 
   static const FT_Service_PsInfoRec  cid_service_ps_info =
   {
-    (PS_GetFontInfoFunc)  cid_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)NULL          /* unsupported with CID fonts */
+    (PS_GetFontInfoFunc)   cid_ps_get_font_info,
+    (PS_HasGlyphNamesFunc) NULL,        /* unsupported with CID fonts */
+    (PS_GetFontPrivateFunc)NULL         /* unsupported                */
   };
 
 
index e461cf1..a7aafa0 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/gzip Jamfile (c) 2001 David Turner
+# FreeType 2 src/gzip Jamfile
 #
+# Copyright 2001 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) gzip ;
 
index a78c195..67e7bb8 100644 (file)
@@ -8,7 +8,7 @@
 /*  parse compressed PCF fonts, as found with many X11 server              */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by                                          */
+/*  Copyright 2002, 2003, 2004, 2005 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     FT_GZipFile  zip;
 
 
+    /*
+     *  check the header right now; this prevents allocating un-necessary
+     *  objects when we don't need them
+     */
+    error = ft_gzip_check_header( source );
+    if ( error )
+      goto Exit;
+
     FT_ZERO( stream );
     stream->memory = memory;
 
index 995cbb9..e9c3c4a 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/lzw Jamfile (C) 2004 David Turner
+# FreeType 2 src/lzw Jamfile
 #
+# Copyright 2004 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) lzw ;
 
index a0e4cc5..5d23cd2 100644 (file)
@@ -8,7 +8,7 @@
 /*  be used to parse compressed PCF fonts, as found with many X11 server   */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2004 by                                                      */
+/*  Copyright 2004, 2005 by                                                */
 /*  Albert Chin-A-Young.                                                   */
 /*                                                                         */
 /*  Based on code in src/gzip/ftgzip.c, Copyright 2004 by                  */
     FT_LZWFile  zip;
 
 
+    /*
+     *  Check the header right now; this prevents allocation a huge
+     *  LZWFile object (400 KByte of heap memory) if not necessary.
+     *
+     *  Did I mention that you should never use .Z compressed font
+     *  file?
+     */
+    error = ft_lzw_check_header( source );
+    if ( error )
+      goto Exit;
+
     FT_ZERO( stream );
     stream->memory = memory;
 
index 2b438c2..5a3c5bc 100644 (file)
@@ -35,7 +35,7 @@
 
 /*-
  *
- * Copyright (c) 2004
+ * Copyright (c) 2004, 2005
  *     Albert Chin-A-Young.
  *
  * Modified to work with FreeType's PCF driver.
@@ -250,7 +250,7 @@ zread(s_zstate_t *zs)
 
                /* Special case for KwKwK string. */
                if (code >= free_ent) {
-                       *stackp++ = finchar;
+                       *stackp++ = (unsigned char)finchar;
                        code = oldcode;
                }
 
@@ -259,7 +259,7 @@ zread(s_zstate_t *zs)
                        *stackp++ = tab_suffixof(code);
                        code = tab_prefixof(code);
                }
-               *stackp++ = finchar = tab_suffixof(code);
+               *stackp++ = (unsigned char)(finchar = tab_suffixof(code));
 
                /* And put them out in forward order.  */
 middle:
@@ -276,8 +276,8 @@ middle:
 
                /* Generate the new entry. */
                if ((code = free_ent) < maxmaxcode) {
-                       tab_prefixof(code) = (unsigned short) oldcode;
-                       tab_suffixof(code) = finchar;
+                       tab_prefixof(code) = (unsigned short)oldcode;
+                       tab_suffixof(code) = (unsigned char)finchar;
                        free_ent = code + 1;
                }
 
@@ -322,7 +322,7 @@ getcode(s_zstate_t *zs)
                }
                if ( zs->avail_in < (unsigned int)n_bits && in_count > (long)n_bits ) {
                        memcpy (buf, zs->next_in, zs->avail_in);
-                       buf_len = zs->avail_in;
+                       buf_len = (unsigned char)zs->avail_in;
                        zs->avail_in = 0;
                        return -1;
                }
diff --git a/reactos/lib/freetype/src/otvalid/Jamfile b/reactos/lib/freetype/src/otvalid/Jamfile
new file mode 100644 (file)
index 0000000..c608cb5
--- /dev/null
@@ -0,0 +1,29 @@
+# FreeType 2 src/otvalid Jamfile\r
+#\r
+# Copyright 2004 by\r
+# David Turner, Robert Wilhelm, and Werner Lemberg.\r
+#\r
+# This file is part of the FreeType project, and may only be used, modified,\r
+# and distributed under the terms of the FreeType project license,\r
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\r
+# indicate that you have read the license and understand and accept it\r
+# fully.\r
+\r
+SubDir  FT2_TOP $(FT2_SRC_DIR) otvalid ;\r
+\r
+{\r
+  local  _sources ;\r
+\r
+  if $(FT2_MULTI)\r
+  {\r
+    _sources = otvbase otvcommn otvgdef otvgpos otvgsub otvjstf otvmod ;\r
+  }\r
+  else\r
+  {\r
+    _sources = otvalid ;\r
+  }\r
+\r
+  Library  $(FT2_LIB) : $(_sources).c ;\r
+}\r
+\r
+# end of src/otvalid Jamfile\r
diff --git a/reactos/lib/freetype/src/otvalid/module.mk b/reactos/lib/freetype/src/otvalid/module.mk
new file mode 100644 (file)
index 0000000..2dc4f84
--- /dev/null
@@ -0,0 +1,22 @@
+#\r
+# FreeType 2 otvalid module definition\r
+#\r
+\r
+\r
+# Copyright 2004 by\r
+# David Turner, Robert Wilhelm, and Werner Lemberg.\r
+#\r
+# This file is part of the FreeType project, and may only be used, modified,\r
+# and distributed under the terms of the FreeType project license,\r
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\r
+# indicate that you have read the license and understand and accept it\r
+# fully.\r
+\r
+\r
+make_module_list: add_otvalid_module\r
+\r
+add_otvalid_module:\r
+       $(OPEN_DRIVER)otvalid_module_class$(CLOSE_DRIVER)\r
+       $(ECHO_DRIVER)otvalid     $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE)\r
+\r
+# EOF\r
diff --git a/reactos/lib/freetype/src/otvalid/otvalid.c b/reactos/lib/freetype/src/otvalid/otvalid.c
new file mode 100644 (file)
index 0000000..121142e
--- /dev/null
@@ -0,0 +1,30 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvalid.c                                                              */\r
+/*                                                                         */\r
+/*    FreeType validator for OpenType tables (body only).                  */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+#define FT_MAKE_OPTION_SINGLE_OBJECT\r
+\r
+#include <ft2build.h>\r
+\r
+#include "otvbase.c"\r
+#include "otvcommn.c"\r
+#include "otvgdef.c"\r
+#include "otvgpos.c"\r
+#include "otvgsub.c"\r
+#include "otvjstf.c"\r
+#include "otvmod.c"\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvalid.h b/reactos/lib/freetype/src/otvalid/otvalid.h
new file mode 100644 (file)
index 0000000..826ea09
--- /dev/null
@@ -0,0 +1,72 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvalid.h                                                              */\r
+/*                                                                         */\r
+/*    OpenType table validation (specification only).                      */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __OTVALID_H__\r
+#define __OTVALID_H__\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_FREETYPE_H\r
+\r
+#include "otverror.h"           /* must come before FT_INTERNAL_VALIDATE_H */\r
+\r
+#include FT_INTERNAL_VALIDATE_H\r
+#include FT_INTERNAL_STREAM_H\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  FT_LOCAL( void )\r
+  otv_BASE_validate( FT_Bytes      table,\r
+                     FT_Validator  valid );\r
+\r
+  /* GSUB and GPOS tables should already be validated; */\r
+  /* if missing, set corresponding argument to 0       */\r
+  FT_LOCAL( void )\r
+  otv_GDEF_validate( FT_Bytes      table,\r
+                     FT_Bytes      gsub,\r
+                     FT_Bytes      gpos,\r
+                     FT_Validator  valid );\r
+\r
+  FT_LOCAL( void )\r
+  otv_GPOS_validate( FT_Bytes      table,\r
+                     FT_UInt       glyph_count,\r
+                     FT_Validator  valid );\r
+\r
+  FT_LOCAL( void )\r
+  otv_GSUB_validate( FT_Bytes      table,\r
+                     FT_UInt       glyph_count,\r
+                     FT_Validator  valid );\r
+\r
+  /* GSUB and GPOS tables should already be validated; */\r
+  /* if missing, set corresponding argument to 0       */\r
+  FT_LOCAL( void )\r
+  otv_JSTF_validate( FT_Bytes      table,\r
+                     FT_Bytes      gsub,\r
+                     FT_Bytes      gpos,\r
+                     FT_UInt       glyph_count,\r
+                     FT_Validator  valid );\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __OTVALID_H__ */\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvbase.c b/reactos/lib/freetype/src/otvalid/otvbase.c
new file mode 100644 (file)
index 0000000..4f04b51
--- /dev/null
@@ -0,0 +1,318 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvbase.c                                                              */\r
+/*                                                                         */\r
+/*    OpenType BASE table validation (body).                               */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include "otvalid.h"\r
+#include "otvcommn.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_otvbase\r
+\r
+\r
+  static void\r
+  otv_BaseCoord_validate( FT_Bytes       table,\r
+                          OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   BaseCoordFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "BaseCoord" );\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    BaseCoordFormat = FT_NEXT_USHORT( p );\r
+    p += 2;     /* skip Coordinate */\r
+\r
+    OTV_TRACE(( " (format %d)\n", BaseCoordFormat ));\r
+\r
+    switch ( BaseCoordFormat )\r
+    {\r
+    case 1:     /* BaseCoordFormat1 */\r
+      break;\r
+\r
+    case 2:     /* BaseCoordFormat2 */\r
+      OTV_LIMIT_CHECK( 4 );   /* ReferenceGlyph, BaseCoordPoint */\r
+      break;\r
+\r
+    case 3:     /* BaseCoordFormat3 */\r
+      OTV_LIMIT_CHECK( 2 );\r
+      /* DeviceTable */\r
+      otv_Device_validate( table + FT_NEXT_USHORT( p ), valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static void\r
+  otv_BaseTagList_validate( FT_Bytes       table,\r
+                            OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   BaseTagCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "BaseTagList" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+\r
+    BaseTagCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (BaseTagCount = %d)\n", BaseTagCount ));\r
+\r
+    OTV_LIMIT_CHECK( BaseTagCount * 4 );          /* BaselineTag */\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static void\r
+  otv_BaseValues_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   BaseCoordCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "BaseValues" );\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+\r
+    p             += 2;                     /* skip DefaultIndex */\r
+    BaseCoordCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (BaseCoordCount = %d)\n", BaseCoordCount ));\r
+\r
+    OTV_LIMIT_CHECK( BaseCoordCount * 2 );\r
+\r
+    /* BaseCoord */\r
+    for ( ; BaseCoordCount > 0; BaseCoordCount-- )\r
+      otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static void\r
+  otv_MinMax_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   table_size;\r
+    FT_UInt   FeatMinMaxCount;\r
+\r
+    OTV_OPTIONAL_TABLE( MinCoord );\r
+    OTV_OPTIONAL_TABLE( MaxCoord );\r
+\r
+\r
+    OTV_NAME_ENTER( "MinMax" );\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+\r
+    OTV_OPTIONAL_OFFSET( MinCoord );\r
+    OTV_OPTIONAL_OFFSET( MaxCoord );\r
+    FeatMinMaxCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (FeatMinMaxCount = %d)\n", FeatMinMaxCount ));\r
+\r
+    table_size = FeatMinMaxCount * 8 + 6;\r
+\r
+    OTV_SIZE_CHECK( MinCoord );\r
+    if ( MinCoord )\r
+      otv_BaseCoord_validate( table + MinCoord, valid );\r
+\r
+    OTV_SIZE_CHECK( MaxCoord );\r
+    if ( MaxCoord )\r
+      otv_BaseCoord_validate( table + MaxCoord, valid );\r
+\r
+    OTV_LIMIT_CHECK( FeatMinMaxCount * 8 );\r
+\r
+    /* FeatMinMaxRecord */\r
+    for ( ; FeatMinMaxCount > 0; FeatMinMaxCount-- )\r
+    {\r
+      p += 4;                           /* skip FeatureTableTag */\r
+\r
+      OTV_OPTIONAL_OFFSET( MinCoord );\r
+      OTV_OPTIONAL_OFFSET( MaxCoord );\r
+\r
+      OTV_SIZE_CHECK( MinCoord );\r
+      if ( MinCoord )\r
+        otv_BaseCoord_validate( table + MinCoord, valid );\r
+\r
+      OTV_SIZE_CHECK( MaxCoord );\r
+      if ( MaxCoord )\r
+        otv_BaseCoord_validate( table + MaxCoord, valid );\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static void\r
+  otv_BaseScript_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   table_size;\r
+    FT_UInt   BaseLangSysCount;\r
+\r
+    OTV_OPTIONAL_TABLE( BaseValues    );\r
+    OTV_OPTIONAL_TABLE( DefaultMinMax );\r
+\r
+\r
+    OTV_NAME_ENTER( "BaseScript" );\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+    OTV_OPTIONAL_OFFSET( BaseValues    );\r
+    OTV_OPTIONAL_OFFSET( DefaultMinMax );\r
+    BaseLangSysCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (BaseLangSysCount = %d)\n", BaseLangSysCount ));\r
+\r
+    table_size = BaseLangSysCount * 6 + 6;\r
+\r
+    OTV_SIZE_CHECK( BaseValues );\r
+    if ( BaseValues )\r
+      otv_BaseValues_validate( table + BaseValues, valid );\r
+\r
+    OTV_SIZE_CHECK( DefaultMinMax );\r
+    if ( DefaultMinMax )\r
+      otv_MinMax_validate( table + DefaultMinMax, valid );\r
+\r
+    OTV_LIMIT_CHECK( BaseLangSysCount * 6 );\r
+\r
+    /* BaseLangSysRecord */\r
+    for ( ; BaseLangSysCount > 0; BaseLangSysCount-- )\r
+    {\r
+      p += 4;       /* skip BaseLangSysTag */\r
+\r
+      otv_MinMax_validate( table + FT_NEXT_USHORT( p ), valid );\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static void\r
+  otv_BaseScriptList_validate( FT_Bytes       table,\r
+                               OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   BaseScriptCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "BaseScriptList" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    BaseScriptCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (BaseScriptCount = %d)\n", BaseScriptCount ));\r
+\r
+    OTV_LIMIT_CHECK( BaseScriptCount * 6 );\r
+\r
+    /* BaseScriptRecord */\r
+    for ( ; BaseScriptCount > 0; BaseScriptCount-- )\r
+    {\r
+      p += 4;       /* skip BaseScriptTag */\r
+\r
+      /* BaseScript */\r
+      otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), valid );\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static void\r
+  otv_Axis_validate( FT_Bytes       table,\r
+                     OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   table_size;\r
+\r
+    OTV_OPTIONAL_TABLE( BaseTagList );\r
+\r
+\r
+    OTV_NAME_ENTER( "Axis" );\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    OTV_OPTIONAL_OFFSET( BaseTagList );\r
+\r
+    table_size = 4;\r
+\r
+    OTV_SIZE_CHECK( BaseTagList );\r
+    if ( BaseTagList )\r
+      otv_BaseTagList_validate( table + BaseTagList, valid );\r
+\r
+    /* BaseScriptList */\r
+    otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_BASE_validate( FT_Bytes      table,\r
+                     FT_Validator  ftvalid )\r
+  {\r
+    OTV_ValidatorRec  validrec;\r
+    OTV_Validator     valid = &validrec;\r
+    FT_Bytes          p     = table;\r
+    FT_UInt           table_size;\r
+\r
+    OTV_OPTIONAL_TABLE( HorizAxis );\r
+    OTV_OPTIONAL_TABLE( VertAxis  );\r
+\r
+\r
+    valid->root = ftvalid;\r
+\r
+    FT_TRACE3(( "validating BASE table\n" ));\r
+    OTV_INIT;\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+\r
+    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\r
+      FT_INVALID_DATA;\r
+\r
+    table_size = 6;\r
+\r
+    OTV_OPTIONAL_OFFSET( HorizAxis );\r
+    OTV_SIZE_CHECK( HorizAxis );\r
+    if ( HorizAxis )\r
+      otv_Axis_validate( table + HorizAxis, valid );\r
+\r
+    OTV_OPTIONAL_OFFSET( VertAxis );\r
+    OTV_SIZE_CHECK( VertAxis );\r
+    if ( VertAxis )\r
+      otv_Axis_validate( table + VertAxis, valid );\r
+\r
+    FT_TRACE4(( "\n" ));\r
+  }\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvcommn.c b/reactos/lib/freetype/src/otvalid/otvcommn.c
new file mode 100644 (file)
index 0000000..fdb5ff3
--- /dev/null
@@ -0,0 +1,1055 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvcommn.c                                                             */\r
+/*                                                                         */\r
+/*    OpenType common tables validation (body).                            */\r
+/*                                                                         */\r
+/*  Copyright 2004, 2005 by                                                */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include "otvcommn.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_otvcommon\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                       COVERAGE TABLE                          *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_Coverage_validate( FT_Bytes       table,\r
+                         OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   CoverageFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "Coverage" );\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    CoverageFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", CoverageFormat ));\r
+\r
+    switch ( CoverageFormat )\r
+    {\r
+    case 1:     /* CoverageFormat1 */\r
+      {\r
+        FT_UInt  GlyphCount;\r
+\r
+\r
+        GlyphCount = FT_NEXT_USHORT( p );\r
+\r
+        OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));\r
+\r
+        OTV_LIMIT_CHECK( GlyphCount * 2 );        /* GlyphArray */\r
+      }\r
+      break;\r
+\r
+    case 2:     /* CoverageFormat2 */\r
+      {\r
+        FT_UInt  n, RangeCount;\r
+        FT_UInt  Start, End, StartCoverageIndex, total = 0, last = 0;\r
+\r
+\r
+        RangeCount = FT_NEXT_USHORT( p );\r
+\r
+        OTV_TRACE(( " (RangeCount = %d)\n", RangeCount ));\r
+\r
+        OTV_LIMIT_CHECK( RangeCount * 6 );\r
+\r
+        /* RangeRecord */\r
+        for ( n = 0; n < RangeCount; n++ )\r
+        {\r
+          Start              = FT_NEXT_USHORT( p );\r
+          End                = FT_NEXT_USHORT( p );\r
+          StartCoverageIndex = FT_NEXT_USHORT( p );\r
+\r
+          if ( Start > End || StartCoverageIndex != total )\r
+            FT_INVALID_DATA;\r
+\r
+          if ( n > 0 && Start <= last )\r
+            FT_INVALID_DATA;\r
+\r
+          total += End - Start + 1;\r
+          last   = End;\r
+        }\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_FORMAT;\r
+    }\r
+\r
+    /* no need to check glyph indices used as input to coverage tables */\r
+    /* since even invalid glyph indices return a meaningful result     */\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( FT_UInt )\r
+  otv_Coverage_get_first( FT_Bytes  table )\r
+  {\r
+    FT_Bytes  p = table;\r
+\r
+\r
+    p += 4;     /* skip CoverageFormat and Glyph/RangeCount */\r
+\r
+    return FT_NEXT_USHORT( p );\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( FT_UInt )\r
+  otv_Coverage_get_last( FT_Bytes  table )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   CoverageFormat = FT_NEXT_USHORT( p );\r
+    FT_UInt   count          = FT_NEXT_USHORT( p );     /* Glyph/RangeCount */\r
+    FT_UInt   result = 0;\r
+\r
+\r
+    switch ( CoverageFormat )\r
+    {\r
+    case 1:\r
+      p += ( count - 1 ) * 2;\r
+      result = FT_NEXT_USHORT( p );\r
+      break;\r
+\r
+    case 2:\r
+      p += ( count - 1 ) * 6 + 2;\r
+      result = FT_NEXT_USHORT( p );\r
+      break;\r
+\r
+    default:\r
+      ;\r
+    }\r
+\r
+    return result;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( FT_UInt )\r
+  otv_Coverage_get_count( FT_Bytes  table )\r
+  {\r
+    FT_Bytes  p              = table;\r
+    FT_UInt   CoverageFormat = FT_NEXT_USHORT( p );\r
+    FT_UInt   count          = FT_NEXT_USHORT( p );     /* Glyph/RangeCount */\r
+    FT_UInt   result         = 0;\r
+\r
+\r
+    switch ( CoverageFormat )\r
+    {\r
+    case 1:\r
+      return count;\r
+\r
+    case 2:\r
+      {\r
+        FT_UInt  Start, End;\r
+\r
+\r
+        for ( ; count > 0; count-- )\r
+        {\r
+          Start = FT_NEXT_USHORT( p );\r
+          End   = FT_NEXT_USHORT( p );\r
+          p    += 2;                    /* skip StartCoverageIndex */\r
+\r
+          result += End - Start + 1;\r
+        }\r
+      }\r
+      break;\r
+\r
+    default:\r
+      ;\r
+    }\r
+\r
+    return result;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                   CLASS DEFINITION TABLE                      *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_ClassDef_validate( FT_Bytes       table,\r
+                         OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   ClassFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "ClassDef" );\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    ClassFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", ClassFormat ));\r
+\r
+    switch ( ClassFormat )\r
+    {\r
+    case 1:     /* ClassDefFormat1 */\r
+      {\r
+        FT_UInt  GlyphCount;\r
+\r
+\r
+        p += 2;         /* skip StartGlyph */\r
+\r
+        OTV_LIMIT_CHECK( 2 );\r
+\r
+        OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));\r
+\r
+        GlyphCount = FT_NEXT_USHORT( p );\r
+\r
+        OTV_LIMIT_CHECK( GlyphCount * 2 );    /* ClassValueArray */\r
+      }\r
+      break;\r
+\r
+    case 2:     /* ClassDefFormat2 */\r
+      {\r
+        FT_UInt  n, ClassRangeCount;\r
+        FT_UInt  Start, End, last = 0;\r
+\r
+\r
+        ClassRangeCount = FT_NEXT_USHORT( p );\r
+\r
+        OTV_TRACE(( " (ClassRangeCount = %d)\n", ClassRangeCount ));\r
+\r
+        OTV_LIMIT_CHECK( ClassRangeCount * 6 );\r
+\r
+        /* ClassRangeRecord */\r
+        for ( n = 0; n < ClassRangeCount; n++ )\r
+        {\r
+          Start = FT_NEXT_USHORT( p );\r
+          End   = FT_NEXT_USHORT( p );\r
+          p    += 2;                        /* skip Class */\r
+\r
+          if ( Start > End || ( n > 0 && Start <= last ) )\r
+            FT_INVALID_DATA;\r
+\r
+          last = End;\r
+        }\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_FORMAT;\r
+    }\r
+\r
+    /* no need to check glyph indices used as input to class definition   */\r
+    /* tables since even invalid glyph indices return a meaningful result */\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                      DEVICE TABLE                             *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_Device_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   StartSize, EndSize, DeltaFormat, count;\r
+\r
+\r
+    OTV_NAME_ENTER( "Device" );\r
+\r
+    OTV_LIMIT_CHECK( 8 );\r
+    StartSize   = FT_NEXT_USHORT( p );\r
+    EndSize     = FT_NEXT_USHORT( p );\r
+    DeltaFormat = FT_NEXT_USHORT( p );\r
+\r
+    if ( DeltaFormat < 1 || DeltaFormat > 3 || EndSize < StartSize )\r
+      FT_INVALID_DATA;\r
+\r
+    count = EndSize - StartSize + 1;\r
+    OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 );  /* DeltaValue */\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                         LOOKUPS                               *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* uses valid->type_count */\r
+  /* uses valid->type_funcs */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_Lookup_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid )\r
+  {\r
+    FT_Bytes           p = table;\r
+    FT_UInt            LookupType, SubTableCount;\r
+    OTV_Validate_Func  validate;\r
+\r
+\r
+    OTV_NAME_ENTER( "Lookup" );\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+    LookupType    = FT_NEXT_USHORT( p );\r
+    p            += 2;                      /* skip LookupFlag */\r
+    SubTableCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (type %d)\n", LookupType ));\r
+\r
+    if ( LookupType == 0 || LookupType >= valid->type_count )\r
+      FT_INVALID_DATA;\r
+\r
+    validate = valid->type_funcs[LookupType - 1];\r
+\r
+    OTV_TRACE(( " (SubTableCount = %d)\n", SubTableCount ));\r
+\r
+    OTV_LIMIT_CHECK( SubTableCount * 2 );\r
+\r
+    /* SubTable */\r
+    for ( ; SubTableCount > 0; SubTableCount-- )\r
+      validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* uses valid->lookup_count */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_LookupList_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   LookupCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "LookupList" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    LookupCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (LookupCount = %d)\n", LookupCount ));\r
+\r
+    OTV_LIMIT_CHECK( LookupCount * 2 );\r
+\r
+    valid->lookup_count = LookupCount;\r
+\r
+    /* Lookup */\r
+    for ( ; LookupCount > 0; LookupCount-- )\r
+      otv_Lookup_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static FT_UInt\r
+  otv_LookupList_get_count( FT_Bytes  table )\r
+  {\r
+    return FT_NEXT_USHORT( table );\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                        FEATURES                               *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* uses valid->lookup_count */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_Feature_validate( FT_Bytes       table,\r
+                        OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   LookupCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "Feature" );\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    p           += 2;                   /* skip FeatureParams (unused) */\r
+    LookupCount  = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (LookupCount = %d)\n", LookupCount ));\r
+\r
+    OTV_LIMIT_CHECK( LookupCount * 2 );\r
+\r
+    /* LookupListIndex */\r
+    for ( ; LookupCount > 0; LookupCount-- )\r
+      if ( FT_NEXT_USHORT( p ) >= valid->lookup_count )\r
+        FT_INVALID_DATA;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static FT_UInt\r
+  otv_Feature_get_count( FT_Bytes  table )\r
+  {\r
+    return FT_NEXT_USHORT( table );\r
+  }\r
+\r
+\r
+  /* sets valid->lookup_count */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_FeatureList_validate( FT_Bytes       table,\r
+                            FT_Bytes       lookups,\r
+                            OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   FeatureCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "FeatureList" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    FeatureCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount ));\r
+\r
+    OTV_LIMIT_CHECK( FeatureCount * 2 );\r
+\r
+    valid->lookup_count = otv_LookupList_get_count( lookups );\r
+\r
+    /* FeatureRecord */\r
+    for ( ; FeatureCount > 0; FeatureCount-- )\r
+    {\r
+      p += 4;       /* skip FeatureTag */\r
+\r
+      /* Feature */\r
+      otv_Feature_validate( table + FT_NEXT_USHORT( p ), valid );\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                       LANGUAGE SYSTEM                         *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+\r
+  /* uses valid->extra1 (number of features) */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_LangSys_validate( FT_Bytes       table,\r
+                        OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   ReqFeatureIndex;\r
+    FT_UInt   FeatureCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "LangSys" );\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+    p              += 2;                    /* skip LookupOrder (unused) */\r
+    ReqFeatureIndex = FT_NEXT_USHORT( p );\r
+    FeatureCount    = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (ReqFeatureIndex = %d)\n", ReqFeatureIndex ));\r
+    OTV_TRACE(( " (FeatureCount = %d)\n",    FeatureCount    ));\r
+\r
+    if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= valid->extra1 )\r
+      FT_INVALID_DATA;\r
+\r
+    OTV_LIMIT_CHECK( FeatureCount * 2 );\r
+\r
+    /* FeatureIndex */\r
+    for ( ; FeatureCount > 0; FeatureCount-- )\r
+      if ( FT_NEXT_USHORT( p ) >= valid->extra1 )\r
+        FT_INVALID_DATA;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                           SCRIPTS                             *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_Script_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid )\r
+  {\r
+    FT_UInt   DefaultLangSys, LangSysCount;\r
+    FT_Bytes  p = table;\r
+\r
+\r
+    OTV_NAME_ENTER( "Script" );\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    DefaultLangSys = FT_NEXT_USHORT( p );\r
+    LangSysCount   = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (LangSysCount = %d)\n", LangSysCount ));\r
+\r
+    if ( DefaultLangSys != 0 )\r
+      otv_LangSys_validate( table + DefaultLangSys, valid );\r
+\r
+    OTV_LIMIT_CHECK( LangSysCount * 6 );\r
+\r
+    /* LangSysRecord */\r
+    for ( ; LangSysCount > 0; LangSysCount-- )\r
+    {\r
+      p += 4;       /* skip LangSysTag */\r
+\r
+      /* LangSys */\r
+      otv_LangSys_validate( table + FT_NEXT_USHORT( p ), valid );\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* sets valid->extra1 (number of features) */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_ScriptList_validate( FT_Bytes       table,\r
+                           FT_Bytes       features,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_UInt   ScriptCount;\r
+    FT_Bytes  p = table;\r
+\r
+\r
+    OTV_NAME_ENTER( "ScriptList" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    ScriptCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (ScriptCount = %d)\n", ScriptCount ));\r
+\r
+    OTV_LIMIT_CHECK( ScriptCount * 6 );\r
+\r
+    valid->extra1 = otv_Feature_get_count( features );\r
+\r
+    /* ScriptRecord */\r
+    for ( ; ScriptCount > 0; ScriptCount-- )\r
+    {\r
+      p += 4;       /* skip ScriptTag */\r
+\r
+      otv_Script_validate( table + FT_NEXT_USHORT( p ), valid ); /* Script */\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                      UTILITY FUNCTIONS                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*\r
+     u:   uint16\r
+     ux:  unit16 [x]\r
+\r
+     s:   struct\r
+     sx:  struct [x]\r
+     sxy: struct [x], using external y count\r
+\r
+     x:   uint16 x\r
+\r
+     C:   Coverage\r
+\r
+     O:   Offset\r
+     On:  Offset (NULL)\r
+     Ox:  Offset [x]\r
+     Onx: Offset (NULL) [x]\r
+  */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_x_Ox( FT_Bytes       table,\r
+            OTV_Validator  valid )\r
+  {\r
+    FT_Bytes           p = table;\r
+    FT_UInt            Count;\r
+    OTV_Validate_Func  func;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    Count = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (Count = %d)\n", Count ));\r
+\r
+    OTV_LIMIT_CHECK( Count * 2 );\r
+\r
+    valid->nesting_level++;\r
+    func = valid->func[valid->nesting_level];\r
+\r
+    for ( ; Count > 0; Count-- )\r
+      func( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    valid->nesting_level--;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_u_C_x_Ox( FT_Bytes       table,\r
+                OTV_Validator  valid )\r
+  {\r
+    FT_Bytes           p = table;\r
+    FT_UInt            Count, Coverage;\r
+    OTV_Validate_Func  func;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    p += 2;     /* skip Format */\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    Coverage = FT_NEXT_USHORT( p );\r
+    Count    = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (Count = %d)\n", Count ));\r
+\r
+    otv_Coverage_validate( table + Coverage, valid );\r
+\r
+    OTV_LIMIT_CHECK( Count * 2 );\r
+\r
+    valid->nesting_level++;\r
+    func = valid->func[valid->nesting_level];\r
+\r
+    for ( ; Count > 0; Count-- )\r
+      func( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    valid->nesting_level--;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* uses valid->extra1 (if > 0: array value limit) */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_x_ux( FT_Bytes       table,\r
+            OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   Count;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    Count = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (Count = %d)\n", Count ));\r
+\r
+    OTV_LIMIT_CHECK( Count * 2 );\r
+\r
+    if ( valid->extra1 )\r
+    {\r
+      for ( ; Count > 0; Count-- )\r
+        if ( FT_NEXT_USHORT( p ) >= valid->extra1 )\r
+          FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* `ux' in the function's name is not really correct since only x-1 */\r
+  /* elements are tested                                              */\r
+\r
+  /* uses valid->extra1 (array value limit) */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_x_y_ux_sy( FT_Bytes       table,\r
+                 OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   Count1, Count2;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    Count1 = FT_NEXT_USHORT( p );\r
+    Count2 = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (Count1 = %d)\n", Count1 ));\r
+    OTV_TRACE(( " (Count2 = %d)\n", Count2 ));\r
+\r
+    if ( Count1 == 0 )\r
+      FT_INVALID_DATA;\r
+\r
+    OTV_LIMIT_CHECK( ( Count1 - 1 ) * 2 + Count2 * 4 );\r
+\r
+    for ( ; Count2 > 0; Count2-- )\r
+    {\r
+      if ( FT_NEXT_USHORT( p ) >= Count1 )\r
+        FT_INVALID_DATA;\r
+\r
+      if ( FT_NEXT_USHORT( p ) >= valid->extra1 )\r
+        FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* `uy' in the function's name is not really correct since only y-1 */\r
+  /* elements are tested                                              */\r
+\r
+  /* uses valid->extra1 (array value limit) */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   BacktrackCount, InputCount, LookaheadCount;\r
+    FT_UInt   Count;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    BacktrackCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (BacktrackCount = %d)\n", BacktrackCount ));\r
+\r
+    OTV_LIMIT_CHECK( BacktrackCount * 2 + 2 );\r
+    p += BacktrackCount * 2;\r
+\r
+    InputCount = FT_NEXT_USHORT( p );\r
+    if ( InputCount == 0 )\r
+      FT_INVALID_DATA;\r
+\r
+    OTV_TRACE(( " (InputCount = %d)\n", InputCount ));\r
+\r
+    OTV_LIMIT_CHECK( InputCount * 2 );\r
+    p += ( InputCount - 1 ) * 2;\r
+\r
+    LookaheadCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (LookaheadCount = %d)\n", LookaheadCount ));\r
+\r
+    OTV_LIMIT_CHECK( LookaheadCount * 2 + 2 );\r
+    p += LookaheadCount * 2;\r
+\r
+    Count = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (Count = %d)\n", Count ));\r
+\r
+    OTV_LIMIT_CHECK( Count * 4 );\r
+\r
+    for ( ; Count > 0; Count-- )\r
+    {\r
+      if ( FT_NEXT_USHORT( p ) >= InputCount )\r
+        FT_INVALID_DATA;\r
+\r
+      if ( FT_NEXT_USHORT( p ) >= valid->extra1 )\r
+        FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* sets valid->extra1 (valid->lookup_count) */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_u_O_O_x_Onx( FT_Bytes       table,\r
+                   OTV_Validator  valid )\r
+  {\r
+    FT_Bytes           p = table;\r
+    FT_UInt            Coverage, ClassDef, ClassSetCount;\r
+    OTV_Validate_Func  func;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    p += 2;     /* skip Format */\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+    Coverage      = FT_NEXT_USHORT( p );\r
+    ClassDef      = FT_NEXT_USHORT( p );\r
+    ClassSetCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (ClassSetCount = %d)\n", ClassSetCount ));\r
+\r
+    otv_Coverage_validate( table + Coverage, valid );\r
+    otv_ClassDef_validate( table + ClassDef, valid );\r
+\r
+    OTV_LIMIT_CHECK( ClassSetCount * 2 );\r
+\r
+    valid->nesting_level++;\r
+    func          = valid->func[valid->nesting_level];\r
+    valid->extra1 = valid->lookup_count;\r
+\r
+    for ( ; ClassSetCount > 0; ClassSetCount-- )\r
+    {\r
+      FT_UInt  offset = FT_NEXT_USHORT( p );\r
+\r
+\r
+      if ( offset )\r
+        func( table + offset, valid );\r
+    }\r
+\r
+    valid->nesting_level--;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* uses valid->lookup_count */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_u_x_y_Ox_sy( FT_Bytes       table,\r
+                   OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   GlyphCount, Count, count1;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    p += 2;     /* skip Format */\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    GlyphCount = FT_NEXT_USHORT( p );\r
+    Count      = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));\r
+    OTV_TRACE(( " (Count = %d)\n",      Count      ));\r
+\r
+    OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 );\r
+\r
+    for ( count1 = GlyphCount; count1 > 0; count1-- )\r
+      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    for ( ; Count > 0; Count-- )\r
+    {\r
+      if ( FT_NEXT_USHORT( p ) >= GlyphCount )\r
+        FT_INVALID_DATA;\r
+\r
+      if ( FT_NEXT_USHORT( p ) >= valid->lookup_count )\r
+        FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* sets valid->extra1 (valid->lookup_count)    */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_u_O_O_O_O_x_Onx( FT_Bytes       table,\r
+                       OTV_Validator  valid )\r
+  {\r
+    FT_Bytes           p = table;\r
+    FT_UInt            Coverage;\r
+    FT_UInt            BacktrackClassDef, InputClassDef, LookaheadClassDef;\r
+    FT_UInt            ChainClassSetCount;\r
+    OTV_Validate_Func  func;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    p += 2;     /* skip Format */\r
+\r
+    OTV_LIMIT_CHECK( 10 );\r
+    Coverage           = FT_NEXT_USHORT( p );\r
+    BacktrackClassDef  = FT_NEXT_USHORT( p );\r
+    InputClassDef      = FT_NEXT_USHORT( p );\r
+    LookaheadClassDef  = FT_NEXT_USHORT( p );\r
+    ChainClassSetCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (ChainClassSetCount = %d)\n", ChainClassSetCount ));\r
+\r
+    otv_Coverage_validate( table + Coverage, valid );\r
+\r
+    otv_ClassDef_validate( table + BacktrackClassDef,  valid );\r
+    otv_ClassDef_validate( table + InputClassDef, valid );\r
+    otv_ClassDef_validate( table + LookaheadClassDef, valid );\r
+\r
+    OTV_LIMIT_CHECK( ChainClassSetCount * 2 );\r
+\r
+    valid->nesting_level++;\r
+    func          = valid->func[valid->nesting_level];\r
+    valid->extra1 = valid->lookup_count;\r
+\r
+    for ( ; ChainClassSetCount > 0; ChainClassSetCount-- )\r
+    {\r
+      FT_UInt  offset = FT_NEXT_USHORT( p );\r
+\r
+\r
+      if ( offset )\r
+        func( table + offset, valid );\r
+    }\r
+\r
+    valid->nesting_level--;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* uses valid->lookup_count */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes       table,\r
+                             OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   BacktrackGlyphCount, InputGlyphCount, LookaheadGlyphCount;\r
+    FT_UInt   count1, count2;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    p += 2;     /* skip Format */\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    BacktrackGlyphCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount ));\r
+\r
+    OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 );\r
+\r
+    for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- )\r
+      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    InputGlyphCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (InputGlyphCount = %d)\n", InputGlyphCount ));\r
+\r
+    OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 );\r
+\r
+    for ( count1 = InputGlyphCount; count1 > 0; count1-- )\r
+      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    LookaheadGlyphCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount ));\r
+\r
+    OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 );\r
+\r
+    for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- )\r
+      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    count2 = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (Count = %d)\n", count2 ));\r
+\r
+    OTV_LIMIT_CHECK( count2 * 4 );\r
+\r
+    for ( ; count2 > 0; count2-- )\r
+    {\r
+      if ( FT_NEXT_USHORT( p ) >= InputGlyphCount )\r
+        FT_INVALID_DATA;\r
+\r
+      if ( FT_NEXT_USHORT( p ) >= valid->lookup_count )\r
+        FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( FT_UInt )\r
+  otv_GSUBGPOS_get_Lookup_count( FT_Bytes  table )\r
+  {\r
+    FT_Bytes  p = table + 8;\r
+\r
+\r
+    return otv_LookupList_get_count( table + FT_NEXT_USHORT( p ) );\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( FT_UInt )\r
+  otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes  table )\r
+  {\r
+    FT_Bytes  p, lookup;\r
+    FT_UInt   count;\r
+\r
+\r
+    if ( !table )\r
+      return 0;\r
+\r
+    /* LookupList */\r
+    p      = table + 8;\r
+    table += FT_NEXT_USHORT( p );\r
+\r
+    /* LookupCount */\r
+    p     = table;\r
+    count = FT_NEXT_USHORT( p );\r
+\r
+    for ( ; count > 0; count-- )\r
+    {\r
+      FT_Bytes  oldp;\r
+\r
+\r
+      /* Lookup */\r
+      lookup = table + FT_NEXT_USHORT( p );\r
+\r
+      oldp = p;\r
+\r
+      /* LookupFlag */\r
+      p = lookup + 2;\r
+      if ( FT_NEXT_USHORT( p ) & 0xFF00U )\r
+        return 1;\r
+\r
+      p = oldp;\r
+    }\r
+\r
+    return 0;\r
+  }\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvcommn.h b/reactos/lib/freetype/src/otvalid/otvcommn.h
new file mode 100644 (file)
index 0000000..3efcb4a
--- /dev/null
@@ -0,0 +1,442 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvcommn.h                                                             */\r
+/*                                                                         */\r
+/*    OpenType common tables validation (specification).                   */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __OTVCOMMN_H__\r
+#define __OTVCOMMN_H__\r
+\r
+\r
+#include <ft2build.h>\r
+#include "otvalid.h"\r
+#include FT_INTERNAL_DEBUG_H\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                         VALIDATION                            *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  typedef struct OTV_ValidatorRec_*  OTV_Validator;\r
+\r
+  typedef void  (*OTV_Validate_Func)( FT_Bytes       table,\r
+                                      OTV_Validator  valid );\r
+\r
+  typedef struct  OTV_ValidatorRec_\r
+  {\r
+    FT_Validator        root;\r
+    FT_UInt             type_count;\r
+    OTV_Validate_Func*  type_funcs;\r
+\r
+    FT_UInt             lookup_count;\r
+    FT_UInt             glyph_count;\r
+\r
+    FT_UInt             nesting_level;\r
+\r
+    OTV_Validate_Func   func[3];\r
+\r
+    FT_UInt             extra1;     /* for passing parameters */\r
+    FT_UInt             extra2;\r
+    FT_Bytes            extra3;\r
+\r
+#ifdef FT_DEBUG_LEVEL_TRACE\r
+    FT_UInt             debug_indent;\r
+    const FT_String*    debug_function_name[3];\r
+#endif\r
+\r
+  } OTV_ValidatorRec;\r
+\r
+\r
+#undef  FT_INVALID_\r
+#define FT_INVALID_( _prefix, _error )                         \\r
+          ft_validator_error( valid->root, _prefix ## _error )\r
+\r
+#define OTV_OPTIONAL_TABLE( _table )  FT_UInt   _table;      \\r
+                                      FT_Bytes  _table ## _p\r
+\r
+#define OTV_OPTIONAL_OFFSET( _offset )           \\r
+          FT_BEGIN_STMNT                         \\r
+            _offset ## _p = p;                   \\r
+            _offset       = FT_NEXT_USHORT( p ); \\r
+          FT_END_STMNT\r
+\r
+#define OTV_LIMIT_CHECK( _count )                    \\r
+          FT_BEGIN_STMNT                             \\r
+            if ( p + (_count) > valid->root->limit ) \\r
+              FT_INVALID_TOO_SHORT;                  \\r
+          FT_END_STMNT\r
+\r
+#define OTV_SIZE_CHECK( _size )                                        \\r
+          FT_BEGIN_STMNT                                               \\r
+            if ( _size > 0 && _size < table_size )                     \\r
+            {                                                          \\r
+              if ( valid->root->level == FT_VALIDATE_PARANOID )        \\r
+                FT_INVALID_OFFSET;                                     \\r
+              else                                                     \\r
+              {                                                        \\r
+                /* strip off `const' */                                \\r
+                FT_Byte*  pp = (FT_Byte*)_size ## _p;                  \\r
+                                                                       \\r
+                                                                       \\r
+                FT_TRACE3(( "\n"                                       \\r
+                            "Invalid offset to optional table `%s'!\n" \\r
+                            "Set to zero.\n"                           \\r
+                            "\n", #_size ));                           \\r
+                                                                       \\r
+                /* always assume 16bit entities */                     \\r
+                _size = pp[0] = pp[1] = 0;                             \\r
+              }                                                        \\r
+            }                                                          \\r
+          FT_END_STMNT\r
+\r
+\r
+#ifdef FT_DEBUG_LEVEL_TRACE\r
+\r
+  /* use preprocessor's argument prescan to expand one argument into two */\r
+#define OTV_NEST1( x )  OTV_NEST1_( x )\r
+#define OTV_NEST1_( func0, name0 )                 \\r
+          FT_BEGIN_STMNT                           \\r
+            valid->nesting_level          = 0;     \\r
+            valid->func[0]                = func0; \\r
+            valid->debug_function_name[0] = name0; \\r
+          FT_END_STMNT\r
+\r
+  /* use preprocessor's argument prescan to expand two arguments into four */\r
+#define OTV_NEST2( x, y )  OTV_NEST2_( x, y )\r
+#define OTV_NEST2_( func0, name0, func1, name1 )   \\r
+          FT_BEGIN_STMNT                           \\r
+            valid->nesting_level          = 0;     \\r
+            valid->func[0]                = func0; \\r
+            valid->func[1]                = func1; \\r
+            valid->debug_function_name[0] = name0; \\r
+            valid->debug_function_name[1] = name1; \\r
+          FT_END_STMNT\r
+\r
+  /* use preprocessor's argument prescan to expand three arguments into six */\r
+#define OTV_NEST3( x, y, z )  OTV_NEST3_( x, y, z )\r
+#define OTV_NEST3_( func0, name0, func1, name1, func2, name2 ) \\r
+          FT_BEGIN_STMNT                                       \\r
+            valid->nesting_level          = 0;                 \\r
+            valid->func[0]                = func0;             \\r
+            valid->func[1]                = func1;             \\r
+            valid->func[2]                = func2;             \\r
+            valid->debug_function_name[0] = name0;             \\r
+            valid->debug_function_name[1] = name1;             \\r
+            valid->debug_function_name[2] = name2;             \\r
+          FT_END_STMNT\r
+\r
+#define OTV_INIT  valid->debug_indent = 0\r
+\r
+#define OTV_ENTER                                                            \\r
+          FT_BEGIN_STMNT                                                     \\r
+            valid->debug_indent += 2;                                        \\r
+            FT_TRACE4(( "%*.s", valid->debug_indent, 0 ));                   \\r
+            FT_TRACE4(( "%s table\n",                                        \\r
+                        valid->debug_function_name[valid->nesting_level] )); \\r
+          FT_END_STMNT\r
+\r
+#define OTV_NAME_ENTER( name )                             \\r
+          FT_BEGIN_STMNT                                   \\r
+            valid->debug_indent += 2;                      \\r
+            FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \\r
+            FT_TRACE4(( "%s table\n", name ));             \\r
+          FT_END_STMNT\r
+\r
+#define OTV_EXIT  valid->debug_indent -= 2\r
+\r
+#define OTV_TRACE( s )                                     \\r
+          FT_BEGIN_STMNT                                   \\r
+            FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \\r
+            FT_TRACE4( s );                                \\r
+          FT_END_STMNT\r
+\r
+#else   /* !FT_DEBUG_LEVEL_TRACE */\r
+\r
+  /* use preprocessor's argument prescan to expand one argument into two */\r
+#define OTV_NEST1( x )  OTV_NEST1_( x )\r
+#define OTV_NEST1_( func0, name0 )        \\r
+          FT_BEGIN_STMNT                  \\r
+            valid->nesting_level = 0;     \\r
+            valid->func[0]       = func0; \\r
+          FT_END_STMNT\r
+\r
+  /* use preprocessor's argument prescan to expand two arguments into four */\r
+#define OTV_NEST2( x, y )  OTV_NEST2_( x, y )\r
+#define OTV_NEST2_( func0, name0, func1, name1 ) \\r
+          FT_BEGIN_STMNT                         \\r
+            valid->nesting_level = 0;            \\r
+            valid->func[0]       = func0;        \\r
+            valid->func[1]       = func1;        \\r
+          FT_END_STMNT\r
+\r
+  /* use preprocessor's argument prescan to expand three arguments into six */\r
+#define OTV_NEST3( x, y, z )  OTV_NEST3_( x, y, z )\r
+#define OTV_NEST3_( func0, name0, func1, name1, func2, name2 ) \\r
+          FT_BEGIN_STMNT                                       \\r
+            valid->nesting_level = 0;                          \\r
+            valid->func[0]       = func0;                      \\r
+            valid->func[1]       = func1;                      \\r
+            valid->func[2]       = func2;                      \\r
+          FT_END_STMNT\r
+\r
+#define OTV_INIT                do ; while ( 0 )\r
+#define OTV_ENTER               do ; while ( 0 )\r
+#define OTV_NAME_ENTER( name )  do ; while ( 0 )\r
+#define OTV_EXIT                do ; while ( 0 )\r
+\r
+#define OTV_TRACE( s )          do ; while ( 0 )\r
+\r
+#endif  /* !FT_DEBUG_LEVEL_TRACE */\r
+\r
+\r
+#define OTV_RUN  valid->func[0]\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                       COVERAGE TABLE                          *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL( void )\r
+  otv_Coverage_validate( FT_Bytes       table,\r
+                         OTV_Validator  valid );\r
+\r
+  /* return first covered glyph */\r
+  FT_LOCAL( FT_UInt )\r
+  otv_Coverage_get_first( FT_Bytes  table );\r
+\r
+  /* return last covered glyph */\r
+  FT_LOCAL( FT_UInt )\r
+  otv_Coverage_get_last( FT_Bytes  table );\r
+\r
+  /* return number of covered glyphs */\r
+  FT_LOCAL( FT_UInt )\r
+  otv_Coverage_get_count( FT_Bytes  table );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                  CLASS DEFINITION TABLE                       *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL( void )\r
+  otv_ClassDef_validate( FT_Bytes       table,\r
+                         OTV_Validator  valid );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                      DEVICE TABLE                             *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL( void )\r
+  otv_Device_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                           LOOKUPS                             *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL( void )\r
+  otv_Lookup_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid );\r
+\r
+  FT_LOCAL( void )\r
+  otv_LookupList_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                        FEATURES                               *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL( void )\r
+  otv_Feature_validate( FT_Bytes       table,\r
+                        OTV_Validator  valid );\r
+\r
+  /* lookups must already be validated */\r
+  FT_LOCAL( void )\r
+  otv_FeatureList_validate( FT_Bytes       table,\r
+                            FT_Bytes       lookups,\r
+                            OTV_Validator  valid );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                       LANGUAGE SYSTEM                         *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL( void )\r
+  otv_LangSys_validate( FT_Bytes       table,\r
+                        OTV_Validator  valid );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                           SCRIPTS                             *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL( void )\r
+  otv_Script_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid );\r
+\r
+  /* features must already be validated */\r
+  FT_LOCAL( void )\r
+  otv_ScriptList_validate( FT_Bytes       table,\r
+                           FT_Bytes       features,\r
+                           OTV_Validator  valid );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                      UTILITY FUNCTIONS                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+#define ChainPosClassSet  otv_x_Ox, "ChainPosClassSet"\r
+#define ChainPosRuleSet   otv_x_Ox, "ChainPosRuleSet"\r
+#define ChainSubClassSet  otv_x_Ox, "ChainSubClassSet"\r
+#define ChainSubRuleSet   otv_x_Ox, "ChainSubRuleSet"\r
+#define JstfLangSys       otv_x_Ox, "JstfLangSys"\r
+#define JstfMax           otv_x_Ox, "JstfMax"\r
+#define LigGlyph          otv_x_Ox, "LigGlyph"\r
+#define LigatureArray     otv_x_Ox, "LigatureArray"\r
+#define LigatureSet       otv_x_Ox, "LigatureSet"\r
+#define PosClassSet       otv_x_Ox, "PosClassSet"\r
+#define PosRuleSet        otv_x_Ox, "PosRuleSet"\r
+#define SubClassSet       otv_x_Ox, "SubClassSet"\r
+#define SubRuleSet        otv_x_Ox, "SubRuleSet"\r
+\r
+  FT_LOCAL( void )\r
+  otv_x_Ox ( FT_Bytes       table,\r
+             OTV_Validator  valid );\r
+\r
+#define AlternateSubstFormat1     otv_u_C_x_Ox, "AlternateSubstFormat1"\r
+#define ChainContextPosFormat1    otv_u_C_x_Ox, "ChainContextPosFormat1"\r
+#define ChainContextSubstFormat1  otv_u_C_x_Ox, "ChainContextSubstFormat1"\r
+#define ContextPosFormat1         otv_u_C_x_Ox, "ContextPosFormat1"\r
+#define ContextSubstFormat1       otv_u_C_x_Ox, "ContextSubstFormat1"\r
+#define LigatureSubstFormat1      otv_u_C_x_Ox, "LigatureSubstFormat1"\r
+#define MultipleSubstFormat1      otv_u_C_x_Ox, "MultipleSubstFormat1"\r
+\r
+  FT_LOCAL( void )\r
+  otv_u_C_x_Ox( FT_Bytes       table,\r
+                OTV_Validator  valid );\r
+\r
+#define AlternateSet     otv_x_ux, "AlternateSet"\r
+#define AttachPoint      otv_x_ux, "AttachPoint"\r
+#define ExtenderGlyph    otv_x_ux, "ExtenderGlyph"\r
+#define JstfGPOSModList  otv_x_ux, "JstfGPOSModList"\r
+#define JstfGSUBModList  otv_x_ux, "JstfGSUBModList"\r
+#define Sequence         otv_x_ux, "Sequence"\r
+\r
+  FT_LOCAL( void )\r
+  otv_x_ux( FT_Bytes       table,\r
+            OTV_Validator  valid );\r
+\r
+#define PosClassRule  otv_x_y_ux_sy, "PosClassRule"\r
+#define PosRule       otv_x_y_ux_sy, "PosRule"\r
+#define SubClassRule  otv_x_y_ux_sy, "SubClassRule"\r
+#define SubRule       otv_x_y_ux_sy, "SubRule"\r
+\r
+  FT_LOCAL( void )\r
+  otv_x_y_ux_sy( FT_Bytes       table,\r
+                 OTV_Validator  valid );\r
+\r
+#define ChainPosClassRule  otv_x_ux_y_uy_z_uz_p_sp, "ChainPosClassRule"\r
+#define ChainPosRule       otv_x_ux_y_uy_z_uz_p_sp, "ChainPosRule"\r
+#define ChainSubClassRule  otv_x_ux_y_uy_z_uz_p_sp, "ChainSubClassRule"\r
+#define ChainSubRule       otv_x_ux_y_uy_z_uz_p_sp, "ChainSubRule"\r
+\r
+  FT_LOCAL( void )\r
+  otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes       table,\r
+                           OTV_Validator  valid );\r
+\r
+#define ContextPosFormat2    otv_u_O_O_x_Onx, "ContextPosFormat2"\r
+#define ContextSubstFormat2  otv_u_O_O_x_Onx, "ContextSubstFormat2"\r
+\r
+  FT_LOCAL( void )\r
+  otv_u_O_O_x_Onx( FT_Bytes       table,\r
+                   OTV_Validator  valid );\r
+\r
+#define ContextPosFormat3    otv_u_x_y_Ox_sy, "ContextPosFormat3"\r
+#define ContextSubstFormat3  otv_u_x_y_Ox_sy, "ContextSubstFormat3"\r
+\r
+  FT_LOCAL( void )\r
+  otv_u_x_y_Ox_sy( FT_Bytes       table,\r
+                   OTV_Validator  valid );\r
+\r
+#define ChainContextPosFormat2    otv_u_O_O_O_O_x_Onx, "ChainContextPosFormat2"\r
+#define ChainContextSubstFormat2  otv_u_O_O_O_O_x_Onx, "ChainContextSubstFormat2"\r
+\r
+  FT_LOCAL( void )\r
+  otv_u_O_O_O_O_x_Onx( FT_Bytes       table,\r
+                       OTV_Validator  valid );\r
+\r
+#define ChainContextPosFormat3    otv_u_x_Ox_y_Oy_z_Oz_p_sp, "ChainContextPosFormat3"\r
+#define ChainContextSubstFormat3  otv_u_x_Ox_y_Oy_z_Oz_p_sp, "ChainContextSubstFormat3"\r
+\r
+  FT_LOCAL( void )\r
+  otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes       table,\r
+                             OTV_Validator  valid );\r
+\r
+\r
+  FT_LOCAL( FT_UInt )\r
+  otv_GSUBGPOS_get_Lookup_count( FT_Bytes  table );\r
+\r
+  FT_LOCAL( FT_UInt )\r
+  otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes  table );\r
+\r
+ /* */\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __OTVCOMMN_H__ */\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otverror.h b/reactos/lib/freetype/src/otvalid/otverror.h
new file mode 100644 (file)
index 0000000..cbf5ae1
--- /dev/null
@@ -0,0 +1,43 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otverror.h                                                             */\r
+/*                                                                         */\r
+/*    OpenType validation module error codes (specification only).         */\r
+/*                                                                         */\r
+/*  Copyright 2004, 2005 by                                                */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* This file is used to define the OpenType validation module error      */\r
+  /* enumeration constants.                                                */\r
+  /*                                                                       */\r
+  /*************************************************************************/\r
+\r
+#ifndef __OTVERROR_H__\r
+#define __OTVERROR_H__\r
+\r
+#include FT_MODULE_ERRORS_H\r
+\r
+#undef __FTERRORS_H__\r
+\r
+#define FT_ERR_PREFIX  OTV_Err_\r
+#define FT_ERR_BASE    FT_Mod_Err_OTvalid\r
+\r
+#define FT_KEEP_ERR_PREFIX\r
+\r
+#include FT_ERRORS_H\r
+\r
+#endif /* __OTVERROR_H__ */\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvgdef.c b/reactos/lib/freetype/src/otvalid/otvgdef.c
new file mode 100644 (file)
index 0000000..15966a3
--- /dev/null
@@ -0,0 +1,219 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvgdef.c                                                              */\r
+/*                                                                         */\r
+/*    OpenType GDEF table validation (body).                               */\r
+/*                                                                         */\r
+/*  Copyright 2004, 2005 by                                                */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include "otvalid.h"\r
+#include "otvcommn.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_otvgdef\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                      UTILITY FUNCTIONS                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+#define AttachList    otv_O_x_Ox, "AttachList"\r
+#define LigCaretList  otv_O_x_Ox, "LigCaretList"\r
+\r
+  /* sets valid->extra1 (0)           */\r
+\r
+  static void\r
+  otv_O_x_Ox( FT_Bytes       table,\r
+              OTV_Validator  valid )\r
+  {\r
+    FT_Bytes           p = table;\r
+    FT_Bytes           Coverage;\r
+    FT_UInt            GlyphCount;\r
+    OTV_Validate_Func  func;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    Coverage   = table + FT_NEXT_USHORT( p );\r
+    GlyphCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));\r
+\r
+    otv_Coverage_validate( Coverage, valid );\r
+    if ( GlyphCount != otv_Coverage_get_count( Coverage ) )\r
+      FT_INVALID_DATA;\r
+\r
+    OTV_LIMIT_CHECK( GlyphCount * 2 );\r
+\r
+    valid->nesting_level++;\r
+    func          = valid->func[valid->nesting_level];\r
+    valid->extra1 = 0;\r
+\r
+    for ( ; GlyphCount > 0; GlyphCount-- )\r
+      func( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+    valid->nesting_level--;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                       LIGATURE CARETS                         *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+#define  CaretValue  otv_CaretValue_validate, "CaretValue"\r
+\r
+  static void\r
+  otv_CaretValue_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   CaretValueFormat;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+\r
+    CaretValueFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format = %d)\n", CaretValueFormat ));\r
+\r
+    switch ( CaretValueFormat )\r
+    {\r
+    case 1:     /* CaretValueFormat1 */\r
+      /* skip Coordinate, no test */\r
+      break;\r
+\r
+    case 2:     /* CaretValueFormat2 */\r
+      /* skip CaretValuePoint, no test */\r
+      break;\r
+\r
+    case 3:     /* CaretValueFormat3 */\r
+      p += 2;   /* skip Coordinate */\r
+\r
+      OTV_LIMIT_CHECK( 2 );\r
+\r
+      /* DeviceTable */\r
+      otv_Device_validate( table + FT_NEXT_USHORT( p ), valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                         GDEF TABLE                            *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_GDEF_validate( FT_Bytes      table,\r
+                     FT_Bytes      gsub,\r
+                     FT_Bytes      gpos,\r
+                     FT_Validator  ftvalid )\r
+  {\r
+    OTV_ValidatorRec  validrec;\r
+    OTV_Validator     valid = &validrec;\r
+    FT_Bytes          p     = table;\r
+    FT_UInt           table_size;\r
+    FT_Bool           need_MarkAttachClassDef;\r
+\r
+    OTV_OPTIONAL_TABLE( GlyphClassDef );\r
+    OTV_OPTIONAL_TABLE( AttachListOffset );\r
+    OTV_OPTIONAL_TABLE( LigCaretListOffset );\r
+    OTV_OPTIONAL_TABLE( MarkAttachClassDef );\r
+\r
+\r
+    valid->root = ftvalid;\r
+\r
+    FT_TRACE3(( "validating GDEF table\n" ));\r
+    OTV_INIT;\r
+\r
+    OTV_LIMIT_CHECK( 12 );\r
+\r
+    if ( FT_NEXT_ULONG( p ) != 0x10000UL )          /* Version */\r
+      FT_INVALID_FORMAT;\r
+\r
+    /* MarkAttachClassDef has been added to the OpenType */\r
+    /* specification without increasing GDEF's version,  */\r
+    /* so we use this ugly hack to find out whether the  */\r
+    /* table is needed actually.                         */\r
+\r
+    need_MarkAttachClassDef = FT_BOOL(\r
+      otv_GSUBGPOS_have_MarkAttachmentType_flag( gsub ) ||\r
+      otv_GSUBGPOS_have_MarkAttachmentType_flag( gpos ) );\r
+\r
+    if ( need_MarkAttachClassDef )\r
+      table_size = 12;              /* OpenType >= 1.2 */\r
+    else\r
+      table_size = 10;              /* OpenType < 1.2  */\r
+\r
+    OTV_OPTIONAL_OFFSET( GlyphClassDef );\r
+    OTV_SIZE_CHECK( GlyphClassDef );\r
+    if ( GlyphClassDef )\r
+      otv_ClassDef_validate( table + GlyphClassDef, valid );\r
+\r
+    OTV_OPTIONAL_OFFSET( AttachListOffset );\r
+    OTV_SIZE_CHECK( AttachListOffset );\r
+    if ( AttachListOffset )\r
+    {\r
+      OTV_NEST2( AttachList, AttachPoint );\r
+      OTV_RUN( table + AttachListOffset, valid );\r
+    }\r
+\r
+    OTV_OPTIONAL_OFFSET( LigCaretListOffset );\r
+    OTV_SIZE_CHECK( LigCaretListOffset );\r
+    if ( LigCaretListOffset )\r
+    {\r
+      OTV_NEST3( LigCaretList, LigGlyph, CaretValue );\r
+      OTV_RUN( table + LigCaretListOffset, valid );\r
+    }\r
+\r
+    if ( need_MarkAttachClassDef )\r
+    {\r
+      OTV_OPTIONAL_OFFSET( MarkAttachClassDef );\r
+      OTV_SIZE_CHECK( MarkAttachClassDef );\r
+      if ( MarkAttachClassDef )\r
+        otv_ClassDef_validate( table + MarkAttachClassDef, valid );\r
+    }\r
+\r
+    FT_TRACE4(( "\n" ));\r
+  }\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvgpos.c b/reactos/lib/freetype/src/otvalid/otvgpos.c
new file mode 100644 (file)
index 0000000..ed869b0
--- /dev/null
@@ -0,0 +1,1013 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvgpos.c                                                              */\r
+/*                                                                         */\r
+/*    OpenType GPOS table validation (body).                               */\r
+/*                                                                         */\r
+/*  Copyright 2002, 2004, 2005 by                                          */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include "otvalid.h"\r
+#include "otvcommn.h"\r
+#include "otvgpos.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_otvgpos\r
+\r
+\r
+  static void\r
+  otv_Anchor_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid );\r
+\r
+  static void\r
+  otv_MarkArray_validate( FT_Bytes       table,\r
+                          OTV_Validator  valid );\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                      UTILITY FUNCTIONS                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+#define BaseArray       otv_x_sxy, "BaseArray"\r
+#define LigatureAttach  otv_x_sxy, "LigatureAttach"\r
+#define Mark2Array      otv_x_sxy, "Mark2Array"\r
+\r
+  /* uses valid->extra1 (counter)                             */\r
+  /* uses valid->extra2 (boolean to handle NULL anchor field) */\r
+\r
+  static void\r
+  otv_x_sxy( FT_Bytes       table,\r
+             OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   Count, count1, table_size;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+\r
+    OTV_TRACE(( " (Count = %d)\n", Count ));\r
+\r
+    Count = FT_NEXT_USHORT( p );\r
+\r
+    OTV_LIMIT_CHECK( Count * valid->extra1 * 2 );\r
+\r
+    table_size = Count * valid->extra1 * 2 + 2;\r
+\r
+    for ( ; Count > 0; Count-- )\r
+      for ( count1 = valid->extra1; count1 > 0; count1-- )\r
+      {\r
+        OTV_OPTIONAL_TABLE( anchor_offset );\r
+\r
+\r
+        OTV_OPTIONAL_OFFSET( anchor_offset );\r
+\r
+        if ( valid->extra2 )\r
+        {\r
+          OTV_SIZE_CHECK( anchor_offset );\r
+          if ( anchor_offset )\r
+            otv_Anchor_validate( table + anchor_offset, valid );\r
+        }        \r
+        else  \r
+          otv_Anchor_validate( table + anchor_offset, valid );\r
+      }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+#define MarkBasePosFormat1  otv_u_O_O_u_O_O, "MarkBasePosFormat1"\r
+#define MarkLigPosFormat1   otv_u_O_O_u_O_O, "MarkLigPosFormat1"\r
+#define MarkMarkPosFormat1  otv_u_O_O_u_O_O, "MarkMarkPosFormat1"\r
+\r
+  /* sets valid->extra1 (class count) */\r
+\r
+  static void\r
+  otv_u_O_O_u_O_O( FT_Bytes       table,\r
+                   OTV_Validator  valid )\r
+  {\r
+    FT_Bytes           p = table;\r
+    FT_UInt            Coverage1, Coverage2, ClassCount;\r
+    FT_UInt            Array1, Array2;\r
+    OTV_Validate_Func  func;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    p += 2;     /* skip PosFormat */\r
+\r
+    OTV_LIMIT_CHECK( 10 );\r
+    Coverage1  = FT_NEXT_USHORT( p );\r
+    Coverage2  = FT_NEXT_USHORT( p );\r
+    ClassCount = FT_NEXT_USHORT( p );\r
+    Array1     = FT_NEXT_USHORT( p );\r
+    Array2     = FT_NEXT_USHORT( p );\r
+\r
+    otv_Coverage_validate( table + Coverage1, valid );\r
+    otv_Coverage_validate( table + Coverage2, valid );\r
+\r
+    otv_MarkArray_validate( table + Array1, valid );\r
+\r
+    valid->nesting_level++;\r
+    func          = valid->func[valid->nesting_level];    \r
+    valid->extra1 = ClassCount;\r
+\r
+    func( table + Array2, valid );\r
+\r
+    valid->nesting_level--;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                        VALUE RECORDS                          *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  static FT_UInt\r
+  otv_value_length( FT_UInt  format )\r
+  {\r
+    FT_UInt  count;\r
+\r
+\r
+    count = ( ( format & 0xAA ) >> 1 ) + ( format & 0x55 );\r
+    count = ( ( count  & 0xCC ) >> 2 ) + ( count  & 0x33 );\r
+    count = ( ( count  & 0xF0 ) >> 4 ) + ( count  & 0x0F );\r
+\r
+    return count * 2;\r
+  }\r
+\r
+\r
+  /* uses valid->extra3 (pointer to base table) */\r
+\r
+  static void\r
+  otv_ValueRecord_validate( FT_Bytes       table,\r
+                            FT_UInt        format,\r
+                            OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   count;\r
+\r
+#ifdef FT_DEBUG_LEVEL_TRACE\r
+    FT_Int    loop;\r
+    FT_ULong  res = 0;\r
+\r
+\r
+    OTV_NAME_ENTER( "ValueRecord" );\r
+\r
+    /* display `format' in dual representation */\r
+    for ( loop = 7; loop >= 0; loop-- )\r
+    {\r
+      res <<= 4;\r
+      res  += ( format >> loop ) & 1;\r
+    }\r
+\r
+    OTV_TRACE(( " (format 0b%08lx)\n", res ));\r
+#endif\r
+\r
+    if ( format >= 0x100 )\r
+      FT_INVALID_DATA;\r
+\r
+    for ( count = 4; count > 0; count-- )\r
+    {\r
+      if ( format & 1 )\r
+      {\r
+        /* XPlacement, YPlacement, XAdvance, YAdvance */\r
+        OTV_LIMIT_CHECK( 2 );\r
+        p += 2;\r
+      }\r
+\r
+      format >>= 1;\r
+    }\r
+\r
+    for ( count = 4; count > 0; count-- )\r
+    {\r
+      if ( format & 1 )\r
+      {\r
+        FT_UInt   table_size;\r
+\r
+        OTV_OPTIONAL_TABLE( device );\r
+\r
+\r
+        /* XPlaDevice, YPlaDevice, XAdvDevice, YAdvDevice */\r
+        OTV_LIMIT_CHECK( 2 );\r
+        OTV_OPTIONAL_OFFSET( device );\r
+\r
+        /* XXX: this value is usually too small, especially if the current */\r
+        /* ValueRecord is part of an array -- getting the correct table    */\r
+        /* size is probably not worth the trouble                          */\r
+\r
+        table_size = p - valid->extra3;\r
+\r
+        OTV_SIZE_CHECK( device );\r
+        if ( device )\r
+          otv_Device_validate( valid->extra3 + device, valid );\r
+      }\r
+      format >>= 1;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                           ANCHORS                             *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  static void\r
+  otv_Anchor_validate( FT_Bytes       table,\r
+                       OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   AnchorFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "Anchor");\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+    AnchorFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", AnchorFormat ));\r
+\r
+    p += 4;     /* skip XCoordinate and YCoordinate */\r
+\r
+    switch ( AnchorFormat )\r
+    {\r
+    case 1:\r
+      break;\r
+\r
+    case 2:\r
+      OTV_LIMIT_CHECK( 2 );  /* AnchorPoint */\r
+      break;\r
+\r
+    case 3:\r
+      {\r
+        FT_UInt   table_size;\r
+\r
+        OTV_OPTIONAL_TABLE( XDeviceTable );\r
+        OTV_OPTIONAL_TABLE( YDeviceTable );\r
+\r
+\r
+        OTV_LIMIT_CHECK( 4 );\r
+        OTV_OPTIONAL_OFFSET( XDeviceTable );\r
+        OTV_OPTIONAL_OFFSET( YDeviceTable );\r
+\r
+        table_size = 6 + 4;\r
+\r
+        OTV_SIZE_CHECK( XDeviceTable );\r
+        if ( XDeviceTable )\r
+          otv_Device_validate( table + XDeviceTable, valid );\r
+\r
+        OTV_SIZE_CHECK( YDeviceTable );\r
+        if ( YDeviceTable )\r
+          otv_Device_validate( table + YDeviceTable, valid );\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                         MARK ARRAYS                           *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  static void\r
+  otv_MarkArray_validate( FT_Bytes       table,\r
+                          OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   MarkCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "MarkArray" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    MarkCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (MarkCount = %d)\n", MarkCount ));\r
+\r
+    OTV_LIMIT_CHECK( MarkCount * 4 );\r
+\r
+    /* MarkRecord */\r
+    for ( ; MarkCount > 0; MarkCount-- )\r
+    {\r
+      p += 2;   /* skip Class */\r
+      /* MarkAnchor */\r
+      otv_Anchor_validate( table + FT_NEXT_USHORT( p ), valid );\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 1                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra3 (pointer to base table) */\r
+\r
+  static void\r
+  otv_SinglePos_validate( FT_Bytes       table,\r
+                          OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "SinglePos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    valid->extra3 = table;\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:     /* SinglePosFormat1 */\r
+      {\r
+        FT_UInt  Coverage, ValueFormat;\r
+\r
+\r
+        OTV_LIMIT_CHECK( 4 );\r
+        Coverage    = FT_NEXT_USHORT( p );\r
+        ValueFormat = FT_NEXT_USHORT( p );\r
+\r
+        otv_Coverage_validate( table + Coverage, valid );\r
+        otv_ValueRecord_validate( p, ValueFormat, valid ); /* Value */\r
+      }\r
+      break;\r
+\r
+    case 2:     /* SinglePosFormat2 */\r
+      {\r
+        FT_UInt  Coverage, ValueFormat, ValueCount, len_value;\r
+\r
+\r
+        OTV_LIMIT_CHECK( 6 );\r
+        Coverage    = FT_NEXT_USHORT( p );\r
+        ValueFormat = FT_NEXT_USHORT( p );\r
+        ValueCount  = FT_NEXT_USHORT( p );\r
+\r
+        OTV_TRACE(( " (ValueCount = %d)\n", ValueCount ));\r
+\r
+        len_value = otv_value_length( ValueFormat );\r
+\r
+        otv_Coverage_validate( table + Coverage, valid );\r
+\r
+        OTV_LIMIT_CHECK( ValueCount * len_value );\r
+\r
+        /* Value */\r
+        for ( ; ValueCount > 0; ValueCount-- )\r
+        {\r
+          otv_ValueRecord_validate( p, ValueFormat, valid );\r
+          p += len_value;\r
+        }\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 2                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  static void\r
+  otv_PairSet_validate( FT_Bytes       table,\r
+                        FT_UInt        format1,\r
+                        FT_UInt        format2,\r
+                        OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   value_len1, value_len2, PairValueCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "PairSet" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PairValueCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (PairValueCount = %d)\n", PairValueCount ));\r
+\r
+    value_len1 = otv_value_length( format1 );\r
+    value_len2 = otv_value_length( format2 );\r
+\r
+    OTV_LIMIT_CHECK( PairValueCount * ( value_len1 + value_len2 + 2 ) );\r
+\r
+    /* PairValueRecord */\r
+    for ( ; PairValueCount > 0; PairValueCount-- )\r
+    {\r
+      p += 2;       /* skip SecondGlyph */\r
+\r
+      if ( format1 )\r
+        otv_ValueRecord_validate( p, format1, valid ); /* Value1 */\r
+      p += value_len1;\r
+\r
+      if ( format2 )\r
+        otv_ValueRecord_validate( p, format2, valid ); /* Value2 */\r
+      p += value_len2;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* sets valid->extra3 (pointer to base table) */\r
+\r
+  static void\r
+  otv_PairPos_validate( FT_Bytes       table,\r
+                        OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "PairPos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    valid->extra3 = table;\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:     /* PairPosFormat1 */\r
+      {\r
+        FT_UInt  Coverage, ValueFormat1, ValueFormat2, PairSetCount;\r
+\r
+\r
+        OTV_LIMIT_CHECK( 8 );\r
+        Coverage     = FT_NEXT_USHORT( p );\r
+        ValueFormat1 = FT_NEXT_USHORT( p );\r
+        ValueFormat2 = FT_NEXT_USHORT( p );\r
+        PairSetCount = FT_NEXT_USHORT( p );\r
+\r
+        OTV_TRACE(( " (PairSetCount = %d)\n", PairSetCount ));\r
+\r
+        otv_Coverage_validate( table + Coverage, valid );\r
+\r
+        OTV_LIMIT_CHECK( PairSetCount * 2 );\r
+\r
+        /* PairSetOffset */\r
+        for ( ; PairSetCount > 0; PairSetCount-- )\r
+          otv_PairSet_validate( table + FT_NEXT_USHORT( p ),\r
+                                ValueFormat1, ValueFormat2, valid );\r
+      }\r
+      break;\r
+\r
+    case 2:     /* PairPosFormat2 */\r
+      {\r
+        FT_UInt  Coverage, ValueFormat1, ValueFormat2, ClassDef1, ClassDef2;\r
+        FT_UInt  ClassCount1, ClassCount2, len_value1, len_value2, count;\r
+\r
+\r
+        OTV_LIMIT_CHECK( 14 );\r
+        Coverage     = FT_NEXT_USHORT( p );\r
+        ValueFormat1 = FT_NEXT_USHORT( p );\r
+        ValueFormat2 = FT_NEXT_USHORT( p );\r
+        ClassDef1    = FT_NEXT_USHORT( p );\r
+        ClassDef2    = FT_NEXT_USHORT( p );\r
+        ClassCount1  = FT_NEXT_USHORT( p );\r
+        ClassCount2  = FT_NEXT_USHORT( p );\r
+\r
+        OTV_TRACE(( " (ClassCount1 = %d)\n", ClassCount1 ));\r
+        OTV_TRACE(( " (ClassCount2 = %d)\n", ClassCount2 ));\r
+\r
+        len_value1 = otv_value_length( ValueFormat1 );\r
+        len_value2 = otv_value_length( ValueFormat2 );\r
+\r
+        otv_Coverage_validate( table + Coverage, valid );\r
+        otv_ClassDef_validate( table + ClassDef1, valid );\r
+        otv_ClassDef_validate( table + ClassDef2, valid );\r
+\r
+        OTV_LIMIT_CHECK( ClassCount1 * ClassCount2 *\r
+                     ( len_value1 + len_value2 ) );\r
+\r
+        /* Class1Record */\r
+        for ( ; ClassCount1 > 0; ClassCount1-- )\r
+        {\r
+          /* Class2Record */\r
+          for ( count = ClassCount2; count > 0; count-- )\r
+          {\r
+            if ( ValueFormat1 )\r
+              /* Value1 */\r
+              otv_ValueRecord_validate( p, ValueFormat1, valid );\r
+            p += len_value1;\r
+\r
+            if ( ValueFormat2 )\r
+              /* Value2 */\r
+              otv_ValueRecord_validate( p, ValueFormat2, valid );\r
+            p += len_value2;\r
+          }\r
+        }\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 3                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  static void\r
+  otv_CursivePos_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "CursivePos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:     /* CursivePosFormat1 */\r
+      {\r
+        FT_UInt   table_size;\r
+        FT_UInt   Coverage, EntryExitCount;\r
+\r
+        OTV_OPTIONAL_TABLE( EntryAnchor );\r
+        OTV_OPTIONAL_TABLE( ExitAnchor  );\r
+\r
+\r
+        OTV_LIMIT_CHECK( 4 );\r
+        Coverage       = FT_NEXT_USHORT( p );\r
+        EntryExitCount = FT_NEXT_USHORT( p );\r
+\r
+        OTV_TRACE(( " (EntryExitCount = %d)\n", EntryExitCount ));\r
+\r
+        otv_Coverage_validate( table + Coverage, valid );\r
+\r
+        OTV_LIMIT_CHECK( EntryExitCount * 4 );\r
+\r
+        table_size = EntryExitCount * 4 + 4;\r
+\r
+        /* EntryExitRecord */\r
+        for ( ; EntryExitCount > 0; EntryExitCount-- )\r
+        {\r
+          OTV_OPTIONAL_OFFSET( EntryAnchor );\r
+          OTV_OPTIONAL_OFFSET( ExitAnchor  );\r
+\r
+          OTV_SIZE_CHECK( EntryAnchor );\r
+          if ( EntryAnchor )\r
+            otv_Anchor_validate( table + EntryAnchor, valid );\r
+\r
+          OTV_SIZE_CHECK( ExitAnchor );\r
+          if ( ExitAnchor )\r
+            otv_Anchor_validate( table + ExitAnchor, valid );\r
+        }\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 4                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra2 (0) */\r
+\r
+  static void\r
+  otv_MarkBasePos_validate( FT_Bytes       table,\r
+                            OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "MarkBasePos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:\r
+      valid->extra2 = 0;\r
+      OTV_NEST2( MarkBasePosFormat1, BaseArray );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 5                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra2 (1) */\r
+\r
+  static void\r
+  otv_MarkLigPos_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "MarkLigPos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:\r
+      valid->extra2 = 1;\r
+      OTV_NEST3( MarkLigPosFormat1, LigatureArray, LigatureAttach );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 6                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra2 (0) */\r
+\r
+  static void\r
+  otv_MarkMarkPos_validate( FT_Bytes       table,\r
+                            OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "MarkMarkPos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:\r
+      valid->extra2 = 0;\r
+      OTV_NEST2( MarkMarkPosFormat1, Mark2Array );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 7                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra1 (lookup count) */\r
+\r
+  static void\r
+  otv_ContextPos_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "ContextPos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:\r
+      /* no need to check glyph indices/classes used as input for these */\r
+      /* context rules since even invalid glyph indices/classes return  */\r
+      /* meaningful results                                             */\r
+\r
+      valid->extra1 = valid->lookup_count;\r
+      OTV_NEST3( ContextPosFormat1, PosRuleSet, PosRule );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    case 2:\r
+      /* no need to check glyph indices/classes used as input for these */\r
+      /* context rules since even invalid glyph indices/classes return  */\r
+      /* meaningful results                                             */\r
+\r
+      OTV_NEST3( ContextPosFormat2, PosClassSet, PosClassRule );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    case 3:\r
+      OTV_NEST1( ContextPosFormat3 );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 8                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra1 (lookup count) */\r
+\r
+  static void\r
+  otv_ChainContextPos_validate( FT_Bytes       table,\r
+                                OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "ChainContextPos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:\r
+      /* no need to check glyph indices/classes used as input for these */\r
+      /* context rules since even invalid glyph indices/classes return  */\r
+      /* meaningful results                                             */\r
+\r
+      valid->extra1 = valid->lookup_count;\r
+      OTV_NEST3( ChainContextPosFormat1,\r
+                 ChainPosRuleSet, ChainPosRule );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    case 2:\r
+      /* no need to check glyph indices/classes used as input for these */\r
+      /* context rules since even invalid glyph indices/classes return  */\r
+      /* meaningful results                                             */\r
+\r
+      OTV_NEST3( ChainContextPosFormat2,\r
+                 ChainPosClassSet, ChainPosClassRule );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    case 3:\r
+      OTV_NEST1( ChainContextPosFormat3 );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                     GPOS LOOKUP TYPE 9                        *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* uses valid->type_funcs */\r
+\r
+  static void\r
+  otv_ExtensionPos_validate( FT_Bytes       table,\r
+                             OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   PosFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "ExtensionPos" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    PosFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", PosFormat ));\r
+\r
+    switch ( PosFormat )\r
+    {\r
+    case 1:     /* ExtensionPosFormat1 */\r
+      {\r
+        FT_UInt            ExtensionLookupType, ExtensionOffset;\r
+        OTV_Validate_Func  validate;\r
+\r
+\r
+        OTV_LIMIT_CHECK( 6 );\r
+        ExtensionLookupType = FT_NEXT_USHORT( p );\r
+        ExtensionOffset     = FT_NEXT_ULONG( p );\r
+\r
+        if ( ExtensionLookupType == 0 || ExtensionLookupType >= 9 )\r
+          FT_INVALID_DATA;\r
+\r
+        validate = valid->type_funcs[ExtensionLookupType - 1];\r
+        validate( table + ExtensionOffset, valid );\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static const OTV_Validate_Func  otv_gpos_validate_funcs[9] =\r
+  {\r
+    otv_SinglePos_validate,\r
+    otv_PairPos_validate,\r
+    otv_CursivePos_validate,\r
+    otv_MarkBasePos_validate,\r
+    otv_MarkLigPos_validate,\r
+    otv_MarkMarkPos_validate,\r
+    otv_ContextPos_validate,\r
+    otv_ChainContextPos_validate,\r
+    otv_ExtensionPos_validate\r
+  };\r
+\r
+\r
+  /* sets valid->type_count */\r
+  /* sets valid->type_funcs */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_GPOS_subtable_validate( FT_Bytes       table,\r
+                              OTV_Validator  valid )\r
+  {\r
+    valid->type_count = 9;\r
+    valid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs;\r
+\r
+    otv_Lookup_validate( table, valid );\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                          GPOS TABLE                           *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->glyph_count */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_GPOS_validate( FT_Bytes      table,\r
+                     FT_UInt       glyph_count,\r
+                     FT_Validator  ftvalid )\r
+  {\r
+    OTV_ValidatorRec  validrec;\r
+    OTV_Validator     valid = &validrec;\r
+    FT_Bytes          p     = table;\r
+    FT_UInt           ScriptList, FeatureList, LookupList;\r
+\r
+\r
+    valid->root = ftvalid;\r
+\r
+    FT_TRACE3(( "validating GPOS table\n" ));\r
+    OTV_INIT;\r
+\r
+    OTV_LIMIT_CHECK( 10 );\r
+\r
+    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\r
+      FT_INVALID_DATA;\r
+\r
+    ScriptList  = FT_NEXT_USHORT( p );\r
+    FeatureList = FT_NEXT_USHORT( p );\r
+    LookupList  = FT_NEXT_USHORT( p );\r
+\r
+    valid->type_count  = 9;\r
+    valid->type_funcs  = (OTV_Validate_Func*)otv_gpos_validate_funcs;\r
+    valid->glyph_count = glyph_count;\r
+\r
+    otv_LookupList_validate( table + LookupList,\r
+                             valid );\r
+    otv_FeatureList_validate( table + FeatureList, table + LookupList,\r
+                              valid );\r
+    otv_ScriptList_validate( table + ScriptList, table + FeatureList,\r
+                             valid );\r
+\r
+    FT_TRACE4(( "\n" ));\r
+  }\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvgpos.h b/reactos/lib/freetype/src/otvalid/otvgpos.h
new file mode 100644 (file)
index 0000000..a2a1b99
--- /dev/null
@@ -0,0 +1,36 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvgpos.h                                                              */\r
+/*                                                                         */\r
+/*    OpenType GPOS table validator (specification).                       */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __OTVGPOS_H__\r
+#define __OTVGPOS_H__\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  FT_LOCAL( void )\r
+  otv_GPOS_subtable_validate( FT_Bytes       table,\r
+                              OTV_Validator  valid );\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __OTVGPOS_H__ */\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvgsub.c b/reactos/lib/freetype/src/otvalid/otvgsub.c
new file mode 100644 (file)
index 0000000..01aa0ba
--- /dev/null
@@ -0,0 +1,584 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvgsub.c                                                              */\r
+/*                                                                         */\r
+/*    OpenType GSUB table validation (body).                               */\r
+/*                                                                         */\r
+/*  Copyright 2004, 2005 by                                                */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include "otvalid.h"\r
+#include "otvcommn.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_otvgsub\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                  GSUB LOOKUP TYPE 1                           *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* uses valid->glyph_count */\r
+\r
+  static void\r
+  otv_SingleSubst_validate( FT_Bytes       table,\r
+                            OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   SubstFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "SingleSubst" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    SubstFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", SubstFormat ));\r
+\r
+    switch ( SubstFormat )\r
+    {\r
+    case 1:     /* SingleSubstFormat1 */\r
+      {\r
+        FT_Bytes  Coverage;\r
+        FT_Int    DeltaGlyphID;\r
+        FT_Long   idx;\r
+\r
+\r
+        OTV_LIMIT_CHECK( 4 );\r
+        Coverage     = table + FT_NEXT_USHORT( p );\r
+        DeltaGlyphID = FT_NEXT_SHORT( p );\r
+\r
+        otv_Coverage_validate( Coverage, valid );\r
+\r
+        idx = otv_Coverage_get_first( Coverage ) + DeltaGlyphID;\r
+        if ( idx < 0 )\r
+          FT_INVALID_DATA;\r
+\r
+        idx = otv_Coverage_get_last( Coverage ) + DeltaGlyphID;\r
+        if ( (FT_UInt)idx >= valid->glyph_count )\r
+          FT_INVALID_DATA;\r
+      }\r
+      break;\r
+\r
+    case 2:     /* SingleSubstFormat2 */\r
+      {\r
+        FT_UInt  Coverage, GlyphCount;\r
+\r
+\r
+        OTV_LIMIT_CHECK( 4 );\r
+        Coverage   = FT_NEXT_USHORT( p );\r
+        GlyphCount = FT_NEXT_USHORT( p );\r
+\r
+        OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));\r
+\r
+        otv_Coverage_validate( table + Coverage, valid );\r
+\r
+        OTV_LIMIT_CHECK( GlyphCount * 2 );\r
+\r
+        /* Substitute */\r
+        for ( ; GlyphCount > 0; GlyphCount-- )\r
+          if ( FT_NEXT_USHORT( p ) >= valid->glyph_count )\r
+            FT_INVALID_DATA;\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                  GSUB LOOKUP TYPE 2                           *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra1 (glyph count) */\r
+\r
+  static void\r
+  otv_MultipleSubst_validate( FT_Bytes       table,\r
+                              OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   SubstFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "MultipleSubst" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    SubstFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", SubstFormat ));\r
+\r
+    switch ( SubstFormat )\r
+    {\r
+    case 1:\r
+      valid->extra1 = valid->glyph_count;\r
+      OTV_NEST2( MultipleSubstFormat1, Sequence );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                    GSUB LOOKUP TYPE 3                         *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra1 (glyph count) */\r
+\r
+  static void\r
+  otv_AlternateSubst_validate( FT_Bytes       table,\r
+                               OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   SubstFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "AlternateSubst" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    SubstFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", SubstFormat ));\r
+\r
+    switch ( SubstFormat )\r
+    {\r
+    case 1:\r
+      valid->extra1 = valid->glyph_count;\r
+      OTV_NEST2( AlternateSubstFormat1, AlternateSet );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                    GSUB LOOKUP TYPE 4                         *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+#define Ligature  otv_Ligature_validate, "Ligature"\r
+\r
+  /* uses valid->glyph_count */\r
+\r
+  static void\r
+  otv_Ligature_validate( FT_Bytes       table,\r
+                         OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   LigatureGlyph, CompCount;\r
+\r
+\r
+    OTV_ENTER;\r
+\r
+    OTV_LIMIT_CHECK( 4 );\r
+    LigatureGlyph = FT_NEXT_USHORT( p );\r
+    if ( LigatureGlyph >= valid->glyph_count )\r
+      FT_INVALID_DATA;\r
+\r
+    CompCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (CompCount = %d)\n", CompCount ));\r
+\r
+    if ( CompCount == 0 )\r
+      FT_INVALID_DATA;\r
+\r
+    CompCount--;\r
+\r
+    OTV_LIMIT_CHECK( CompCount * 2 );     /* Component */\r
+\r
+    /* no need to check the Component glyph indices */\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static void\r
+  otv_LigatureSubst_validate( FT_Bytes       table,\r
+                              OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   SubstFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "LigatureSubst" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    SubstFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", SubstFormat ));\r
+\r
+    switch ( SubstFormat )\r
+    {\r
+    case 1:\r
+      OTV_NEST3( LigatureSubstFormat1, LigatureSet, Ligature );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                  GSUB LOOKUP TYPE 5                           *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra1 (lookup count) */\r
+\r
+  static void\r
+  otv_ContextSubst_validate( FT_Bytes       table,\r
+                             OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   SubstFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "ContextSubst" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    SubstFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", SubstFormat ));\r
+\r
+    switch ( SubstFormat )\r
+    {\r
+    case 1:\r
+      /* no need to check glyph indices/classes used as input for these */\r
+      /* context rules since even invalid glyph indices/classes return  */\r
+      /* meaningful results                                             */\r
+\r
+      valid->extra1 = valid->lookup_count;\r
+      OTV_NEST3( ContextSubstFormat1, SubRuleSet, SubRule );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    case 2:\r
+      /* no need to check glyph indices/classes used as input for these */\r
+      /* context rules since even invalid glyph indices/classes return  */\r
+      /* meaningful results                                             */\r
+\r
+      OTV_NEST3( ContextSubstFormat2, SubClassSet, SubClassRule );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    case 3:\r
+      OTV_NEST1( ContextSubstFormat3 );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                    GSUB LOOKUP TYPE 6                         *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->extra1 (lookup count)            */\r
+\r
+  static void\r
+  otv_ChainContextSubst_validate( FT_Bytes       table,\r
+                                  OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   SubstFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "ChainContextSubst" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    SubstFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", SubstFormat ));\r
+\r
+    switch ( SubstFormat )\r
+    {\r
+    case 1:\r
+      /* no need to check glyph indices/classes used as input for these */\r
+      /* context rules since even invalid glyph indices/classes return  */\r
+      /* meaningful results                                             */\r
+\r
+      valid->extra1 = valid->lookup_count;\r
+      OTV_NEST3( ChainContextSubstFormat1,\r
+                 ChainSubRuleSet, ChainSubRule );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    case 2:\r
+      /* no need to check glyph indices/classes used as input for these */\r
+      /* context rules since even invalid glyph indices/classes return  */\r
+      /* meaningful results                                             */\r
+\r
+      OTV_NEST3( ChainContextSubstFormat2,\r
+                 ChainSubClassSet, ChainSubClassRule );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    case 3:\r
+      OTV_NEST1( ChainContextSubstFormat3 );\r
+      OTV_RUN( table, valid );\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                    GSUB LOOKUP TYPE 7                         *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* uses valid->type_funcs */\r
+\r
+  static void\r
+  otv_ExtensionSubst_validate( FT_Bytes       table,\r
+                               OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   SubstFormat;\r
+\r
+\r
+    OTV_NAME_ENTER( "ExtensionSubst" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    SubstFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", SubstFormat ));\r
+\r
+    switch ( SubstFormat )\r
+    {\r
+    case 1:     /* ExtensionSubstFormat1 */\r
+      {\r
+        FT_UInt            ExtensionLookupType, ExtensionOffset;\r
+        OTV_Validate_Func  validate;\r
+\r
+\r
+        OTV_LIMIT_CHECK( 6 );\r
+        ExtensionLookupType = FT_NEXT_USHORT( p );\r
+        ExtensionOffset     = FT_NEXT_ULONG( p );\r
+\r
+        if ( ExtensionLookupType == 0 ||\r
+             ExtensionLookupType == 7 ||\r
+             ExtensionLookupType > 8  )\r
+          FT_INVALID_DATA;\r
+\r
+        validate = valid->type_funcs[ExtensionLookupType - 1];\r
+        validate( table + ExtensionOffset, valid );\r
+      }\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                    GSUB LOOKUP TYPE 8                         *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* uses valid->glyph_count */\r
+\r
+  static void\r
+  otv_ReverseChainSingleSubst_validate( FT_Bytes       table,\r
+                                        OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table, Coverage;\r
+    FT_UInt   SubstFormat;\r
+    FT_UInt   BacktrackGlyphCount, LookaheadGlyphCount, GlyphCount;\r
+\r
+\r
+    OTV_NAME_ENTER( "ReverseChainSingleSubst" );\r
+\r
+    OTV_LIMIT_CHECK( 2 );\r
+    SubstFormat = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (format %d)\n", SubstFormat ));\r
+\r
+    switch ( SubstFormat )\r
+    {\r
+    case 1:     /* ReverseChainSingleSubstFormat1 */\r
+      OTV_LIMIT_CHECK( 4 );\r
+      Coverage            = table + FT_NEXT_USHORT( p );\r
+      BacktrackGlyphCount = FT_NEXT_USHORT( p );\r
+\r
+      OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount ));\r
+\r
+      otv_Coverage_validate( Coverage, valid );\r
+\r
+      OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 );\r
+\r
+      for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- )\r
+        otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+      LookaheadGlyphCount = FT_NEXT_USHORT( p );\r
+\r
+      OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount ));\r
+\r
+      OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 );\r
+\r
+      for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- )\r
+        otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid );\r
+\r
+      GlyphCount = FT_NEXT_USHORT( p );\r
+\r
+      OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));\r
+\r
+      if ( GlyphCount != otv_Coverage_get_count( Coverage ) )\r
+        FT_INVALID_DATA;\r
+\r
+      OTV_LIMIT_CHECK( GlyphCount * 2 );\r
+\r
+      /* Substitute */\r
+      for ( ; GlyphCount > 0; GlyphCount-- )\r
+        if ( FT_NEXT_USHORT( p ) >= valid->glyph_count )\r
+          FT_INVALID_DATA;\r
+\r
+      break;\r
+\r
+    default:\r
+      FT_INVALID_DATA;\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  static const OTV_Validate_Func  otv_gsub_validate_funcs[8] =\r
+  {\r
+    otv_SingleSubst_validate,\r
+    otv_MultipleSubst_validate,\r
+    otv_AlternateSubst_validate,\r
+    otv_LigatureSubst_validate,\r
+    otv_ContextSubst_validate,\r
+    otv_ChainContextSubst_validate,\r
+    otv_ExtensionSubst_validate,\r
+    otv_ReverseChainSingleSubst_validate\r
+  };\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                          GSUB TABLE                           *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /* sets valid->type_count  */\r
+  /* sets valid->type_funcs  */\r
+  /* sets valid->glyph_count */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_GSUB_validate( FT_Bytes      table,\r
+                     FT_UInt       glyph_count,\r
+                     FT_Validator  ftvalid )\r
+  {\r
+    OTV_ValidatorRec  validrec;\r
+    OTV_Validator     valid = &validrec;\r
+    FT_Bytes          p     = table;\r
+    FT_UInt           ScriptList, FeatureList, LookupList;\r
+\r
+\r
+    valid->root = ftvalid;\r
+\r
+    FT_TRACE3(( "validating GSUB table\n" ));\r
+    OTV_INIT;\r
+\r
+    OTV_LIMIT_CHECK( 10 );\r
+\r
+    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\r
+      FT_INVALID_DATA;\r
+\r
+    ScriptList  = FT_NEXT_USHORT( p );\r
+    FeatureList = FT_NEXT_USHORT( p );\r
+    LookupList  = FT_NEXT_USHORT( p );\r
+\r
+    valid->type_count  = 8;\r
+    valid->type_funcs  = (OTV_Validate_Func*)otv_gsub_validate_funcs;\r
+    valid->glyph_count = glyph_count;\r
+\r
+    otv_LookupList_validate( table + LookupList,\r
+                             valid );\r
+    otv_FeatureList_validate( table + FeatureList, table + LookupList,\r
+                              valid );\r
+    otv_ScriptList_validate( table + ScriptList, table + FeatureList,\r
+                             valid );\r
+\r
+    FT_TRACE4(( "\n" ));\r
+  }\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvjstf.c b/reactos/lib/freetype/src/otvalid/otvjstf.c
new file mode 100644 (file)
index 0000000..b45f027
--- /dev/null
@@ -0,0 +1,258 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvjstf.c                                                              */\r
+/*                                                                         */\r
+/*    OpenType JSTF table validation (body).                               */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include "otvalid.h"\r
+#include "otvcommn.h"\r
+#include "otvgpos.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_otvjstf\r
+\r
+\r
+#define JstfPriority  otv_JstfPriority_validate, "JstfPriority"\r
+#define JstfLookup    otv_GPOS_subtable_validate, ""\r
+\r
+  /* uses valid->extra1 (GSUB lookup count) */\r
+  /* uses valid->extra2 (GPOS lookup count) */\r
+  /* sets valid->extra1 (counter)           */\r
+\r
+  static void\r
+  otv_JstfPriority_validate( FT_Bytes       table,\r
+                             OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   table_size;\r
+    FT_UInt   gsub_lookup_count, gpos_lookup_count;\r
+\r
+    OTV_OPTIONAL_TABLE( ShrinkageEnableGSUB  );\r
+    OTV_OPTIONAL_TABLE( ShrinkageDisableGSUB );\r
+    OTV_OPTIONAL_TABLE( ShrinkageEnableGPOS  );\r
+    OTV_OPTIONAL_TABLE( ShrinkageDisableGPOS );\r
+    OTV_OPTIONAL_TABLE( ExtensionEnableGSUB  );\r
+    OTV_OPTIONAL_TABLE( ExtensionDisableGSUB );\r
+    OTV_OPTIONAL_TABLE( ExtensionEnableGPOS  );\r
+    OTV_OPTIONAL_TABLE( ExtensionDisableGPOS );\r
+    OTV_OPTIONAL_TABLE( ShrinkageJstfMax );\r
+    OTV_OPTIONAL_TABLE( ExtensionJstfMax );\r
+\r
+\r
+    OTV_ENTER;\r
+    OTV_TRACE(( "JstfPriority table\n" ));\r
+\r
+    OTV_LIMIT_CHECK( 20 );\r
+\r
+    gsub_lookup_count = valid->extra1;\r
+    gpos_lookup_count = valid->extra2;\r
+\r
+    table_size = 20;\r
+\r
+    valid->extra1 = gsub_lookup_count;\r
+    \r
+    OTV_OPTIONAL_OFFSET( ShrinkageEnableGSUB );\r
+    OTV_SIZE_CHECK( ShrinkageEnableGSUB );\r
+    if ( ShrinkageEnableGSUB )\r
+      otv_x_ux( table + ShrinkageEnableGSUB, valid );\r
+\r
+    OTV_OPTIONAL_OFFSET( ShrinkageDisableGSUB );\r
+    OTV_SIZE_CHECK( ShrinkageDisableGSUB );\r
+    if ( ShrinkageDisableGSUB )\r
+      otv_x_ux( table + ShrinkageDisableGSUB, valid );\r
+\r
+    valid->extra1 = gpos_lookup_count;\r
+\r
+    OTV_OPTIONAL_OFFSET( ShrinkageEnableGPOS );\r
+    OTV_SIZE_CHECK( ShrinkageEnableGPOS );\r
+    if ( ShrinkageEnableGPOS )\r
+      otv_x_ux( table + ShrinkageEnableGPOS, valid );\r
+\r
+    OTV_OPTIONAL_OFFSET( ShrinkageDisableGPOS );\r
+    OTV_SIZE_CHECK( ShrinkageDisableGPOS );\r
+    if ( ShrinkageDisableGPOS )\r
+      otv_x_ux( table + ShrinkageDisableGPOS, valid );\r
+\r
+    OTV_OPTIONAL_OFFSET( ShrinkageJstfMax );\r
+    OTV_SIZE_CHECK( ShrinkageJstfMax );\r
+    if ( ShrinkageJstfMax )\r
+    {\r
+      /* XXX: check lookup types? */\r
+      OTV_NEST2( JstfMax, JstfLookup );\r
+      OTV_RUN( table + ShrinkageJstfMax, valid );\r
+    }\r
+\r
+    valid->extra1 = gsub_lookup_count;\r
+\r
+    OTV_OPTIONAL_OFFSET( ExtensionEnableGSUB );\r
+    OTV_SIZE_CHECK( ExtensionEnableGSUB );\r
+    if ( ExtensionEnableGSUB )\r
+      otv_x_ux( table + ExtensionEnableGSUB, valid );\r
+\r
+    OTV_OPTIONAL_OFFSET( ExtensionDisableGSUB );\r
+    OTV_SIZE_CHECK( ExtensionDisableGSUB );\r
+    if ( ExtensionDisableGSUB )\r
+      otv_x_ux( table + ExtensionDisableGSUB, valid );\r
+\r
+    valid->extra1 = gpos_lookup_count;\r
+\r
+    OTV_OPTIONAL_OFFSET( ExtensionEnableGPOS );\r
+    OTV_SIZE_CHECK( ExtensionEnableGPOS );\r
+    if ( ExtensionEnableGPOS )\r
+      otv_x_ux( table + ExtensionEnableGPOS, valid );\r
+\r
+    OTV_OPTIONAL_OFFSET( ExtensionDisableGPOS );\r
+    OTV_SIZE_CHECK( ExtensionDisableGPOS );\r
+    if ( ExtensionDisableGPOS )\r
+      otv_x_ux( table + ExtensionDisableGPOS, valid );\r
+\r
+    OTV_OPTIONAL_OFFSET( ExtensionJstfMax );\r
+    OTV_SIZE_CHECK( ExtensionJstfMax );\r
+    if ( ExtensionJstfMax )\r
+    {\r
+      /* XXX: check lookup types? */\r
+      OTV_NEST2( JstfMax, JstfLookup );\r
+      OTV_RUN( table + ExtensionJstfMax, valid );\r
+    }\r
+\r
+    valid->extra1 = gsub_lookup_count;\r
+    valid->extra2 = gpos_lookup_count;\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* sets valid->extra (glyph count)               */\r
+  /* sets valid->func1 (otv_JstfPriority_validate) */\r
+\r
+  static void\r
+  otv_JstfScript_validate( FT_Bytes       table,\r
+                           OTV_Validator  valid )\r
+  {\r
+    FT_Bytes  p = table;\r
+    FT_UInt   table_size;\r
+    FT_UInt   JstfLangSysCount;\r
+\r
+    OTV_OPTIONAL_TABLE( ExtGlyph );\r
+    OTV_OPTIONAL_TABLE( DefJstfLangSys );\r
+\r
+\r
+    OTV_NAME_ENTER( "JstfScript" );\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+    OTV_OPTIONAL_OFFSET( ExtGlyph );\r
+    OTV_OPTIONAL_OFFSET( DefJstfLangSys );\r
+    JstfLangSysCount = FT_NEXT_USHORT( p );\r
+\r
+    OTV_TRACE(( " (JstfLangSysCount = %d)\n", JstfLangSysCount ));\r
+\r
+    table_size = JstfLangSysCount * 6 + 6;\r
+\r
+    OTV_SIZE_CHECK( ExtGlyph );\r
+    if ( ExtGlyph )\r
+    {\r
+      valid->extra1 = valid->glyph_count;\r
+      OTV_NEST1( ExtenderGlyph );\r
+      OTV_RUN( table + ExtGlyph, valid );\r
+    }\r
+\r
+    OTV_SIZE_CHECK( DefJstfLangSys );\r
+    if ( DefJstfLangSys )\r
+    {\r
+      OTV_NEST2( JstfLangSys, JstfPriority );\r
+      OTV_RUN( table + DefJstfLangSys, valid );\r
+    }\r
+\r
+    OTV_LIMIT_CHECK( 6 * JstfLangSysCount );\r
+\r
+    /* JstfLangSysRecord */\r
+    OTV_NEST2( JstfLangSys, JstfPriority );\r
+    for ( ; JstfLangSysCount > 0; JstfLangSysCount-- )\r
+    {\r
+      p += 4;       /* skip JstfLangSysTag */\r
+\r
+      OTV_RUN( table + FT_NEXT_USHORT( p ), valid );\r
+    }\r
+\r
+    OTV_EXIT;\r
+  }\r
+\r
+\r
+  /* sets valid->extra1 (GSUB lookup count) */\r
+  /* sets valid->extra2 (GPOS lookup count) */\r
+  /* sets valid->glyph_count                */\r
+\r
+  FT_LOCAL_DEF( void )\r
+  otv_JSTF_validate( FT_Bytes      table,\r
+                     FT_Bytes      gsub,\r
+                     FT_Bytes      gpos,\r
+                     FT_UInt       glyph_count,\r
+                     FT_Validator  ftvalid )\r
+  {\r
+    OTV_ValidatorRec  validrec;\r
+    OTV_Validator     valid = &validrec;\r
+    FT_Bytes          p     = table;\r
+    FT_UInt           JstfScriptCount;\r
+\r
+\r
+    valid->root = ftvalid;\r
+\r
+    FT_TRACE3(( "validating JSTF table\n" ));\r
+    OTV_INIT;\r
+\r
+    OTV_LIMIT_CHECK( 6 );\r
+\r
+    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\r
+      FT_INVALID_DATA;\r
+\r
+    JstfScriptCount = FT_NEXT_USHORT( p );\r
+\r
+    FT_TRACE3(( " (JstfScriptCount = %d)\n", JstfScriptCount ));\r
+\r
+    OTV_LIMIT_CHECK( JstfScriptCount * 6 );\r
+\r
+    if ( gsub )\r
+      valid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub );\r
+    else\r
+      valid->extra1 = 0;\r
+\r
+    if ( gpos )\r
+      valid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos );\r
+    else\r
+      valid->extra2 = 0;\r
+\r
+    valid->glyph_count = glyph_count;\r
+\r
+    /* JstfScriptRecord */\r
+    for ( ; JstfScriptCount > 0; JstfScriptCount-- )\r
+    {\r
+      p += 4;       /* skip JstfScriptTag */\r
+\r
+      /* JstfScript */\r
+      otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), valid );\r
+    }\r
+\r
+    FT_TRACE4(( "\n" ));\r
+  }\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/otvmod.c b/reactos/lib/freetype/src/otvalid/otvmod.c
new file mode 100644 (file)
index 0000000..0467ae8
--- /dev/null
@@ -0,0 +1,238 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvmod.c                                                               */\r
+/*                                                                         */\r
+/*    FreeType's OpenType validation module implementation (body).         */\r
+/*                                                                         */\r
+/*  Copyright 2004, 2005 by                                                */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_TRUETYPE_TABLES_H\r
+#include FT_TRUETYPE_TAGS_H\r
+#include FT_OPENTYPE_VALIDATE_H\r
+#include FT_INTERNAL_OBJECTS_H\r
+#include FT_SERVICE_OPENTYPE_VALIDATE_H\r
+\r
+#include "otvmod.h"\r
+#include "otvalid.h"\r
+#include "otvcommn.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_otvmodule\r
+\r
+\r
+  static FT_Error\r
+  otv_load_table( FT_Face    face,\r
+                  FT_Tag     tag,\r
+                  FT_Byte*  *table,\r
+                  FT_ULong  *table_len )\r
+  {\r
+    FT_Error   error;\r
+    FT_Memory  memory = FT_FACE_MEMORY( face );\r
+\r
+\r
+    error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len );\r
+    if ( error == OTV_Err_Table_Missing )\r
+      return OTV_Err_Ok;\r
+    if ( error )\r
+      goto Exit;\r
+\r
+    if ( FT_ALLOC( *table, *table_len ) )\r
+      goto Exit;\r
+\r
+    error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len );\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+  static FT_Error\r
+  otv_validate( FT_Face    face,\r
+                FT_UInt    ot_flags,\r
+                FT_Bytes  *ot_base,\r
+                FT_Bytes  *ot_gdef,\r
+                FT_Bytes  *ot_gpos,\r
+                FT_Bytes  *ot_gsub,\r
+                FT_Bytes  *ot_jstf )\r
+  {\r
+    FT_Error         error = OTV_Err_Ok;\r
+    FT_Byte          *base, *gdef, *gpos, *gsub, *jstf;\r
+    FT_ULong         len_base, len_gdef, len_gpos, len_gsub, len_jstf;\r
+    FT_ValidatorRec  valid;\r
+\r
+\r
+    base     = gdef     = gpos     = gsub     = jstf     = NULL;\r
+    len_base = len_gdef = len_gpos = len_gsub = len_jstf = 0;\r
+\r
+    /* load tables */\r
+\r
+    if ( ot_flags & FT_VALIDATE_BASE )\r
+    {\r
+      error = otv_load_table( face, TTAG_BASE, &base, &len_base );\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    if ( ot_flags & FT_VALIDATE_GDEF )\r
+    {\r
+      error = otv_load_table( face, TTAG_GDEF, &gdef, &len_gdef );\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    if ( ot_flags & FT_VALIDATE_GPOS )\r
+    {\r
+      error = otv_load_table( face, TTAG_GPOS, &gpos, &len_gpos );\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    if ( ot_flags & FT_VALIDATE_GSUB )\r
+    {\r
+      error = otv_load_table( face, TTAG_GSUB, &gsub, &len_gsub );\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    if ( ot_flags & FT_VALIDATE_JSTF )\r
+    {\r
+      error = otv_load_table( face, TTAG_JSTF, &jstf, &len_jstf );\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    /* validate tables */\r
+\r
+    if ( base )\r
+    {\r
+      ft_validator_init( &valid, base, base + len_base, FT_VALIDATE_DEFAULT );\r
+      if ( ft_setjmp( valid.jump_buffer ) == 0 )\r
+        otv_BASE_validate( base, &valid );\r
+      error = valid.error;\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    if ( gpos )\r
+    {\r
+      ft_validator_init( &valid, gpos, gpos + len_gpos, FT_VALIDATE_DEFAULT );\r
+      if (ft_setjmp( valid.jump_buffer ) == 0 )\r
+        otv_GPOS_validate( gpos, face->num_glyphs, &valid );\r
+      error = valid.error;\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    if ( gsub )\r
+    {\r
+      ft_validator_init( &valid, gsub, gsub + len_gsub, FT_VALIDATE_DEFAULT );\r
+      if ( ft_setjmp( valid.jump_buffer ) == 0 )\r
+        otv_GSUB_validate( gsub, face->num_glyphs, &valid );\r
+      error = valid.error;\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    if ( gdef )\r
+    {\r
+      ft_validator_init( &valid, gdef, gdef + len_gdef, FT_VALIDATE_DEFAULT );\r
+      if ( ft_setjmp( valid.jump_buffer ) == 0 )\r
+        otv_GDEF_validate( gdef, gsub, gpos, &valid );\r
+      error = valid.error;\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    if ( jstf )\r
+    {\r
+      ft_validator_init( &valid, jstf, jstf + len_jstf, FT_VALIDATE_DEFAULT );\r
+      if ( ft_setjmp( valid.jump_buffer ) == 0 )\r
+        otv_JSTF_validate( jstf, gsub, gpos, face->num_glyphs, &valid );\r
+      error = valid.error;\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    *ot_base = (FT_Bytes)base;\r
+    *ot_gdef = (FT_Bytes)gdef;\r
+    *ot_gpos = (FT_Bytes)gpos;\r
+    *ot_gsub = (FT_Bytes)gsub;\r
+    *ot_jstf = (FT_Bytes)jstf;\r
+\r
+  Exit:\r
+    if ( error ) {\r
+      FT_Memory  memory = FT_FACE_MEMORY( face );\r
+\r
+\r
+      FT_FREE( base );\r
+      FT_FREE( gdef );\r
+      FT_FREE( gpos );\r
+      FT_FREE( gsub );\r
+      FT_FREE( jstf );\r
+    }\r
+\r
+    return error;\r
+  }\r
+\r
+\r
+  static\r
+  const FT_Service_OTvalidateRec  otvalid_interface = \r
+  {\r
+    otv_validate\r
+  };\r
+\r
+\r
+  static\r
+  const FT_ServiceDescRec  otvalid_services[] = \r
+  {\r
+    { FT_SERVICE_ID_OPENTYPE_VALIDATE, &otvalid_interface },\r
+    { NULL, NULL }\r
+  };\r
+\r
+\r
+  static FT_Pointer\r
+  otvalid_get_service( FT_Module    module,\r
+                       const char*  service_id )\r
+  {\r
+    FT_UNUSED( module );\r
+\r
+    return ft_service_list_lookup( otvalid_services, service_id );\r
+  }\r
+\r
+\r
+  FT_CALLBACK_TABLE_DEF\r
+  const FT_Module_Class  otv_module_class =\r
+  {\r
+    0,\r
+    sizeof( FT_ModuleRec ),\r
+    "otvalid",\r
+    0x10000L,\r
+    0x20000L,\r
+\r
+    0,              /* module-specific interface */\r
+\r
+    (FT_Module_Constructor)0,\r
+    (FT_Module_Destructor) 0,\r
+    (FT_Module_Requester)  otvalid_get_service\r
+  };\r
+\r
+\r
+/* END */\r
similarity index 50%
rename from reactos/lib/freetype/src/autohint/ahmodule.h
rename to reactos/lib/freetype/src/otvalid/otvmod.h
index 43b1dbe..3036559 100644 (file)
@@ -1,42 +1,39 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ahmodule.h                                                             */
-/*                                                                         */
-/*    Auto-hinting module (declaration).                                   */
-/*                                                                         */
-/*  Copyright 2000-2001 Catharon Productions Inc.                          */
-/*  Author: David Turner                                                   */
-/*                                                                         */
-/*  This file is part of the Catharon Typography Project and shall only    */
-/*  be used, modified, and distributed under the terms of the Catharon     */
-/*  Open Source License that should come with this file under the name     */
-/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/*  Note that this license is compatible with the FreeType license.        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __AHMODULE_H__
-#define __AHMODULE_H__
-
-
-#include <ft2build.h>
-#include FT_MODULE_H
-
-
-FT_BEGIN_HEADER
-
-
-  FT_CALLBACK_TABLE
-  const FT_Module_Class  autohint_module_class;
-
-
-FT_END_HEADER
-
-#endif /* __AHMODULE_H__ */
-
-
-/* END */
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  otvmod.h                                                               */\r
+/*                                                                         */\r
+/*    FreeType's OpenType validation module implementation                 */\r
+/*    (specification).                                                     */\r
+/*                                                                         */\r
+/*  Copyright 2004 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __OTVMOD_H__\r
+#define __OTVMOD_H__\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_MODULE_H\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  FT_EXPORT_VAR( const FT_Module_Class )  otv_module_class;\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __OTVMOD_H__ */\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/otvalid/rules.mk b/reactos/lib/freetype/src/otvalid/rules.mk
new file mode 100644 (file)
index 0000000..554a390
--- /dev/null
@@ -0,0 +1,77 @@
+#\r
+# FreeType 2 OpenType validation driver configuration rules\r
+#\r
+\r
+\r
+# Copyright 2004 by\r
+# David Turner, Robert Wilhelm, and Werner Lemberg.\r
+#\r
+# This file is part of the FreeType project, and may only be used, modified,\r
+# and distributed under the terms of the FreeType project license,\r
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\r
+# indicate that you have read the license and understand and accept it\r
+# fully.\r
+\r
+\r
+# OTV driver directory\r
+#\r
+OTV_DIR := $(SRC_DIR)/otvalid\r
+\r
+\r
+# compilation flags for the driver\r
+#\r
+OTV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(OTV_DIR))\r
+\r
+\r
+# OTV driver sources (i.e., C files)\r
+#\r
+OTV_DRV_SRC := $(OTV_DIR)/otvbase.c  \\r
+               $(OTV_DIR)/otvcommn.c \\r
+               $(OTV_DIR)/otvgdef.c  \\r
+               $(OTV_DIR)/otvgpos.c  \\r
+               $(OTV_DIR)/otvgsub.c  \\r
+               $(OTV_DIR)/otvjstf.c  \\r
+               $(OTV_DIR)/otvmod.c\r
+\r
+# OTV driver headers\r
+#\r
+OTV_DRV_H := $(OTV_DIR)/otvalid.h \\r
+             $(OTV_DIR)/otverror.h  \\r
+             $(OTV_DIR)/otvcommn.h \\r
+             $(OTV_DIR)/otvgpos.h \\r
+             $(OTV_DIR)/otvmod.h\r
+\r
+\r
+# OTV driver object(s)\r
+#\r
+#   OTV_DRV_OBJ_M is used during `multi' builds.\r
+#   OTV_DRV_OBJ_S is used during `single' builds.\r
+#\r
+OTV_DRV_OBJ_M := $(OTV_DRV_SRC:$(OTV_DIR)/%.c=$(OBJ_DIR)/%.$O)\r
+OTV_DRV_OBJ_S := $(OBJ_DIR)/otvalid.$O\r
+\r
+# OTV driver source file for single build\r
+#\r
+OTV_DRV_SRC_S := $(OTV_DIR)/otvalid.c\r
+\r
+\r
+# OTV driver - single object\r
+#\r
+$(OTV_DRV_OBJ_S): $(OTV_DRV_SRC_S) $(OTV_DRV_SRC) \\r
+                   $(FREETYPE_H) $(OTV_DRV_H)\r
+       $(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(OTV_DRV_SRC_S))\r
+\r
+\r
+# OTV driver - multiple objects\r
+#\r
+$(OBJ_DIR)/%.$O: $(OTV_DIR)/%.c $(FREETYPE_H) $(OTV_DRV_H)\r
+       $(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\r
+\r
+\r
+# update main driver object lists\r
+#\r
+DRV_OBJS_S += $(OTV_DRV_OBJ_S)\r
+DRV_OBJS_M += $(OTV_DRV_OBJ_M)\r
+\r
+\r
+# EOF\r
index 3a884f5..752fcac 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/pcf Jamfile (c) 2001, 2003 David Turner
+# FreeType 2 src/pcf Jamfile
 #
+# Copyright 2001, 2003 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) pcf ;
 
index b6b04b9..e47a684 100644 (file)
@@ -221,6 +221,7 @@ THE SOFTWARE.
 
     FT_FREE( face->toc.tables );
     FT_FREE( pcfface->family_name );
+    FT_FREE( pcfface->style_name );
     FT_FREE( pcfface->available_sizes );
     FT_FREE( face->charset_encoding );
     FT_FREE( face->charset_registry );
@@ -369,13 +370,9 @@ THE SOFTWARE.
     PCF_Face  face = (PCF_Face)FT_SIZE_FACE( size );
 
     FT_UNUSED( pixel_width );
-    FT_UNUSED( pixel_height );
 
 
-    FT_TRACE4(( "rec %d - pres %d\n", size->metrics.y_ppem,
-                                      face->root.available_sizes->y_ppem >> 6 ));
-
-    if ( size->metrics.y_ppem == face->root.available_sizes->y_ppem >> 6 )
+    if ( pixel_height == (FT_UInt)face->root.available_sizes->height )
     {
       size->metrics.ascender    = face->accel.fontAscent << 6;
       size->metrics.descender   = face->accel.fontDescent * (-64);
@@ -391,7 +388,7 @@ THE SOFTWARE.
     }
     else
     {
-      FT_TRACE4(( "size WRONG\n" ));
+      FT_TRACE4(( "pixel size WRONG\n" ));
       return PCF_Err_Invalid_Pixel_Size;
     }
   }
@@ -404,12 +401,37 @@ THE SOFTWARE.
                       FT_UInt     horz_resolution,
                       FT_UInt     vert_resolution )
   {
+    PCF_Face  face = (PCF_Face)FT_SIZE_FACE( size );
+
     FT_UNUSED( char_width );
     FT_UNUSED( char_height );
     FT_UNUSED( horz_resolution );
     FT_UNUSED( vert_resolution );
 
-    return PCF_Set_Pixel_Size( size, 0, 0 );
+
+    FT_TRACE4(( "rec %d - pres %d\n",
+                size->metrics.y_ppem,
+                face->root.available_sizes->y_ppem >> 6 ));
+
+    if ( size->metrics.y_ppem == face->root.available_sizes->y_ppem >> 6 )
+    {
+      size->metrics.ascender    = face->accel.fontAscent << 6;
+      size->metrics.descender   = face->accel.fontDescent * (-64);
+#if 0
+      size->metrics.height      = face->accel.maxbounds.ascent << 6;
+#endif
+      size->metrics.height      = size->metrics.ascender -
+                                  size->metrics.descender;
+
+      size->metrics.max_advance = face->accel.maxbounds.characterWidth << 6;
+
+      return PCF_Err_Ok;
+    }
+    else
+    {
+      FT_TRACE4(( "size WRONG\n" ));
+      return PCF_Err_Invalid_Pixel_Size;
+    }
   }
 
 
index 383daaa..ea74d17 100644 (file)
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf fonts
 
-  Copyright 2000, 2001, 2002, 2003, 2004 by
+  Copyright 2000, 2001, 2002, 2003, 2004, 2005 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -101,7 +101,8 @@ THE SOFTWARE.
          FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) )
       return PCF_Err_Cannot_Open_Resource;
 
-    if ( toc->version != PCF_FILE_VERSION )
+    if ( toc->version != PCF_FILE_VERSION                 ||
+         toc->count   >  FT_ARRAY_MAX( face->toc.tables ) )
       return PCF_Err_Invalid_File_Format;
 
     if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) )
@@ -945,7 +946,12 @@ THE SOFTWARE.
     }
 
     if ( !parts || !len )
-      face->style_name = (char *)"Regular";
+    {
+      if ( FT_ALLOC( face->style_name, 8 ) )
+        return error;
+      ft_strcpy( face->style_name, "Regular" );
+      face->style_name[7] = '\0';
+    }
     else
     {
       char          *style, *s;
@@ -1097,13 +1103,14 @@ THE SOFTWARE.
 
         FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) );
 
-        bsize->height = face->accel.fontAscent + face->accel.fontDescent;
+        bsize->height = (FT_Short)( face->accel.fontAscent +
+                                    face->accel.fontDescent );
 
         prop = pcf_find_property( face, "AVERAGE_WIDTH" );
         if ( prop )
           bsize->width = (FT_Short)( ( prop->value.integer + 5 ) / 10 );
         else
-          bsize->width = bsize->height * 2/3;
+          bsize->width = (FT_Short)( bsize->height * 2/3 );
 
         prop = pcf_find_property( face, "POINT_SIZE" );
         if ( prop )
index 8fcf23d..67e6579 100644 (file)
@@ -32,44 +32,6 @@ in this Software without prior written authorization from The Open Group.
 #include "pcfutil.h"
 
 
-  /* Utility functions for reformatting font bitmaps */
-
-  static const unsigned char  _reverse_byte[0x100] =
-  {
-    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-    0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-  };
-
   /*
    *  Invert bit order within each BYTE of an array.
    */
@@ -78,11 +40,17 @@ in this Software without prior written authorization from The Open Group.
   BitOrderInvert( unsigned char*  buf,
                   int             nbytes )
   {
-    const unsigned char*  rev = _reverse_byte;
-
-
     for ( ; --nbytes >= 0; buf++ )
-      *buf = rev[*buf];
+    {
+      unsigned int  val = *buf;
+      
+
+      val = ( ( val >> 1 ) & 0x55 ) | ( ( val << 1 ) & 0xAA );
+      val = ( ( val >> 2 ) & 0x33 ) | ( ( val << 2 ) & 0xCC );
+      val = ( ( val >> 4 ) & 0x0F ) | ( ( val << 4 ) & 0xF0 );
+      
+      *buf = (unsigned char)val;
+    }
   }
 
 
@@ -97,7 +65,7 @@ in this Software without prior written authorization from The Open Group.
     unsigned char  c;
 
 
-    for ( ; nbytes > 0; nbytes -= 2, buf += 2 )
+    for ( ; nbytes >= 2; nbytes -= 2, buf += 2 )
     {
       c      = buf[0];
       buf[0] = buf[1];
@@ -116,7 +84,7 @@ in this Software without prior written authorization from The Open Group.
     unsigned char  c;
 
 
-    for ( ; nbytes > 0; nbytes -= 4, buf += 4 )
+    for ( ; nbytes >= 4; nbytes -= 4, buf += 4 )
     {
       c      = buf[0];
       buf[0] = buf[3];
index 4c38a2d..9e2f2b8 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/pfr Jamfile (c) 2002 David Turner
+# FreeType 2 src/pfr Jamfile
 #
+# Copyright 2002 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) pfr ;
 
index 87ba684..f961582 100644 (file)
     /* initialize glyph loader */
     FT_GlyphLoader_Rewind( glyph->loader );
 
+    glyph->num_subs = 0;
+
     /* load the glyph, recursively when needed */
     return pfr_glyph_load_rec( glyph, stream, gps_offset, offset, size );
   }
index 19ced45..6961dc4 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR loader (body).                                          */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004, 2005 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   }
 
 
- /*
-  *  The kerning data embedded in a PFR font are (charcode,charcode)
-  *  pairs; we need to translate them to (gindex,gindex) and sort
-  *  the resulting array.
-  */
+#ifndef FT_OPTIMIZE_MEMORY
+
+  /*
+   *  The kerning data embedded in a PFR font are (charcode,charcode)
+   *  pairs; we need to translate them to (gindex,gindex) and sort
+   *  the resulting array.
+   */
   static FT_UInt
   pfr_get_gindex( PFR_Char  chars,
                   FT_UInt   count,
     FT_UInt       count;
 
 
-   /* create kerning pairs array
-    */
+    /* create kerning pairs array */
     if ( FT_NEW_ARRAY( phy_font->kern_pairs, phy_font->num_kern_pairs ) )
       goto Exit;
 
-   /* load all kerning items into the array,
-    * converting character codes into glyph indices
-    */
+    /*
+     *  load all kerning items into the array,
+     *  converting character codes into glyph indices
+     */
     pairs = phy_font->kern_pairs;
     item  = phy_font->kern_items;
     count = 0;
         if ( item->flags & PFR_KERN_2BYTE_ADJ )
           kerning = item->base_adj + FT_NEXT_SHORT( p );
         else
-          kerning = item->base_adj + FT_NEXT_CHAR( p );
+          kerning = item->base_adj + FT_NEXT_BYTE( p );
 
         pair->glyph1  = pfr_get_gindex( chars, num_chars, char1 );
         pair->glyph2  = pfr_get_gindex( chars, num_chars, char2 );
       FT_FRAME_EXIT();
     }
 
-   /* sort the resulting array
-    */
+    /* sort the resulting array */
     ft_qsort( pairs, count,
               sizeof ( PFR_KernPairRec ),
               pfr_compare_kern_pairs );
     return error;
   }
 
+#endif /* !FT_OPTIMIZE_MEMORY */
+
 
   static const PFR_ExtraItemRec  pfr_phy_font_extra_items[] =
   {
     FT_FREE( phy_font->blue_values );
     phy_font->num_blue_values = 0;
 
+#ifndef FT_OPTIMIZE_MEMORY
     FT_FREE( phy_font->kern_pairs );
+#endif
+
     {
       PFR_KernItem  item, next;
 
     phy_font->bct_offset = FT_STREAM_POS();
     phy_font->cursor     = NULL;
 
+#ifndef FT_OPTIMIZE_MEMORY
     /* now sort kerning pairs */
     error = pfr_sort_kerning_pairs( stream, phy_font );
+#endif
 
   Exit:
     return error;
index 8b318e9..a4eefb0 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR object methods (body).                                  */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by                                          */
+/*  Copyright 2002, 2003, 2004, 2005 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -48,7 +48,7 @@
     /* we don't want dangling pointers */
     pfrface->family_name = NULL;
     pfrface->style_name  = NULL;
-    
+
     /* finalize the physical font record */
     pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) );
 
         FT_Bitmap_Size*  size;
         PFR_Strike       strike;
         FT_Memory        memory = pfrface->stream->memory;
-         
-         
+
+
         if ( FT_NEW_ARRAY( pfrface->available_sizes, count ) )
           goto Exit;
-         
+
         size   = pfrface->available_sizes;
         strike = phy_font->strikes;
         for ( n = 0; n < count; n++, size++, strike++ )
       metrics->vertBearingX = 0;
       metrics->vertBearingY = 0;
 
+#if 0 /* some fonts seem to be broken here! */
+
       /* Apply the font matrix, if any.                 */
       /* TODO: Test existing fonts with unusual matrix  */
       /* whether we have to adjust Units per EM.        */
 
         FT_Outline_Transform( outline, &font_matrix );
       }
+#endif
 
       /* scale when needed */
       if ( scaling )
   /*************************************************************************/
   /*************************************************************************/
 
+#ifdef FT_OPTIMIZE_MEMORY
+
+  FT_LOCAL_DEF( FT_Error )
+  pfr_face_get_kerning( FT_Face     pfrface,        /* PFR_Face */
+                        FT_UInt     glyph1,
+                        FT_UInt     glyph2,
+                        FT_Vector*  kerning )
+  {
+    PFR_Face     face     = (PFR_Face)pfrface;
+    FT_Error     error    = PFR_Err_Ok;
+    PFR_PhyFont  phy_font = &face->phy_font;
+    FT_UInt32    code1, code2, pair;
+
+
+    kerning->x = 0;
+    kerning->y = 0;
+
+    if ( glyph1 > 0 )
+      glyph1--;
+
+    if ( glyph2 > 0 )
+      glyph2--;
+
+    /* convert glyph indices to character codes */
+    if ( glyph1 > phy_font->num_chars ||
+         glyph2 > phy_font->num_chars )
+      goto Exit;
+
+    code1 = phy_font->chars[glyph1].char_code;
+    code2 = phy_font->chars[glyph2].char_code;
+    pair  = PFR_KERN_INDEX( code1, code2 );
+
+    /* now search the list of kerning items */
+    {
+      PFR_KernItem  item   = phy_font->kern_items;
+      FT_Stream     stream = pfrface->stream;
+
+
+      for ( ; item; item = item->next )
+      {
+        if ( pair >= item->pair1 && pair <= item->pair2 )
+          goto FoundPair;
+      }
+      goto Exit;
+
+    FoundPair: /* we found an item, now parse it and find the value if any */
+      if ( FT_STREAM_SEEK( item->offset )                       ||
+           FT_FRAME_ENTER( item->pair_count * item->pair_size ) )
+        goto Exit;
+
+      {
+        FT_UInt    count    = item->pair_count;
+        FT_UInt    size     = item->pair_size;
+        FT_UInt    power    = (FT_UInt)ft_highpow2( (FT_UInt32)count );
+        FT_UInt    probe    = power * size;
+        FT_UInt    extra    = count - power;
+        FT_Byte*   base     = stream->cursor;
+        FT_Bool    twobytes = item->flags & 1;
+        FT_Byte*   p;
+        FT_UInt32  cpair;
+
+
+        if ( extra > 0 )
+        {
+          p = base + extra * size;
+
+          if ( twobytes )
+            cpair = FT_NEXT_ULONG( p );
+          else
+            cpair = PFR_NEXT_KPAIR( p );
+
+          if ( cpair == pair )
+            goto Found;
+
+          if ( cpair < pair )
+            base = p;
+        }
+
+        while ( probe > size )
+        {
+          probe >>= 1;
+          p       = base + probe;
+
+          if ( twobytes )
+            cpair = FT_NEXT_ULONG( p );
+          else
+            cpair = PFR_NEXT_KPAIR( p );
+
+          if ( cpair == pair )
+            goto Found;
+
+          if ( cpair < pair )
+            base += probe;
+        }
+
+        p = base;
+
+        if ( twobytes )
+          cpair = FT_NEXT_ULONG( p );
+        else
+          cpair = PFR_NEXT_KPAIR( p );
+
+        if ( cpair == pair )
+        {
+          FT_Int  value;
+
+
+        Found:
+          if ( item->flags & 2 )
+            value = FT_PEEK_SHORT( p );
+          else
+            value = p[0];
+
+          kerning->x = item->base_adj + value;
+        }
+      }
+
+      FT_FRAME_EXIT();
+    }
+
+  Exit:
+    return error;
+  }
+
+#else /* !FT_OPTIMIZE_MEMORY */
+
   FT_LOCAL_DEF( FT_Error )
   pfr_face_get_kerning( FT_Face     pfrface,        /* PFR_Face */
                         FT_UInt     glyph1,
 
     min = 0;
     max = phy_font->num_kern_pairs;
-    
+
     while ( min < max )
     {
       FT_UInt       mid  = ( min + max ) >> 1;
       PFR_KernPair  pair = pairs + mid;
       FT_UInt32     pidx = PFR_KERN_PAIR_INDEX( pair );
-      
+
 
       if ( pidx == idx )
       {
         kerning->x = pair->kerning;
         break;
       }
-      
+
       if ( pidx < idx )
         min = mid + 1;
       else
     return error;
   }
 
+#endif /* !FT_OPTIMIZE_MEMORY */
+
 
 /* END */
index a10a2b2..b8bd557 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR data structures (specification only).                   */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2005 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -196,22 +196,27 @@ FT_BEGIN_HEADER
   typedef struct  PFR_KernItemRec_
   {
     PFR_KernItem  next;
-    FT_UInt       pair_count;
+    FT_Byte       pair_count;
+    FT_Byte       flags;
+    FT_Short      base_adj;
     FT_UInt       pair_size;
-    FT_Int        base_adj;
-    FT_UInt       flags;
     FT_UInt32     offset;
     FT_UInt32     pair1;
     FT_UInt32     pair2;
 
   } PFR_KernItemRec;
 
-#define PFR_KERN_INDEX( g1, g2 ) \
-  ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) )
 
-#define PFR_KERN_PAIR_INDEX( pair )  \
+#define PFR_KERN_INDEX( g1, g2 )                          \
+          ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) )
+
+#define PFR_KERN_PAIR_INDEX( pair )                        \
           PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 )
 
+#define PFR_NEXT_KPAIR( p )  ( p += 2,                              \
+                               ( (FT_UInt32)p[-2] << 16 ) | p[-1] )
+
+
   typedef struct  PFR_KernPairRec_
   {
     FT_UInt    glyph1;
@@ -261,7 +266,9 @@ FT_BEGIN_HEADER
     FT_UInt            num_kern_pairs;
     PFR_KernItem       kern_items;
     PFR_KernItem*      kern_items_tail;
+#ifndef FT_OPTIMIZE_MEMORY
     PFR_KernPair       kern_pairs;
+#endif
 
     /* not part of the spec, but used during load */
     FT_UInt32          bct_offset;
index fc834b3..a8c199c 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/psaux Jamfile (c) 2001, 2002 David Turner
+# FreeType 2 src/psaux Jamfile
 #
+# Copyright 2001, 2002 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) psaux ;
 
index d02986c..2480c3f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auxiliary functions for PostScript fonts (body).                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     }
 
     if ( cur < limit && *cur != '>' )
+    {
+      FT_ERROR(( "skip_string: missing closing delimiter `>'\n" ));
       parser->error = PSaux_Err_Invalid_File_Format;
+    }
     else
       cur++;
 
       cur++;
       if ( cur >= limit || *cur != '>' )             /* >> */
       {
+        FT_ERROR(( "ps_parser_skip_PS_token: "
+                   "unexpected closing delimiter `>'\n" ));
         parser->error = PSaux_Err_Invalid_File_Format;
         goto Exit;
       }
 
       if ( *cur == ')' )
       {
+        FT_ERROR(( "ps_parser_skip_PS_token: "
+                   "unexpected closing delimiter `)'\n" ));
         parser->error = PSaux_Err_Invalid_File_Format;
         goto Exit;
       }
     {
       if ( *cur != '<' )
       {
+        FT_ERROR(( "ps_tobytes: Missing starting delimiter `<'\n" ));
         error = PSaux_Err_Invalid_File_Format;
         goto Exit;
       }
     {
       if ( cur < limit && *cur != '>' )
       {
+        FT_ERROR(( "ps_tobytes: Missing closing delimiter `>'\n" ));
         error = PSaux_Err_Invalid_File_Format;
         goto Exit;
       }
index c2adf48..cf4bcc5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript Type 1 decoding routines (body).                          */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
           FT_TRACE4(( " closepath" ));
 
           close_contour( builder );
-          if ( builder->parse_state != T1_Parse_Have_Path )
+          if ( !( builder->parse_state == T1_Parse_Have_Path   ||
+                  builder->parse_state == T1_Parse_Have_Moveto ) )
             goto Syntax_Error;
           builder->parse_state = T1_Parse_Have_Width;
           break;
index ee02a14..769dcc4 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/pshinter Jamfile (c) 2001, 2003 David Turner
+# FreeType 2 src/pshinter Jamfile
 #
+# Copyright 2001, 2003 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) pshinter ;
 
index 5f077d5..8bf9c6a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript hinting algorithm (body).                                 */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004 by                                    */
+/*  Copyright 2001, 2002, 2003, 2004, 2005 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used        */
       scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale );
       fitted = FT_PIX_ROUND( scaled );
 
-      if (scaled != fitted ) {
+      if ( fitted != 0 && scaled != fitted )
+      {
         y_scale = FT_MulDiv( y_scale, fitted, scaled );
 
         if ( fitted < scaled )
index e75ae1e..d85c1e9 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/psnames Jamfile (c) 2001 David Turner
+# FreeType 2 src/psnames Jamfile
 #
+# Copyright 2001 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) psnames ;
 
index f6d6ae3..ba9deae 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PSNames module implementation (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
 
 
-  /* return the Unicode value corresponding to a given glyph.  Note that */
+  /* Return the Unicode value corresponding to a given glyph.  Note that */
   /* we do deal with glyph variants by detecting a non-initial dot in    */
-  /* the name, as in `A.swash' or `e.final', etc.                        */
+  /* the name, as in `A.swash' or `e.final'.                             */
   /*                                                                     */
   static FT_UInt32
   ps_unicode_value( const char*  glyph_name )
   {
-    FT_Int  n;
-    char    first = glyph_name[0];
-    char    temp[64];
-
-
     /* If the name begins with `uni', then the glyph name may be a */
     /* hard-coded unicode character code.                          */
     if ( glyph_name[0] == 'u' &&
     /* look for a non-initial dot in the glyph name in order to */
     /* sort-out variants like `A.swash', `e.final', etc.        */
     {
-      const char*  p;
-      int          len;
-
+      const char*  p   = glyph_name;
+      const char*  dot = NULL;
 
-      p = glyph_name;
 
-      while ( *p && *p != '.' )
-        p++;
-
-      len = (int)( p - glyph_name );
-
-      if ( *p && len < 64 )
+      for ( ; *p; p++ )
       {
-        ft_strncpy( temp, glyph_name, len );
-        temp[len]  = 0;
-        glyph_name = temp;
+        if ( *p == '.' && p > glyph_name && !dot )
+          dot = p;
       }
-    }
-
-    /* now, look up the glyph in the Adobe Glyph List */
-    for ( n = 0; n < NUM_ADOBE_GLYPHS; n++ )
-    {
-      const char*  name = sid_standard_names[n];
 
+      if ( !dot )
+        dot = p;
 
-      if ( first == name[0] && ft_strcmp( glyph_name, name ) == 0 )
-        return ps_names_to_unicode[n];
+      /* now, look up the glyph in the Adobe Glyph List */
+      return ft_get_adobe_glyph_index( glyph_name, dot );
     }
-
-    /* not found, there is probably no Unicode value for this glyph name */
-    return 0;
   }
 
 
   static const char*
   ps_get_macintosh_name( FT_UInt  name_index )
   {
-    if ( name_index >= 258 )
+    if ( name_index >= FT_NUM_MAC_NAMES )
       name_index = 0;
 
-    return ps_glyph_names[mac_standard_names[name_index]];
+    return ft_standard_glyph_names + ft_mac_names[name_index];
   }
 
 
   static const char*
   ps_get_standard_strings( FT_UInt  sid )
   {
-    return ( sid < NUM_SID_GLYPHS ? sid_standard_names[sid] : 0 );
+    if ( sid >= FT_NUM_SID_NAMES )
+      return 0;
+
+    return ft_standard_glyph_names + ft_sid_names[sid];
   }
 
 
index 7c07393..cc40ef7 100644 (file)
@@ -1,10 +1,10 @@
 /***************************************************************************/
 /*                                                                         */
-/*  pstables.h.new                                                         */
+/*  pstables.h                                                             */
 /*                                                                         */
-/*    PostScript glyph names (specification only).                         */
+/*    PostScript glyph names.                                              */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003 by                                           */
+/*  Copyright 2005 by                                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /***************************************************************************/
 
 
-  /* this file has been generated automatically -- do not edit! */
+  /* This file has been generated automatically -- do not edit! */
 
 
-  static const char* const  ps_glyph_names[] =
+  static const char  ft_standard_glyph_names[3696] =
   {
-    ".null",
-    "nonmarkingreturn",
-    ".notdef",
-    "space",
-    "exclam",
-    "quotedbl",
-    "numbersign",
-    "dollar",
-    "percent",
-    "ampersand",
-    "quoteright",
-    "parenleft",
-    "parenright",
-    "asterisk",
-    "plus",
-    "comma",
-    "hyphen",
-    "period",
-    "slash",
-    "zero",
-    "one",
-    "two",
-    "three",
-    "four",
-    "five",
-    "six",
-    "seven",
-    "eight",
-    "nine",
-    "colon",
-    "semicolon",
-    "less",
-    "equal",
-    "greater",
-    "question",
-    "at",
-    "A",
-    "B",
-    "C",
-    "D",
-    "E",
-    "F",
-    "G",
-    "H",
-    "I",
-    "J",
-    "K",
-    "L",
-    "M",
-    "N",
-    "O",
-    "P",
-    "Q",
-    "R",
-    "S",
-    "T",
-    "U",
-    "V",
-    "W",
-    "X",
-    "Y",
-    "Z",
-    "bracketleft",
-    "backslash",
-    "bracketright",
-    "asciicircum",
-    "underscore",
-    "quoteleft",
-    "a",
-    "b",
-    "c",
-    "d",
-    "e",
-    "f",
-    "g",
-    "h",
-    "i",
-    "j",
-    "k",
-    "l",
-    "m",
-    "n",
-    "o",
-    "p",
-    "q",
-    "r",
-    "s",
-    "t",
-    "u",
-    "v",
-    "w",
-    "x",
-    "y",
-    "z",
-    "braceleft",
-    "bar",
-    "braceright",
-    "asciitilde",
-    "exclamdown",
-    "cent",
-    "sterling",
-    "fraction",
-    "yen",
-    "florin",
-    "section",
-    "currency",
-    "quotesingle",
-    "quotedblleft",
-    "guillemotleft",
-    "guilsinglleft",
-    "guilsinglright",
-    "fi",
-    "fl",
-    "endash",
-    "dagger",
-    "daggerdbl",
-    "periodcentered",
-    "paragraph",
-    "bullet",
-    "quotesinglbase",
-    "quotedblbase",
-    "quotedblright",
-    "guillemotright",
-    "ellipsis",
-    "perthousand",
-    "questiondown",
-    "grave",
-    "acute",
-    "circumflex",
-    "tilde",
-    "macron",
-    "breve",
-    "dotaccent",
-    "dieresis",
-    "ring",
-    "cedilla",
-    "hungarumlaut",
-    "ogonek",
-    "caron",
-    "emdash",
-    "AE",
-    "ordfeminine",
-    "Lslash",
-    "Oslash",
-    "OE",
-    "ordmasculine",
-    "ae",
-    "dotlessi",
-    "lslash",
-    "oslash",
-    "oe",
-    "germandbls",
-    "onesuperior",
-    "logicalnot",
-    "mu",
-    "trademark",
-    "Eth",
-    "onehalf",
-    "plusminus",
-    "Thorn",
-    "onequarter",
-    "divide",
-    "brokenbar",
-    "degree",
-    "thorn",
-    "threequarters",
-    "twosuperior",
-    "registered",
-    "minus",
-    "eth",
-    "multiply",
-    "threesuperior",
-    "copyright",
-    "Aacute",
-    "Acircumflex",
-    "Adieresis",
-    "Agrave",
-    "Aring",
-    "Atilde",
-    "Ccedilla",
-    "Eacute",
-    "Ecircumflex",
-    "Edieresis",
-    "Egrave",
-    "Iacute",
-    "Icircumflex",
-    "Idieresis",
-    "Igrave",
-    "Ntilde",
-    "Oacute",
-    "Ocircumflex",
-    "Odieresis",
-    "Ograve",
-    "Otilde",
-    "Scaron",
-    "Uacute",
-    "Ucircumflex",
-    "Udieresis",
-    "Ugrave",
-    "Yacute",
-    "Ydieresis",
-    "Zcaron",
-    "aacute",
-    "acircumflex",
-    "adieresis",
-    "agrave",
-    "aring",
-    "atilde",
-    "ccedilla",
-    "eacute",
-    "ecircumflex",
-    "edieresis",
-    "egrave",
-    "iacute",
-    "icircumflex",
-    "idieresis",
-    "igrave",
-    "ntilde",
-    "oacute",
-    "ocircumflex",
-    "odieresis",
-    "ograve",
-    "otilde",
-    "scaron",
-    "uacute",
-    "ucircumflex",
-    "udieresis",
-    "ugrave",
-    "yacute",
-    "ydieresis",
-    "zcaron",
-    "exclamsmall",
-    "Hungarumlautsmall",
-    "dollaroldstyle",
-    "dollarsuperior",
-    "ampersandsmall",
-    "Acutesmall",
-    "parenleftsuperior",
-    "parenrightsuperior",
-    "twodotenleader",
-    "onedotenleader",
-    "zerooldstyle",
-    "oneoldstyle",
-    "twooldstyle",
-    "threeoldstyle",
-    "fouroldstyle",
-    "fiveoldstyle",
-    "sixoldstyle",
-    "sevenoldstyle",
-    "eightoldstyle",
-    "nineoldstyle",
-    "commasuperior",
-    "threequartersemdash",
-    "periodsuperior",
-    "questionsmall",
-    "asuperior",
-    "bsuperior",
-    "centsuperior",
-    "dsuperior",
-    "esuperior",
-    "isuperior",
-    "lsuperior",
-    "msuperior",
-    "nsuperior",
-    "osuperior",
-    "rsuperior",
-    "ssuperior",
-    "tsuperior",
-    "ff",
-    "ffi",
-    "ffl",
-    "parenleftinferior",
-    "parenrightinferior",
-    "Circumflexsmall",
-    "hyphensuperior",
-    "Gravesmall",
-    "Asmall",
-    "Bsmall",
-    "Csmall",
-    "Dsmall",
-    "Esmall",
-    "Fsmall",
-    "Gsmall",
-    "Hsmall",
-    "Ismall",
-    "Jsmall",
-    "Ksmall",
-    "Lsmall",
-    "Msmall",
-    "Nsmall",
-    "Osmall",
-    "Psmall",
-    "Qsmall",
-    "Rsmall",
-    "Ssmall",
-    "Tsmall",
-    "Usmall",
-    "Vsmall",
-    "Wsmall",
-    "Xsmall",
-    "Ysmall",
-    "Zsmall",
-    "colonmonetary",
-    "onefitted",
-    "rupiah",
-    "Tildesmall",
-    "exclamdownsmall",
-    "centoldstyle",
-    "Lslashsmall",
-    "Scaronsmall",
-    "Zcaronsmall",
-    "Dieresissmall",
-    "Brevesmall",
-    "Caronsmall",
-    "Dotaccentsmall",
-    "Macronsmall",
-    "figuredash",
-    "hypheninferior",
-    "Ogoneksmall",
-    "Ringsmall",
-    "Cedillasmall",
-    "questiondownsmall",
-    "oneeighth",
-    "threeeighths",
-    "fiveeighths",
-    "seveneighths",
-    "onethird",
-    "twothirds",
-    "zerosuperior",
-    "foursuperior",
-    "fivesuperior",
-    "sixsuperior",
-    "sevensuperior",
-    "eightsuperior",
-    "ninesuperior",
-    "zeroinferior",
-    "oneinferior",
-    "twoinferior",
-    "threeinferior",
-    "fourinferior",
-    "fiveinferior",
-    "sixinferior",
-    "seveninferior",
-    "eightinferior",
-    "nineinferior",
-    "centinferior",
-    "dollarinferior",
-    "periodinferior",
-    "commainferior",
-    "Agravesmall",
-    "Aacutesmall",
-    "Acircumflexsmall",
-    "Atildesmall",
-    "Adieresissmall",
-    "Aringsmall",
-    "AEsmall",
-    "Ccedillasmall",
-    "Egravesmall",
-    "Eacutesmall",
-    "Ecircumflexsmall",
-    "Edieresissmall",
-    "Igravesmall",
-    "Iacutesmall",
-    "Icircumflexsmall",
-    "Idieresissmall",
-    "Ethsmall",
-    "Ntildesmall",
-    "Ogravesmall",
-    "Oacutesmall",
-    "Ocircumflexsmall",
-    "Otildesmall",
-    "Odieresissmall",
-    "OEsmall",
-    "Oslashsmall",
-    "Ugravesmall",
-    "Uacutesmall",
-    "Ucircumflexsmall",
-    "Udieresissmall",
-    "Yacutesmall",
-    "Thornsmall",
-    "Ydieresissmall",
-    "001.000",
-    "001.001",
-    "001.002",
-    "001.003",
-    "Black",
-    "Bold",
-    "Book",
-    "Light",
-    "Medium",
-    "Regular",
-    "Roman",
-    "Semibold",
+    '.','n','u','l','l', 0,
+    'n','o','n','m','a','r','k','i','n','g','r','e','t','u','r','n', 0,
+    'n','o','t','e','q','u','a','l', 0,
+    'i','n','f','i','n','i','t','y', 0,
+    'l','e','s','s','e','q','u','a','l', 0,
+    'g','r','e','a','t','e','r','e','q','u','a','l', 0,
+    'p','a','r','t','i','a','l','d','i','f','f', 0,
+    's','u','m','m','a','t','i','o','n', 0,
+    'p','r','o','d','u','c','t', 0,
+    'p','i', 0,
+    'i','n','t','e','g','r','a','l', 0,
+    'O','m','e','g','a', 0,
+    'r','a','d','i','c','a','l', 0,
+    'a','p','p','r','o','x','e','q','u','a','l', 0,
+    'D','e','l','t','a', 0,
+    'n','o','n','b','r','e','a','k','i','n','g','s','p','a','c','e', 0,
+    'l','o','z','e','n','g','e', 0,
+    'a','p','p','l','e', 0,
+    'f','r','a','n','c', 0,
+    'G','b','r','e','v','e', 0,
+    'g','b','r','e','v','e', 0,
+    'I','d','o','t','a','c','c','e','n','t', 0,
+    'S','c','e','d','i','l','l','a', 0,
+    's','c','e','d','i','l','l','a', 0,
+    'C','a','c','u','t','e', 0,
+    'c','a','c','u','t','e', 0,
+    'C','c','a','r','o','n', 0,
+    'c','c','a','r','o','n', 0,
+    'd','c','r','o','a','t', 0,
+    '.','n','o','t','d','e','f', 0,
+    's','p','a','c','e', 0,
+    'e','x','c','l','a','m', 0,
+    'q','u','o','t','e','d','b','l', 0,
+    'n','u','m','b','e','r','s','i','g','n', 0,
+    'd','o','l','l','a','r', 0,
+    'p','e','r','c','e','n','t', 0,
+    'a','m','p','e','r','s','a','n','d', 0,
+    'q','u','o','t','e','r','i','g','h','t', 0,
+    'p','a','r','e','n','l','e','f','t', 0,
+    'p','a','r','e','n','r','i','g','h','t', 0,
+    'a','s','t','e','r','i','s','k', 0,
+    'p','l','u','s', 0,
+    'c','o','m','m','a', 0,
+    'h','y','p','h','e','n', 0,
+    'p','e','r','i','o','d', 0,
+    's','l','a','s','h', 0,
+    'z','e','r','o', 0,
+    'o','n','e', 0,
+    't','w','o', 0,
+    't','h','r','e','e', 0,
+    'f','o','u','r', 0,
+    'f','i','v','e', 0,
+    's','i','x', 0,
+    's','e','v','e','n', 0,
+    'e','i','g','h','t', 0,
+    'n','i','n','e', 0,
+    'c','o','l','o','n', 0,
+    's','e','m','i','c','o','l','o','n', 0,
+    'l','e','s','s', 0,
+    'e','q','u','a','l', 0,
+    'g','r','e','a','t','e','r', 0,
+    'q','u','e','s','t','i','o','n', 0,
+    'a','t', 0,
+    'A', 0,
+    'B', 0,
+    'C', 0,
+    'D', 0,
+    'E', 0,
+    'F', 0,
+    'G', 0,
+    'H', 0,
+    'I', 0,
+    'J', 0,
+    'K', 0,
+    'L', 0,
+    'M', 0,
+    'N', 0,
+    'O', 0,
+    'P', 0,
+    'Q', 0,
+    'R', 0,
+    'S', 0,
+    'T', 0,
+    'U', 0,
+    'V', 0,
+    'W', 0,
+    'X', 0,
+    'Y', 0,
+    'Z', 0,
+    'b','r','a','c','k','e','t','l','e','f','t', 0,
+    'b','a','c','k','s','l','a','s','h', 0,
+    'b','r','a','c','k','e','t','r','i','g','h','t', 0,
+    'a','s','c','i','i','c','i','r','c','u','m', 0,
+    'u','n','d','e','r','s','c','o','r','e', 0,
+    'q','u','o','t','e','l','e','f','t', 0,
+    'a', 0,
+    'b', 0,
+    'c', 0,
+    'd', 0,
+    'e', 0,
+    'f', 0,
+    'g', 0,
+    'h', 0,
+    'i', 0,
+    'j', 0,
+    'k', 0,
+    'l', 0,
+    'm', 0,
+    'n', 0,
+    'o', 0,
+    'p', 0,
+    'q', 0,
+    'r', 0,
+    's', 0,
+    't', 0,
+    'u', 0,
+    'v', 0,
+    'w', 0,
+    'x', 0,
+    'y', 0,
+    'z', 0,
+    'b','r','a','c','e','l','e','f','t', 0,
+    'b','a','r', 0,
+    'b','r','a','c','e','r','i','g','h','t', 0,
+    'a','s','c','i','i','t','i','l','d','e', 0,
+    'e','x','c','l','a','m','d','o','w','n', 0,
+    'c','e','n','t', 0,
+    's','t','e','r','l','i','n','g', 0,
+    'f','r','a','c','t','i','o','n', 0,
+    'y','e','n', 0,
+    'f','l','o','r','i','n', 0,
+    's','e','c','t','i','o','n', 0,
+    'c','u','r','r','e','n','c','y', 0,
+    'q','u','o','t','e','s','i','n','g','l','e', 0,
+    'q','u','o','t','e','d','b','l','l','e','f','t', 0,
+    'g','u','i','l','l','e','m','o','t','l','e','f','t', 0,
+    'g','u','i','l','s','i','n','g','l','l','e','f','t', 0,
+    'g','u','i','l','s','i','n','g','l','r','i','g','h','t', 0,
+    'f','i', 0,
+    'f','l', 0,
+    'e','n','d','a','s','h', 0,
+    'd','a','g','g','e','r', 0,
+    'd','a','g','g','e','r','d','b','l', 0,
+    'p','e','r','i','o','d','c','e','n','t','e','r','e','d', 0,
+    'p','a','r','a','g','r','a','p','h', 0,
+    'b','u','l','l','e','t', 0,
+    'q','u','o','t','e','s','i','n','g','l','b','a','s','e', 0,
+    'q','u','o','t','e','d','b','l','b','a','s','e', 0,
+    'q','u','o','t','e','d','b','l','r','i','g','h','t', 0,
+    'g','u','i','l','l','e','m','o','t','r','i','g','h','t', 0,
+    'e','l','l','i','p','s','i','s', 0,
+    'p','e','r','t','h','o','u','s','a','n','d', 0,
+    'q','u','e','s','t','i','o','n','d','o','w','n', 0,
+    'g','r','a','v','e', 0,
+    'a','c','u','t','e', 0,
+    'c','i','r','c','u','m','f','l','e','x', 0,
+    't','i','l','d','e', 0,
+    'm','a','c','r','o','n', 0,
+    'b','r','e','v','e', 0,
+    'd','o','t','a','c','c','e','n','t', 0,
+    'd','i','e','r','e','s','i','s', 0,
+    'r','i','n','g', 0,
+    'c','e','d','i','l','l','a', 0,
+    'h','u','n','g','a','r','u','m','l','a','u','t', 0,
+    'o','g','o','n','e','k', 0,
+    'c','a','r','o','n', 0,
+    'e','m','d','a','s','h', 0,
+    'A','E', 0,
+    'o','r','d','f','e','m','i','n','i','n','e', 0,
+    'L','s','l','a','s','h', 0,
+    'O','s','l','a','s','h', 0,
+    'O','E', 0,
+    'o','r','d','m','a','s','c','u','l','i','n','e', 0,
+    'a','e', 0,
+    'd','o','t','l','e','s','s','i', 0,
+    'l','s','l','a','s','h', 0,
+    'o','s','l','a','s','h', 0,
+    'o','e', 0,
+    'g','e','r','m','a','n','d','b','l','s', 0,
+    'o','n','e','s','u','p','e','r','i','o','r', 0,
+    'l','o','g','i','c','a','l','n','o','t', 0,
+    'm','u', 0,
+    't','r','a','d','e','m','a','r','k', 0,
+    'E','t','h', 0,
+    'o','n','e','h','a','l','f', 0,
+    'p','l','u','s','m','i','n','u','s', 0,
+    'T','h','o','r','n', 0,
+    'o','n','e','q','u','a','r','t','e','r', 0,
+    'd','i','v','i','d','e', 0,
+    'b','r','o','k','e','n','b','a','r', 0,
+    'd','e','g','r','e','e', 0,
+    't','h','o','r','n', 0,
+    't','h','r','e','e','q','u','a','r','t','e','r','s', 0,
+    't','w','o','s','u','p','e','r','i','o','r', 0,
+    'r','e','g','i','s','t','e','r','e','d', 0,
+    'm','i','n','u','s', 0,
+    'e','t','h', 0,
+    'm','u','l','t','i','p','l','y', 0,
+    't','h','r','e','e','s','u','p','e','r','i','o','r', 0,
+    'c','o','p','y','r','i','g','h','t', 0,
+    'A','a','c','u','t','e', 0,
+    'A','c','i','r','c','u','m','f','l','e','x', 0,
+    'A','d','i','e','r','e','s','i','s', 0,
+    'A','g','r','a','v','e', 0,
+    'A','r','i','n','g', 0,
+    'A','t','i','l','d','e', 0,
+    'C','c','e','d','i','l','l','a', 0,
+    'E','a','c','u','t','e', 0,
+    'E','c','i','r','c','u','m','f','l','e','x', 0,
+    'E','d','i','e','r','e','s','i','s', 0,
+    'E','g','r','a','v','e', 0,
+    'I','a','c','u','t','e', 0,
+    'I','c','i','r','c','u','m','f','l','e','x', 0,
+    'I','d','i','e','r','e','s','i','s', 0,
+    'I','g','r','a','v','e', 0,
+    'N','t','i','l','d','e', 0,
+    'O','a','c','u','t','e', 0,
+    'O','c','i','r','c','u','m','f','l','e','x', 0,
+    'O','d','i','e','r','e','s','i','s', 0,
+    'O','g','r','a','v','e', 0,
+    'O','t','i','l','d','e', 0,
+    'S','c','a','r','o','n', 0,
+    'U','a','c','u','t','e', 0,
+    'U','c','i','r','c','u','m','f','l','e','x', 0,
+    'U','d','i','e','r','e','s','i','s', 0,
+    'U','g','r','a','v','e', 0,
+    'Y','a','c','u','t','e', 0,
+    'Y','d','i','e','r','e','s','i','s', 0,
+    'Z','c','a','r','o','n', 0,
+    'a','a','c','u','t','e', 0,
+    'a','c','i','r','c','u','m','f','l','e','x', 0,
+    'a','d','i','e','r','e','s','i','s', 0,
+    'a','g','r','a','v','e', 0,
+    'a','r','i','n','g', 0,
+    'a','t','i','l','d','e', 0,
+    'c','c','e','d','i','l','l','a', 0,
+    'e','a','c','u','t','e', 0,
+    'e','c','i','r','c','u','m','f','l','e','x', 0,
+    'e','d','i','e','r','e','s','i','s', 0,
+    'e','g','r','a','v','e', 0,
+    'i','a','c','u','t','e', 0,
+    'i','c','i','r','c','u','m','f','l','e','x', 0,
+    'i','d','i','e','r','e','s','i','s', 0,
+    'i','g','r','a','v','e', 0,
+    'n','t','i','l','d','e', 0,
+    'o','a','c','u','t','e', 0,
+    'o','c','i','r','c','u','m','f','l','e','x', 0,
+    'o','d','i','e','r','e','s','i','s', 0,
+    'o','g','r','a','v','e', 0,
+    'o','t','i','l','d','e', 0,
+    's','c','a','r','o','n', 0,
+    'u','a','c','u','t','e', 0,
+    'u','c','i','r','c','u','m','f','l','e','x', 0,
+    'u','d','i','e','r','e','s','i','s', 0,
+    'u','g','r','a','v','e', 0,
+    'y','a','c','u','t','e', 0,
+    'y','d','i','e','r','e','s','i','s', 0,
+    'z','c','a','r','o','n', 0,
+    'e','x','c','l','a','m','s','m','a','l','l', 0,
+    'H','u','n','g','a','r','u','m','l','a','u','t','s','m','a','l','l', 0,
+    'd','o','l','l','a','r','o','l','d','s','t','y','l','e', 0,
+    'd','o','l','l','a','r','s','u','p','e','r','i','o','r', 0,
+    'a','m','p','e','r','s','a','n','d','s','m','a','l','l', 0,
+    'A','c','u','t','e','s','m','a','l','l', 0,
+    'p','a','r','e','n','l','e','f','t','s','u','p','e','r','i','o','r', 0,
+    'p','a','r','e','n','r','i','g','h','t','s','u','p','e','r','i','o','r', 0,
+    't','w','o','d','o','t','e','n','l','e','a','d','e','r', 0,
+    'o','n','e','d','o','t','e','n','l','e','a','d','e','r', 0,
+    'z','e','r','o','o','l','d','s','t','y','l','e', 0,
+    'o','n','e','o','l','d','s','t','y','l','e', 0,
+    't','w','o','o','l','d','s','t','y','l','e', 0,
+    't','h','r','e','e','o','l','d','s','t','y','l','e', 0,
+    'f','o','u','r','o','l','d','s','t','y','l','e', 0,
+    'f','i','v','e','o','l','d','s','t','y','l','e', 0,
+    's','i','x','o','l','d','s','t','y','l','e', 0,
+    's','e','v','e','n','o','l','d','s','t','y','l','e', 0,
+    'e','i','g','h','t','o','l','d','s','t','y','l','e', 0,
+    'n','i','n','e','o','l','d','s','t','y','l','e', 0,
+    'c','o','m','m','a','s','u','p','e','r','i','o','r', 0,
+    't','h','r','e','e','q','u','a','r','t','e','r','s','e','m','d','a','s','h', 0,
+    'p','e','r','i','o','d','s','u','p','e','r','i','o','r', 0,
+    'q','u','e','s','t','i','o','n','s','m','a','l','l', 0,
+    'a','s','u','p','e','r','i','o','r', 0,
+    'b','s','u','p','e','r','i','o','r', 0,
+    'c','e','n','t','s','u','p','e','r','i','o','r', 0,
+    'd','s','u','p','e','r','i','o','r', 0,
+    'e','s','u','p','e','r','i','o','r', 0,
+    'i','s','u','p','e','r','i','o','r', 0,
+    'l','s','u','p','e','r','i','o','r', 0,
+    'm','s','u','p','e','r','i','o','r', 0,
+    'n','s','u','p','e','r','i','o','r', 0,
+    'o','s','u','p','e','r','i','o','r', 0,
+    'r','s','u','p','e','r','i','o','r', 0,
+    's','s','u','p','e','r','i','o','r', 0,
+    't','s','u','p','e','r','i','o','r', 0,
+    'f','f', 0,
+    'f','f','i', 0,
+    'f','f','l', 0,
+    'p','a','r','e','n','l','e','f','t','i','n','f','e','r','i','o','r', 0,
+    'p','a','r','e','n','r','i','g','h','t','i','n','f','e','r','i','o','r', 0,
+    'C','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,
+    'h','y','p','h','e','n','s','u','p','e','r','i','o','r', 0,
+    'G','r','a','v','e','s','m','a','l','l', 0,
+    'A','s','m','a','l','l', 0,
+    'B','s','m','a','l','l', 0,
+    'C','s','m','a','l','l', 0,
+    'D','s','m','a','l','l', 0,
+    'E','s','m','a','l','l', 0,
+    'F','s','m','a','l','l', 0,
+    'G','s','m','a','l','l', 0,
+    'H','s','m','a','l','l', 0,
+    'I','s','m','a','l','l', 0,
+    'J','s','m','a','l','l', 0,
+    'K','s','m','a','l','l', 0,
+    'L','s','m','a','l','l', 0,
+    'M','s','m','a','l','l', 0,
+    'N','s','m','a','l','l', 0,
+    'O','s','m','a','l','l', 0,
+    'P','s','m','a','l','l', 0,
+    'Q','s','m','a','l','l', 0,
+    'R','s','m','a','l','l', 0,
+    'S','s','m','a','l','l', 0,
+    'T','s','m','a','l','l', 0,
+    'U','s','m','a','l','l', 0,
+    'V','s','m','a','l','l', 0,
+    'W','s','m','a','l','l', 0,
+    'X','s','m','a','l','l', 0,
+    'Y','s','m','a','l','l', 0,
+    'Z','s','m','a','l','l', 0,
+    'c','o','l','o','n','m','o','n','e','t','a','r','y', 0,
+    'o','n','e','f','i','t','t','e','d', 0,
+    'r','u','p','i','a','h', 0,
+    'T','i','l','d','e','s','m','a','l','l', 0,
+    'e','x','c','l','a','m','d','o','w','n','s','m','a','l','l', 0,
+    'c','e','n','t','o','l','d','s','t','y','l','e', 0,
+    'L','s','l','a','s','h','s','m','a','l','l', 0,
+    'S','c','a','r','o','n','s','m','a','l','l', 0,
+    'Z','c','a','r','o','n','s','m','a','l','l', 0,
+    'D','i','e','r','e','s','i','s','s','m','a','l','l', 0,
+    'B','r','e','v','e','s','m','a','l','l', 0,
+    'C','a','r','o','n','s','m','a','l','l', 0,
+    'D','o','t','a','c','c','e','n','t','s','m','a','l','l', 0,
+    'M','a','c','r','o','n','s','m','a','l','l', 0,
+    'f','i','g','u','r','e','d','a','s','h', 0,
+    'h','y','p','h','e','n','i','n','f','e','r','i','o','r', 0,
+    'O','g','o','n','e','k','s','m','a','l','l', 0,
+    'R','i','n','g','s','m','a','l','l', 0,
+    'C','e','d','i','l','l','a','s','m','a','l','l', 0,
+    'q','u','e','s','t','i','o','n','d','o','w','n','s','m','a','l','l', 0,
+    'o','n','e','e','i','g','h','t','h', 0,
+    't','h','r','e','e','e','i','g','h','t','h','s', 0,
+    'f','i','v','e','e','i','g','h','t','h','s', 0,
+    's','e','v','e','n','e','i','g','h','t','h','s', 0,
+    'o','n','e','t','h','i','r','d', 0,
+    't','w','o','t','h','i','r','d','s', 0,
+    'z','e','r','o','s','u','p','e','r','i','o','r', 0,
+    'f','o','u','r','s','u','p','e','r','i','o','r', 0,
+    'f','i','v','e','s','u','p','e','r','i','o','r', 0,
+    's','i','x','s','u','p','e','r','i','o','r', 0,
+    's','e','v','e','n','s','u','p','e','r','i','o','r', 0,
+    'e','i','g','h','t','s','u','p','e','r','i','o','r', 0,
+    'n','i','n','e','s','u','p','e','r','i','o','r', 0,
+    'z','e','r','o','i','n','f','e','r','i','o','r', 0,
+    'o','n','e','i','n','f','e','r','i','o','r', 0,
+    't','w','o','i','n','f','e','r','i','o','r', 0,
+    't','h','r','e','e','i','n','f','e','r','i','o','r', 0,
+    'f','o','u','r','i','n','f','e','r','i','o','r', 0,
+    'f','i','v','e','i','n','f','e','r','i','o','r', 0,
+    's','i','x','i','n','f','e','r','i','o','r', 0,
+    's','e','v','e','n','i','n','f','e','r','i','o','r', 0,
+    'e','i','g','h','t','i','n','f','e','r','i','o','r', 0,
+    'n','i','n','e','i','n','f','e','r','i','o','r', 0,
+    'c','e','n','t','i','n','f','e','r','i','o','r', 0,
+    'd','o','l','l','a','r','i','n','f','e','r','i','o','r', 0,
+    'p','e','r','i','o','d','i','n','f','e','r','i','o','r', 0,
+    'c','o','m','m','a','i','n','f','e','r','i','o','r', 0,
+    'A','g','r','a','v','e','s','m','a','l','l', 0,
+    'A','a','c','u','t','e','s','m','a','l','l', 0,
+    'A','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,
+    'A','t','i','l','d','e','s','m','a','l','l', 0,
+    'A','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,
+    'A','r','i','n','g','s','m','a','l','l', 0,
+    'A','E','s','m','a','l','l', 0,
+    'C','c','e','d','i','l','l','a','s','m','a','l','l', 0,
+    'E','g','r','a','v','e','s','m','a','l','l', 0,
+    'E','a','c','u','t','e','s','m','a','l','l', 0,
+    'E','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,
+    'E','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,
+    'I','g','r','a','v','e','s','m','a','l','l', 0,
+    'I','a','c','u','t','e','s','m','a','l','l', 0,
+    'I','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,
+    'I','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,
+    'E','t','h','s','m','a','l','l', 0,
+    'N','t','i','l','d','e','s','m','a','l','l', 0,
+    'O','g','r','a','v','e','s','m','a','l','l', 0,
+    'O','a','c','u','t','e','s','m','a','l','l', 0,
+    'O','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,
+    'O','t','i','l','d','e','s','m','a','l','l', 0,
+    'O','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,
+    'O','E','s','m','a','l','l', 0,
+    'O','s','l','a','s','h','s','m','a','l','l', 0,
+    'U','g','r','a','v','e','s','m','a','l','l', 0,
+    'U','a','c','u','t','e','s','m','a','l','l', 0,
+    'U','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,
+    'U','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,
+    'Y','a','c','u','t','e','s','m','a','l','l', 0,
+    'T','h','o','r','n','s','m','a','l','l', 0,
+    'Y','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,
+    '0','0','1','.','0','0','0', 0,
+    '0','0','1','.','0','0','1', 0,
+    '0','0','1','.','0','0','2', 0,
+    '0','0','1','.','0','0','3', 0,
+    'B','l','a','c','k', 0,
+    'B','o','l','d', 0,
+    'B','o','o','k', 0,
+    'L','i','g','h','t', 0,
+    'M','e','d','i','u','m', 0,
+    'R','e','g','u','l','a','r', 0,
+    'R','o','m','a','n', 0,
+    'S','e','m','i','b','o','l','d', 0,
+  };
 
-#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
 
-    "AEacute",
-    "AEmacron",
-    "Abreve",
-    "Abreveacute",
-    "Abrevecyrillic",
-    "Abrevedotbelow",
-    "Abrevegrave",
-    "Abrevehookabove",
-    "Abrevetilde",
-    "Acaron",
-    "Acircle",
-    "Acircumflexacute",
-    "Acircumflexdotbelow",
-    "Acircumflexgrave",
-    "Acircumflexhookabove",
-    "Acircumflextilde",
-    "Acute",
-    "Acyrillic",
-    "Adblgrave",
-    "Adieresiscyrillic",
-    "Adieresismacron",
-    "Adotbelow",
-    "Adotmacron",
-    "Ahookabove",
-    "Aiecyrillic",
-    "Ainvertedbreve",
-    "Alpha",
-    "Alphatonos",
-    "Amacron",
-    "Amonospace",
-    "Aogonek",
-    "Aringacute",
-    "Aringbelow",
-    "Aybarmenian",
-    "Bcircle",
-    "Bdotaccent",
-    "Bdotbelow",
-    "Becyrillic",
-    "Benarmenian",
-    "Beta",
-    "Bhook",
-    "Blinebelow",
-    "Bmonospace",
-    "Btopbar",
-    "Caarmenian",
-    "Cacute",
-    "Caron",
-    "Ccaron",
-    "Ccedillaacute",
-    "Ccircle",
-    "Ccircumflex",
-    "Cdot",
-    "Cdotaccent",
-    "Chaarmenian",
-    "Cheabkhasiancyrillic",
-    "Checyrillic",
-    "Chedescenderabkhasiancyrillic",
-    "Chedescendercyrillic",
-    "Chedieresiscyrillic",
-    "Cheharmenian",
-    "Chekhakassiancyrillic",
-    "Cheverticalstrokecyrillic",
-    "Chi",
-    "Chook",
-    "Cmonospace",
-    "Coarmenian",
-    "DZ",
-    "DZcaron",
-    "Daarmenian",
-    "Dafrican",
-    "Dcaron",
-    "Dcedilla",
-    "Dcircle",
-    "Dcircumflexbelow",
-    "Dcroat",
-    "Ddotaccent",
-    "Ddotbelow",
-    "Decyrillic",
-    "Deicoptic",
-    "Delta",
-    "Deltagreek",
-    "Dhook",
-    "Dieresis",
-    "DieresisAcute",
-    "DieresisGrave",
-    "Digammagreek",
-    "Djecyrillic",
-    "Dlinebelow",
-    "Dmonospace",
-    "Dslash",
-    "Dtopbar",
-    "Dz",
-    "Dzcaron",
-    "Dzeabkhasiancyrillic",
-    "Dzecyrillic",
-    "Dzhecyrillic",
-    "Ebreve",
-    "Ecaron",
-    "Ecedillabreve",
-    "Echarmenian",
-    "Ecircle",
-    "Ecircumflexacute",
-    "Ecircumflexbelow",
-    "Ecircumflexdotbelow",
-    "Ecircumflexgrave",
-    "Ecircumflexhookabove",
-    "Ecircumflextilde",
-    "Ecyrillic",
-    "Edblgrave",
-    "Edot",
-    "Edotaccent",
-    "Edotbelow",
-    "Efcyrillic",
-    "Eharmenian",
-    "Ehookabove",
-    "Eightroman",
-    "Einvertedbreve",
-    "Eiotifiedcyrillic",
-    "Elcyrillic",
-    "Elevenroman",
-    "Emacron",
-    "Emacronacute",
-    "Emacrongrave",
-    "Emcyrillic",
-    "Emonospace",
-    "Encyrillic",
-    "Endescendercyrillic",
-    "Eng",
-    "Enghecyrillic",
-    "Enhookcyrillic",
-    "Eogonek",
-    "Eopen",
-    "Epsilon",
-    "Epsilontonos",
-    "Ercyrillic",
-    "Ereversed",
-    "Ereversedcyrillic",
-    "Escyrillic",
-    "Esdescendercyrillic",
-    "Esh",
-    "Eta",
-    "Etarmenian",
-    "Etatonos",
-    "Etilde",
-    "Etildebelow",
-    "Euro",
-    "Ezh",
-    "Ezhcaron",
-    "Ezhreversed",
-    "Fcircle",
-    "Fdotaccent",
-    "Feharmenian",
-    "Feicoptic",
-    "Fhook",
-    "Fitacyrillic",
-    "Fiveroman",
-    "Fmonospace",
-    "Fourroman",
-    "GBsquare",
-    "Gacute",
-    "Gamma",
-    "Gammaafrican",
-    "Gangiacoptic",
-    "Gbreve",
-    "Gcaron",
-    "Gcedilla",
-    "Gcircle",
-    "Gcircumflex",
-    "Gcommaaccent",
-    "Gdot",
-    "Gdotaccent",
-    "Gecyrillic",
-    "Ghadarmenian",
-    "Ghemiddlehookcyrillic",
-    "Ghestrokecyrillic",
-    "Gheupturncyrillic",
-    "Ghook",
-    "Gimarmenian",
-    "Gjecyrillic",
-    "Gmacron",
-    "Gmonospace",
-    "Grave",
-    "Gsmallhook",
-    "Gstroke",
-    "H18533",
-    "H18543",
-    "H18551",
-    "H22073",
-    "HPsquare",
-    "Haabkhasiancyrillic",
-    "Hadescendercyrillic",
-    "Hardsigncyrillic",
-    "Hbar",
-    "Hbrevebelow",
-    "Hcedilla",
-    "Hcircle",
-    "Hcircumflex",
-    "Hdieresis",
-    "Hdotaccent",
-    "Hdotbelow",
-    "Hmonospace",
-    "Hoarmenian",
-    "Horicoptic",
-    "Hungarumlaut",
-    "Hzsquare",
-    "IAcyrillic",
-    "IJ",
-    "IUcyrillic",
-    "Ibreve",
-    "Icaron",
-    "Icircle",
-    "Icyrillic",
-    "Idblgrave",
-    "Idieresisacute",
-    "Idieresiscyrillic",
-    "Idot",
-    "Idotaccent",
-    "Idotbelow",
-    "Iebrevecyrillic",
-    "Iecyrillic",
-    "Ifraktur",
-    "Ihookabove",
-    "Iicyrillic",
-    "Iinvertedbreve",
-    "Iishortcyrillic",
-    "Imacron",
-    "Imacroncyrillic",
-    "Imonospace",
-    "Iniarmenian",
-    "Iocyrillic",
-    "Iogonek",
-    "Iota",
-    "Iotaafrican",
-    "Iotadieresis",
-    "Iotatonos",
-    "Istroke",
-    "Itilde",
-    "Itildebelow",
-    "Izhitsacyrillic",
-    "Izhitsadblgravecyrillic",
-    "Jaarmenian",
-    "Jcircle",
-    "Jcircumflex",
-    "Jecyrillic",
-    "Jheharmenian",
-    "Jmonospace",
-    "KBsquare",
-    "KKsquare",
-    "Kabashkircyrillic",
-    "Kacute",
-    "Kacyrillic",
-    "Kadescendercyrillic",
-    "Kahookcyrillic",
-    "Kappa",
-    "Kastrokecyrillic",
-    "Kaverticalstrokecyrillic",
-    "Kcaron",
-    "Kcedilla",
-    "Kcircle",
-    "Kcommaaccent",
-    "Kdotbelow",
-    "Keharmenian",
-    "Kenarmenian",
-    "Khacyrillic",
-    "Kheicoptic",
-    "Khook",
-    "Kjecyrillic",
-    "Klinebelow",
-    "Kmonospace",
-    "Koppacyrillic",
-    "Koppagreek",
-    "Ksicyrillic",
-    "LJ",
-    "LL",
-    "Lacute",
-    "Lambda",
-    "Lcaron",
-    "Lcedilla",
-    "Lcircle",
-    "Lcircumflexbelow",
-    "Lcommaaccent",
-    "Ldot",
-    "Ldotaccent",
-    "Ldotbelow",
-    "Ldotbelowmacron",
-    "Liwnarmenian",
-    "Lj",
-    "Ljecyrillic",
-    "Llinebelow",
-    "Lmonospace",
-    "MBsquare",
-    "Macron",
-    "Macute",
-    "Mcircle",
-    "Mdotaccent",
-    "Mdotbelow",
-    "Menarmenian",
-    "Mmonospace",
-    "Mturned",
-    "Mu",
-    "NJ",
-    "Nacute",
-    "Ncaron",
-    "Ncedilla",
-    "Ncircle",
-    "Ncircumflexbelow",
-    "Ncommaaccent",
-    "Ndotaccent",
-    "Ndotbelow",
-    "Nhookleft",
-    "Nineroman",
-    "Nj",
-    "Njecyrillic",
-    "Nlinebelow",
-    "Nmonospace",
-    "Nowarmenian",
-    "Nu",
-    "Obarredcyrillic",
-    "Obarreddieresiscyrillic",
-    "Obreve",
-    "Ocaron",
-    "Ocenteredtilde",
-    "Ocircle",
-    "Ocircumflexacute",
-    "Ocircumflexdotbelow",
-    "Ocircumflexgrave",
-    "Ocircumflexhookabove",
-    "Ocircumflextilde",
-    "Ocyrillic",
-    "Odblacute",
-    "Odblgrave",
-    "Odieresiscyrillic",
-    "Odotbelow",
-    "Oharmenian",
-    "Ohm",
-    "Ohookabove",
-    "Ohorn",
-    "Ohornacute",
-    "Ohorndotbelow",
-    "Ohorngrave",
-    "Ohornhookabove",
-    "Ohorntilde",
-    "Ohungarumlaut",
-    "Oi",
-    "Oinvertedbreve",
-    "Omacron",
-    "Omacronacute",
-    "Omacrongrave",
-    "Omega",
-    "Omegacyrillic",
-    "Omegagreek",
-    "Omegaroundcyrillic",
-    "Omegatitlocyrillic",
-    "Omegatonos",
-    "Omicron",
-    "Omicrontonos",
-    "Omonospace",
-    "Oneroman",
-    "Oogonek",
-    "Oogonekmacron",
-    "Oopen",
-    "Oslashacute",
-    "Ostrokeacute",
-    "Otcyrillic",
-    "Otildeacute",
-    "Otildedieresis",
-    "Pacute",
-    "Pcircle",
-    "Pdotaccent",
-    "Pecyrillic",
-    "Peharmenian",
-    "Pemiddlehookcyrillic",
-    "Phi",
-    "Phook",
-    "Pi",
-    "Piwrarmenian",
-    "Pmonospace",
-    "Psi",
-    "Psicyrillic",
-    "Qcircle",
-    "Qmonospace",
-    "Raarmenian",
-    "Racute",
-    "Rcaron",
-    "Rcedilla",
-    "Rcircle",
-    "Rcommaaccent",
-    "Rdblgrave",
-    "Rdotaccent",
-    "Rdotbelow",
-    "Rdotbelowmacron",
-    "Reharmenian",
-    "Rfraktur",
-    "Rho",
-    "Rinvertedbreve",
-    "Rlinebelow",
-    "Rmonospace",
-    "Rsmallinverted",
-    "Rsmallinvertedsuperior",
-    "SF010000",
-    "SF020000",
-    "SF030000",
-    "SF040000",
-    "SF050000",
-    "SF060000",
-    "SF070000",
-    "SF080000",
-    "SF090000",
-    "SF100000",
-    "SF110000",
-    "SF190000",
-    "SF200000",
-    "SF210000",
-    "SF220000",
-    "SF230000",
-    "SF240000",
-    "SF250000",
-    "SF260000",
-    "SF270000",
-    "SF280000",
-    "SF360000",
-    "SF370000",
-    "SF380000",
-    "SF390000",
-    "SF400000",
-    "SF410000",
-    "SF420000",
-    "SF430000",
-    "SF440000",
-    "SF450000",
-    "SF460000",
-    "SF470000",
-    "SF480000",
-    "SF490000",
-    "SF500000",
-    "SF510000",
-    "SF520000",
-    "SF530000",
-    "SF540000",
-    "Sacute",
-    "Sacutedotaccent",
-    "Sampigreek",
-    "Scarondotaccent",
-    "Scedilla",
-    "Schwa",
-    "Schwacyrillic",
-    "Schwadieresiscyrillic",
-    "Scircle",
-    "Scircumflex",
-    "Scommaaccent",
-    "Sdotaccent",
-    "Sdotbelow",
-    "Sdotbelowdotaccent",
-    "Seharmenian",
-    "Sevenroman",
-    "Shaarmenian",
-    "Shacyrillic",
-    "Shchacyrillic",
-    "Sheicoptic",
-    "Shhacyrillic",
-    "Shimacoptic",
-    "Sigma",
-    "Sixroman",
-    "Smonospace",
-    "Softsigncyrillic",
-    "Stigmagreek",
-    "Tau",
-    "Tbar",
-    "Tcaron",
-    "Tcedilla",
-    "Tcircle",
-    "Tcircumflexbelow",
-    "Tcommaaccent",
-    "Tdotaccent",
-    "Tdotbelow",
-    "Tecyrillic",
-    "Tedescendercyrillic",
-    "Tenroman",
-    "Tetsecyrillic",
-    "Theta",
-    "Thook",
-    "Threeroman",
-    "Tiwnarmenian",
-    "Tlinebelow",
-    "Tmonospace",
-    "Toarmenian",
-    "Tonefive",
-    "Tonesix",
-    "Tonetwo",
-    "Tretroflexhook",
-    "Tsecyrillic",
-    "Tshecyrillic",
-    "Twelveroman",
-    "Tworoman",
-    "Ubreve",
-    "Ucaron",
-    "Ucircle",
-    "Ucircumflexbelow",
-    "Ucyrillic",
-    "Udblacute",
-    "Udblgrave",
-    "Udieresisacute",
-    "Udieresisbelow",
-    "Udieresiscaron",
-    "Udieresiscyrillic",
-    "Udieresisgrave",
-    "Udieresismacron",
-    "Udotbelow",
-    "Uhookabove",
-    "Uhorn",
-    "Uhornacute",
-    "Uhorndotbelow",
-    "Uhorngrave",
-    "Uhornhookabove",
-    "Uhorntilde",
-    "Uhungarumlaut",
-    "Uhungarumlautcyrillic",
-    "Uinvertedbreve",
-    "Ukcyrillic",
-    "Umacron",
-    "Umacroncyrillic",
-    "Umacrondieresis",
-    "Umonospace",
-    "Uogonek",
-    "Upsilon",
-    "Upsilon1",
-    "Upsilonacutehooksymbolgreek",
-    "Upsilonafrican",
-    "Upsilondieresis",
-    "Upsilondieresishooksymbolgreek",
-    "Upsilonhooksymbol",
-    "Upsilontonos",
-    "Uring",
-    "Ushortcyrillic",
-    "Ustraightcyrillic",
-    "Ustraightstrokecyrillic",
-    "Utilde",
-    "Utildeacute",
-    "Utildebelow",
-    "Vcircle",
-    "Vdotbelow",
-    "Vecyrillic",
-    "Vewarmenian",
-    "Vhook",
-    "Vmonospace",
-    "Voarmenian",
-    "Vtilde",
-    "Wacute",
-    "Wcircle",
-    "Wcircumflex",
-    "Wdieresis",
-    "Wdotaccent",
-    "Wdotbelow",
-    "Wgrave",
-    "Wmonospace",
-    "Xcircle",
-    "Xdieresis",
-    "Xdotaccent",
-    "Xeharmenian",
-    "Xi",
-    "Xmonospace",
-    "Yatcyrillic",
-    "Ycircle",
-    "Ycircumflex",
-    "Ydotaccent",
-    "Ydotbelow",
-    "Yericyrillic",
-    "Yerudieresiscyrillic",
-    "Ygrave",
-    "Yhook",
-    "Yhookabove",
-    "Yiarmenian",
-    "Yicyrillic",
-    "Yiwnarmenian",
-    "Ymonospace",
-    "Ytilde",
-    "Yusbigcyrillic",
-    "Yusbigiotifiedcyrillic",
-    "Yuslittlecyrillic",
-    "Yuslittleiotifiedcyrillic",
-    "Zaarmenian",
-    "Zacute",
-    "Zcircle",
-    "Zcircumflex",
-    "Zdot",
-    "Zdotaccent",
-    "Zdotbelow",
-    "Zecyrillic",
-    "Zedescendercyrillic",
-    "Zedieresiscyrillic",
-    "Zeta",
-    "Zhearmenian",
-    "Zhebrevecyrillic",
-    "Zhecyrillic",
-    "Zhedescendercyrillic",
-    "Zhedieresiscyrillic",
-    "Zlinebelow",
-    "Zmonospace",
-    "Zstroke",
-    "aabengali",
-    "aadeva",
-    "aagujarati",
-    "aagurmukhi",
-    "aamatragurmukhi",
-    "aarusquare",
-    "aavowelsignbengali",
-    "aavowelsigndeva",
-    "aavowelsigngujarati",
-    "abbreviationmarkarmenian",
-    "abbreviationsigndeva",
-    "abengali",
-    "abopomofo",
-    "abreve",
-    "abreveacute",
-    "abrevecyrillic",
-    "abrevedotbelow",
-    "abrevegrave",
-    "abrevehookabove",
-    "abrevetilde",
-    "acaron",
-    "acircle",
-    "acircumflexacute",
-    "acircumflexdotbelow",
-    "acircumflexgrave",
-    "acircumflexhookabove",
-    "acircumflextilde",
-    "acutebelowcmb",
-    "acutecmb",
-    "acutecomb",
-    "acutedeva",
-    "acutelowmod",
-    "acutetonecmb",
-    "acyrillic",
-    "adblgrave",
-    "addakgurmukhi",
-    "adeva",
-    "adieresiscyrillic",
-    "adieresismacron",
-    "adotbelow",
-    "adotmacron",
-    "aeacute",
-    "aekorean",
-    "aemacron",
-    "afii00208",
-    "afii08941",
-    "afii10017",
-    "afii10018",
-    "afii10019",
-    "afii10020",
-    "afii10021",
-    "afii10022",
-    "afii10023",
-    "afii10024",
-    "afii10025",
-    "afii10026",
-    "afii10027",
-    "afii10028",
-    "afii10029",
-    "afii10030",
-    "afii10031",
-    "afii10032",
-    "afii10033",
-    "afii10034",
-    "afii10035",
-    "afii10036",
-    "afii10037",
-    "afii10038",
-    "afii10039",
-    "afii10040",
-    "afii10041",
-    "afii10042",
-    "afii10043",
-    "afii10044",
-    "afii10045",
-    "afii10046",
-    "afii10047",
-    "afii10048",
-    "afii10049",
-    "afii10050",
-    "afii10051",
-    "afii10052",
-    "afii10053",
-    "afii10054",
-    "afii10055",
-    "afii10056",
-    "afii10057",
-    "afii10058",
-    "afii10059",
-    "afii10060",
-    "afii10061",
-    "afii10062",
-    "afii10063",
-    "afii10064",
-    "afii10065",
-    "afii10066",
-    "afii10067",
-    "afii10068",
-    "afii10069",
-    "afii10070",
-    "afii10071",
-    "afii10072",
-    "afii10073",
-    "afii10074",
-    "afii10075",
-    "afii10076",
-    "afii10077",
-    "afii10078",
-    "afii10079",
-    "afii10080",
-    "afii10081",
-    "afii10082",
-    "afii10083",
-    "afii10084",
-    "afii10085",
-    "afii10086",
-    "afii10087",
-    "afii10088",
-    "afii10089",
-    "afii10090",
-    "afii10091",
-    "afii10092",
-    "afii10093",
-    "afii10094",
-    "afii10095",
-    "afii10096",
-    "afii10097",
-    "afii10098",
-    "afii10099",
-    "afii10100",
-    "afii10101",
-    "afii10102",
-    "afii10103",
-    "afii10104",
-    "afii10105",
-    "afii10106",
-    "afii10107",
-    "afii10108",
-    "afii10109",
-    "afii10110",
-    "afii10145",
-    "afii10146",
-    "afii10147",
-    "afii10148",
-    "afii10192",
-    "afii10193",
-    "afii10194",
-    "afii10195",
-    "afii10196",
-    "afii10831",
-    "afii10832",
-    "afii10846",
-    "afii299",
-    "afii300",
-    "afii301",
-    "afii57381",
-    "afii57388",
-    "afii57392",
-    "afii57393",
-    "afii57394",
-    "afii57395",
-    "afii57396",
-    "afii57397",
-    "afii57398",
-    "afii57399",
-    "afii57400",
-    "afii57401",
-    "afii57403",
-    "afii57407",
-    "afii57409",
-    "afii57410",
-    "afii57411",
-    "afii57412",
-    "afii57413",
-    "afii57414",
-    "afii57415",
-    "afii57416",
-    "afii57417",
-    "afii57418",
-    "afii57419",
-    "afii57420",
-    "afii57421",
-    "afii57422",
-    "afii57423",
-    "afii57424",
-    "afii57425",
-    "afii57426",
-    "afii57427",
-    "afii57428",
-    "afii57429",
-    "afii57430",
-    "afii57431",
-    "afii57432",
-    "afii57433",
-    "afii57434",
-    "afii57440",
-    "afii57441",
-    "afii57442",
-    "afii57443",
-    "afii57444",
-    "afii57445",
-    "afii57446",
-    "afii57448",
-    "afii57449",
-    "afii57450",
-    "afii57451",
-    "afii57452",
-    "afii57453",
-    "afii57454",
-    "afii57455",
-    "afii57456",
-    "afii57457",
-    "afii57458",
-    "afii57470",
-    "afii57505",
-    "afii57506",
-    "afii57507",
-    "afii57508",
-    "afii57509",
-    "afii57511",
-    "afii57512",
-    "afii57513",
-    "afii57514",
-    "afii57519",
-    "afii57534",
-    "afii57636",
-    "afii57645",
-    "afii57658",
-    "afii57664",
-    "afii57665",
-    "afii57666",
-    "afii57667",
-    "afii57668",
-    "afii57669",
-    "afii57670",
-    "afii57671",
-    "afii57672",
-    "afii57673",
-    "afii57674",
-    "afii57675",
-    "afii57676",
-    "afii57677",
-    "afii57678",
-    "afii57679",
-    "afii57680",
-    "afii57681",
-    "afii57682",
-    "afii57683",
-    "afii57684",
-    "afii57685",
-    "afii57686",
-    "afii57687",
-    "afii57688",
-    "afii57689",
-    "afii57690",
-    "afii57694",
-    "afii57695",
-    "afii57700",
-    "afii57705",
-    "afii57716",
-    "afii57717",
-    "afii57718",
-    "afii57723",
-    "afii57793",
-    "afii57794",
-    "afii57795",
-    "afii57796",
-    "afii57797",
-    "afii57798",
-    "afii57799",
-    "afii57800",
-    "afii57801",
-    "afii57802",
-    "afii57803",
-    "afii57804",
-    "afii57806",
-    "afii57807",
-    "afii57839",
-    "afii57841",
-    "afii57842",
-    "afii57929",
-    "afii61248",
-    "afii61289",
-    "afii61352",
-    "afii61573",
-    "afii61574",
-    "afii61575",
-    "afii61664",
-    "afii63167",
-    "afii64937",
-    "agujarati",
-    "agurmukhi",
-    "ahiragana",
-    "ahookabove",
-    "aibengali",
-    "aibopomofo",
-    "aideva",
-    "aiecyrillic",
-    "aigujarati",
-    "aigurmukhi",
-    "aimatragurmukhi",
-    "ainarabic",
-    "ainfinalarabic",
-    "aininitialarabic",
-    "ainmedialarabic",
-    "ainvertedbreve",
-    "aivowelsignbengali",
-    "aivowelsigndeva",
-    "aivowelsigngujarati",
-    "akatakana",
-    "akatakanahalfwidth",
-    "akorean",
-    "alef",
-    "alefarabic",
-    "alefdageshhebrew",
-    "aleffinalarabic",
-    "alefhamzaabovearabic",
-    "alefhamzaabovefinalarabic",
-    "alefhamzabelowarabic",
-    "alefhamzabelowfinalarabic",
-    "alefhebrew",
-    "aleflamedhebrew",
-    "alefmaddaabovearabic",
-    "alefmaddaabovefinalarabic",
-    "alefmaksuraarabic",
-    "alefmaksurafinalarabic",
-    "alefmaksurainitialarabic",
-    "alefmaksuramedialarabic",
-    "alefpatahhebrew",
-    "alefqamatshebrew",
-    "aleph",
-    "allequal",
-    "alpha",
-    "alphatonos",
-    "amacron",
-    "amonospace",
-    "ampersandmonospace",
-    "amsquare",
-    "anbopomofo",
-    "angbopomofo",
-    "angkhankhuthai",
-    "angle",
-    "anglebracketleft",
-    "anglebracketleftvertical",
-    "anglebracketright",
-    "anglebracketrightvertical",
-    "angleleft",
-    "angleright",
-    "angstrom",
-    "anoteleia",
-    "anudattadeva",
-    "anusvarabengali",
-    "anusvaradeva",
-    "anusvaragujarati",
-    "aogonek",
-    "apaatosquare",
-    "aparen",
-    "apostrophearmenian",
-    "apostrophemod",
-    "apple",
-    "approaches",
-    "approxequal",
-    "approxequalorimage",
-    "approximatelyequal",
-    "araeaekorean",
-    "araeakorean",
-    "arc",
-    "arighthalfring",
-    "aringacute",
-    "aringbelow",
-    "arrowboth",
-    "arrowdashdown",
-    "arrowdashleft",
-    "arrowdashright",
-    "arrowdashup",
-    "arrowdblboth",
-    "arrowdbldown",
-    "arrowdblleft",
-    "arrowdblright",
-    "arrowdblup",
-    "arrowdown",
-    "arrowdownleft",
-    "arrowdownright",
-    "arrowdownwhite",
-    "arrowheaddownmod",
-    "arrowheadleftmod",
-    "arrowheadrightmod",
-    "arrowheadupmod",
-    "arrowhorizex",
-    "arrowleft",
-    "arrowleftdbl",
-    "arrowleftdblstroke",
-    "arrowleftoverright",
-    "arrowleftwhite",
-    "arrowright",
-    "arrowrightdblstroke",
-    "arrowrightheavy",
-    "arrowrightoverleft",
-    "arrowrightwhite",
-    "arrowtableft",
-    "arrowtabright",
-    "arrowup",
-    "arrowupdn",
-    "arrowupdnbse",
-    "arrowupdownbase",
-    "arrowupleft",
-    "arrowupleftofdown",
-    "arrowupright",
-    "arrowupwhite",
-    "arrowvertex",
-    "asciicircummonospace",
-    "asciitildemonospace",
-    "ascript",
-    "ascriptturned",
-    "asmallhiragana",
-    "asmallkatakana",
-    "asmallkatakanahalfwidth",
-    "asteriskaltonearabic",
-    "asteriskarabic",
-    "asteriskmath",
-    "asteriskmonospace",
-    "asterisksmall",
-    "asterism",
-    "asymptoticallyequal",
-    "atmonospace",
-    "atsmall",
-    "aturned",
-    "aubengali",
-    "aubopomofo",
-    "audeva",
-    "augujarati",
-    "augurmukhi",
-    "aulengthmarkbengali",
-    "aumatragurmukhi",
-    "auvowelsignbengali",
-    "auvowelsigndeva",
-    "auvowelsigngujarati",
-    "avagrahadeva",
-    "aybarmenian",
-    "ayin",
-    "ayinaltonehebrew",
-    "ayinhebrew",
-    "babengali",
-    "backslashmonospace",
-    "badeva",
-    "bagujarati",
-    "bagurmukhi",
-    "bahiragana",
-    "bahtthai",
-    "bakatakana",
-    "barmonospace",
-    "bbopomofo",
-    "bcircle",
-    "bdotaccent",
-    "bdotbelow",
-    "beamedsixteenthnotes",
-    "because",
-    "becyrillic",
-    "beharabic",
-    "behfinalarabic",
-    "behinitialarabic",
-    "behiragana",
-    "behmedialarabic",
-    "behmeeminitialarabic",
-    "behmeemisolatedarabic",
-    "behnoonfinalarabic",
-    "bekatakana",
-    "benarmenian",
-    "bet",
-    "beta",
-    "betasymbolgreek",
-    "betdagesh",
-    "betdageshhebrew",
-    "bethebrew",
-    "betrafehebrew",
-    "bhabengali",
-    "bhadeva",
-    "bhagujarati",
-    "bhagurmukhi",
-    "bhook",
-    "bihiragana",
-    "bikatakana",
-    "bilabialclick",
-    "bindigurmukhi",
-    "birusquare",
-    "blackcircle",
-    "blackdiamond",
-    "blackdownpointingtriangle",
-    "blackleftpointingpointer",
-    "blackleftpointingtriangle",
-    "blacklenticularbracketleft",
-    "blacklenticularbracketleftvertical",
-    "blacklenticularbracketright",
-    "blacklenticularbracketrightvertical",
-    "blacklowerlefttriangle",
-    "blacklowerrighttriangle",
-    "blackrectangle",
-    "blackrightpointingpointer",
-    "blackrightpointingtriangle",
-    "blacksmallsquare",
-    "blacksmilingface",
-    "blacksquare",
-    "blackstar",
-    "blackupperlefttriangle",
-    "blackupperrighttriangle",
-    "blackuppointingsmalltriangle",
-    "blackuppointingtriangle",
-    "blank",
-    "blinebelow",
-    "block",
-    "bmonospace",
-    "bobaimaithai",
-    "bohiragana",
-    "bokatakana",
-    "bparen",
-    "bqsquare",
-    "braceex",
-    "braceleftbt",
-    "braceleftmid",
-    "braceleftmonospace",
-    "braceleftsmall",
-    "bracelefttp",
-    "braceleftvertical",
-    "bracerightbt",
-    "bracerightmid",
-    "bracerightmonospace",
-    "bracerightsmall",
-    "bracerighttp",
-    "bracerightvertical",
-    "bracketleftbt",
-    "bracketleftex",
-    "bracketleftmonospace",
-    "bracketlefttp",
-    "bracketrightbt",
-    "bracketrightex",
-    "bracketrightmonospace",
-    "bracketrighttp",
-    "brevebelowcmb",
-    "brevecmb",
-    "breveinvertedbelowcmb",
-    "breveinvertedcmb",
-    "breveinverteddoublecmb",
-    "bridgebelowcmb",
-    "bridgeinvertedbelowcmb",
-    "bstroke",
-    "btopbar",
-    "buhiragana",
-    "bukatakana",
-    "bulletinverse",
-    "bulletoperator",
-    "bullseye",
-    "caarmenian",
-    "cabengali",
-    "cacute",
-    "cadeva",
-    "cagujarati",
-    "cagurmukhi",
-    "calsquare",
-    "candrabindubengali",
-    "candrabinducmb",
-    "candrabindudeva",
-    "candrabindugujarati",
-    "capslock",
-    "careof",
-    "caronbelowcmb",
-    "caroncmb",
-    "carriagereturn",
-    "cbopomofo",
-    "ccaron",
-    "ccedillaacute",
-    "ccircle",
-    "ccircumflex",
-    "ccurl",
-    "cdot",
-    "cdotaccent",
-    "cdsquare",
-    "cedillacmb",
-    "centigrade",
-    "centmonospace",
-    "chaarmenian",
-    "chabengali",
-    "chadeva",
-    "chagujarati",
-    "chagurmukhi",
-    "chbopomofo",
-    "cheabkhasiancyrillic",
-    "checkmark",
-    "checyrillic",
-    "chedescenderabkhasiancyrillic",
-    "chedescendercyrillic",
-    "chedieresiscyrillic",
-    "cheharmenian",
-    "chekhakassiancyrillic",
-    "cheverticalstrokecyrillic",
-    "chi",
-    "chieuchacirclekorean",
-    "chieuchaparenkorean",
-    "chieuchcirclekorean",
-    "chieuchkorean",
-    "chieuchparenkorean",
-    "chochangthai",
-    "chochanthai",
-    "chochingthai",
-    "chochoethai",
-    "chook",
-    "cieucacirclekorean",
-    "cieucaparenkorean",
-    "cieuccirclekorean",
-    "cieuckorean",
-    "cieucparenkorean",
-    "cieucuparenkorean",
-    "circle",
-    "circlemultiply",
-    "circleot",
-    "circleplus",
-    "circlepostalmark",
-    "circlewithlefthalfblack",
-    "circlewithrighthalfblack",
-    "circumflexbelowcmb",
-    "circumflexcmb",
-    "clear",
-    "clickalveolar",
-    "clickdental",
-    "clicklateral",
-    "clickretroflex",
-    "club",
-    "clubsuitblack",
-    "clubsuitwhite",
-    "cmcubedsquare",
-    "cmonospace",
-    "cmsquaredsquare",
-    "coarmenian",
-    "colonmonospace",
-    "colonsign",
-    "colonsmall",
-    "colontriangularhalfmod",
-    "colontriangularmod",
-    "commaabovecmb",
-    "commaaboverightcmb",
-    "commaaccent",
-    "commaarabic",
-    "commaarmenian",
-    "commamonospace",
-    "commareversedabovecmb",
-    "commareversedmod",
-    "commasmall",
-    "commaturnedabovecmb",
-    "commaturnedmod",
-    "compass",
-    "congruent",
-    "contourintegral",
-    "control",
-    "controlACK",
-    "controlBEL",
-    "controlBS",
-    "controlCAN",
-    "controlCR",
-    "controlDC1",
-    "controlDC2",
-    "controlDC3",
-    "controlDC4",
-    "controlDEL",
-    "controlDLE",
-    "controlEM",
-    "controlENQ",
-    "controlEOT",
-    "controlESC",
-    "controlETB",
-    "controlETX",
-    "controlFF",
-    "controlFS",
-    "controlGS",
-    "controlHT",
-    "controlLF",
-    "controlNAK",
-    "controlRS",
-    "controlSI",
-    "controlSO",
-    "controlSOT",
-    "controlSTX",
-    "controlSUB",
-    "controlSYN",
-    "controlUS",
-    "controlVT",
-    "copyrightsans",
-    "copyrightserif",
-    "cornerbracketleft",
-    "cornerbracketlefthalfwidth",
-    "cornerbracketleftvertical",
-    "cornerbracketright",
-    "cornerbracketrighthalfwidth",
-    "cornerbracketrightvertical",
-    "corporationsquare",
-    "cosquare",
-    "coverkgsquare",
-    "cparen",
-    "cruzeiro",
-    "cstretched",
-    "curlyand",
-    "curlyor",
-    "cyrBreve",
-    "cyrFlex",
-    "cyrbreve",
-    "cyrflex",
-    "daarmenian",
-    "dabengali",
-    "dadarabic",
-    "dadeva",
-    "dadfinalarabic",
-    "dadinitialarabic",
-    "dadmedialarabic",
-    "dagesh",
-    "dageshhebrew",
-    "dagujarati",
-    "dagurmukhi",
-    "dahiragana",
-    "dakatakana",
-    "dalarabic",
-    "dalet",
-    "daletdagesh",
-    "daletdageshhebrew",
-    "dalethatafpatah",
-    "dalethatafpatahhebrew",
-    "dalethatafsegol",
-    "dalethatafsegolhebrew",
-    "dalethebrew",
-    "dalethiriq",
-    "dalethiriqhebrew",
-    "daletholam",
-    "daletholamhebrew",
-    "daletpatah",
-    "daletpatahhebrew",
-    "daletqamats",
-    "daletqamatshebrew",
-    "daletqubuts",
-    "daletqubutshebrew",
-    "daletsegol",
-    "daletsegolhebrew",
-    "daletsheva",
-    "daletshevahebrew",
-    "dalettsere",
-    "dalettserehebrew",
-    "dalfinalarabic",
-    "dammaarabic",
-    "dammalowarabic",
-    "dammatanaltonearabic",
-    "dammatanarabic",
-    "danda",
-    "dargahebrew",
-    "dargalefthebrew",
-    "dasiapneumatacyrilliccmb",
-    "dblGrave",
-    "dblanglebracketleft",
-    "dblanglebracketleftvertical",
-    "dblanglebracketright",
-    "dblanglebracketrightvertical",
-    "dblarchinvertedbelowcmb",
-    "dblarrowleft",
-    "dblarrowright",
-    "dbldanda",
-    "dblgrave",
-    "dblgravecmb",
-    "dblintegral",
-    "dbllowline",
-    "dbllowlinecmb",
-    "dbloverlinecmb",
-    "dblprimemod",
-    "dblverticalbar",
-    "dblverticallineabovecmb",
-    "dbopomofo",
-    "dbsquare",
-    "dcaron",
-    "dcedilla",
-    "dcircle",
-    "dcircumflexbelow",
-    "dcroat",
-    "ddabengali",
-    "ddadeva",
-    "ddagujarati",
-    "ddagurmukhi",
-    "ddalarabic",
-    "ddalfinalarabic",
-    "dddhadeva",
-    "ddhabengali",
-    "ddhadeva",
-    "ddhagujarati",
-    "ddhagurmukhi",
-    "ddotaccent",
-    "ddotbelow",
-    "decimalseparatorarabic",
-    "decimalseparatorpersian",
-    "decyrillic",
-    "dehihebrew",
-    "dehiragana",
-    "deicoptic",
-    "dekatakana",
-    "deleteleft",
-    "deleteright",
-    "delta",
-    "deltaturned",
-    "denominatorminusonenumeratorbengali",
-    "dezh",
-    "dhabengali",
-    "dhadeva",
-    "dhagujarati",
-    "dhagurmukhi",
-    "dhook",
-    "dialytikatonos",
-    "dialytikatonoscmb",
-    "diamond",
-    "diamondsuitwhite",
-    "dieresisacute",
-    "dieresisbelowcmb",
-    "dieresiscmb",
-    "dieresisgrave",
-    "dieresistonos",
-    "dihiragana",
-    "dikatakana",
-    "dittomark",
-    "divides",
-    "divisionslash",
-    "djecyrillic",
-    "dkshade",
-    "dlinebelow",
-    "dlsquare",
-    "dmacron",
-    "dmonospace",
-    "dnblock",
-    "dochadathai",
-    "dodekthai",
-    "dohiragana",
-    "dokatakana",
-    "dollarmonospace",
-    "dollarsmall",
-    "dong",
-    "dorusquare",
-    "dotaccentcmb",
-    "dotbelowcmb",
-    "dotbelowcomb",
-    "dotkatakana",
-    "dotlessj",
-    "dotlessjstrokehook",
-    "dotmath",
-    "dottedcircle",
-    "doubleyodpatah",
-    "doubleyodpatahhebrew",
-    "downtackbelowcmb",
-    "downtackmod",
-    "dparen",
-    "dtail",
-    "dtopbar",
-    "duhiragana",
-    "dukatakana",
-    "dz",
-    "dzaltone",
-    "dzcaron",
-    "dzcurl",
-    "dzeabkhasiancyrillic",
-    "dzecyrillic",
-    "dzhecyrillic",
-    "earth",
-    "ebengali",
-    "ebopomofo",
-    "ebreve",
-    "ecandradeva",
-    "ecandragujarati",
-    "ecandravowelsigndeva",
-    "ecandravowelsigngujarati",
-    "ecaron",
-    "ecedillabreve",
-    "echarmenian",
-    "echyiwnarmenian",
-    "ecircle",
-    "ecircumflexacute",
-    "ecircumflexbelow",
-    "ecircumflexdotbelow",
-    "ecircumflexgrave",
-    "ecircumflexhookabove",
-    "ecircumflextilde",
-    "ecyrillic",
-    "edblgrave",
-    "edeva",
-    "edot",
-    "edotaccent",
-    "edotbelow",
-    "eegurmukhi",
-    "eematragurmukhi",
-    "efcyrillic",
-    "egujarati",
-    "eharmenian",
-    "ehbopomofo",
-    "ehiragana",
-    "ehookabove",
-    "eibopomofo",
-    "eightarabic",
-    "eightbengali",
-    "eightcircle",
-    "eightcircleinversesansserif",
-    "eightdeva",
-    "eighteencircle",
-    "eighteenparen",
-    "eighteenperiod",
-    "eightgujarati",
-    "eightgurmukhi",
-    "eighthackarabic",
-    "eighthangzhou",
-    "eighthnotebeamed",
-    "eightideographicparen",
-    "eightmonospace",
-    "eightparen",
-    "eightperiod",
-    "eightpersian",
-    "eightroman",
-    "eightthai",
-    "einvertedbreve",
-    "eiotifiedcyrillic",
-    "ekatakana",
-    "ekatakanahalfwidth",
-    "ekonkargurmukhi",
-    "ekorean",
-    "elcyrillic",
-    "element",
-    "elevencircle",
-    "elevenparen",
-    "elevenperiod",
-    "elevenroman",
-    "ellipsisvertical",
-    "emacron",
-    "emacronacute",
-    "emacrongrave",
-    "emcyrillic",
-    "emdashvertical",
-    "emonospace",
-    "emphasismarkarmenian",
-    "emptyset",
-    "enbopomofo",
-    "encyrillic",
-    "endashvertical",
-    "endescendercyrillic",
-    "eng",
-    "engbopomofo",
-    "enghecyrillic",
-    "enhookcyrillic",
-    "enspace",
-    "eogonek",
-    "eokorean",
-    "eopen",
-    "eopenclosed",
-    "eopenreversed",
-    "eopenreversedclosed",
-    "eopenreversedhook",
-    "eparen",
-    "epsilon",
-    "epsilontonos",
-    "equalmonospace",
-    "equalsmall",
-    "equalsuperior",
-    "equivalence",
-    "erbopomofo",
-    "ercyrillic",
-    "ereversed",
-    "ereversedcyrillic",
-    "escyrillic",
-    "esdescendercyrillic",
-    "esh",
-    "eshcurl",
-    "eshortdeva",
-    "eshortvowelsigndeva",
-    "eshreversedloop",
-    "eshsquatreversed",
-    "esmallhiragana",
-    "esmallkatakana",
-    "esmallkatakanahalfwidth",
-    "estimated",
-    "eta",
-    "etarmenian",
-    "etatonos",
-    "etilde",
-    "etildebelow",
-    "etnahtafoukhhebrew",
-    "etnahtafoukhlefthebrew",
-    "etnahtahebrew",
-    "etnahtalefthebrew",
-    "eturned",
-    "eukorean",
-    "euro",
-    "evowelsignbengali",
-    "evowelsigndeva",
-    "evowelsigngujarati",
-    "exclamarmenian",
-    "exclamdbl",
-    "exclammonospace",
-    "existential",
-    "ezh",
-    "ezhcaron",
-    "ezhcurl",
-    "ezhreversed",
-    "ezhtail",
-    "fadeva",
-    "fagurmukhi",
-    "fahrenheit",
-    "fathaarabic",
-    "fathalowarabic",
-    "fathatanarabic",
-    "fbopomofo",
-    "fcircle",
-    "fdotaccent",
-    "feharabic",
-    "feharmenian",
-    "fehfinalarabic",
-    "fehinitialarabic",
-    "fehmedialarabic",
-    "feicoptic",
-    "female",
-    "fifteencircle",
-    "fifteenparen",
-    "fifteenperiod",
-    "filledbox",
-    "filledrect",
-    "finalkaf",
-    "finalkafdagesh",
-    "finalkafdageshhebrew",
-    "finalkafhebrew",
-    "finalkafqamats",
-    "finalkafqamatshebrew",
-    "finalkafsheva",
-    "finalkafshevahebrew",
-    "finalmem",
-    "finalmemhebrew",
-    "finalnun",
-    "finalnunhebrew",
-    "finalpe",
-    "finalpehebrew",
-    "finaltsadi",
-    "finaltsadihebrew",
-    "firsttonechinese",
-    "fisheye",
-    "fitacyrillic",
-    "fivearabic",
-    "fivebengali",
-    "fivecircle",
-    "fivecircleinversesansserif",
-    "fivedeva",
-    "fivegujarati",
-    "fivegurmukhi",
-    "fivehackarabic",
-    "fivehangzhou",
-    "fiveideographicparen",
-    "fivemonospace",
-    "fiveparen",
-    "fiveperiod",
-    "fivepersian",
-    "fiveroman",
-    "fivethai",
-    "fmonospace",
-    "fmsquare",
-    "fofanthai",
-    "fofathai",
-    "fongmanthai",
-    "forall",
-    "fourarabic",
-    "fourbengali",
-    "fourcircle",
-    "fourcircleinversesansserif",
-    "fourdeva",
-    "fourgujarati",
-    "fourgurmukhi",
-    "fourhackarabic",
-    "fourhangzhou",
-    "fourideographicparen",
-    "fourmonospace",
-    "fournumeratorbengali",
-    "fourparen",
-    "fourperiod",
-    "fourpersian",
-    "fourroman",
-    "fourteencircle",
-    "fourteenparen",
-    "fourteenperiod",
-    "fourthai",
-    "fourthtonechinese",
-    "fparen",
-    "franc",
-    "gabengali",
-    "gacute",
-    "gadeva",
-    "gafarabic",
-    "gaffinalarabic",
-    "gafinitialarabic",
-    "gafmedialarabic",
-    "gagujarati",
-    "gagurmukhi",
-    "gahiragana",
-    "gakatakana",
-    "gamma",
-    "gammalatinsmall",
-    "gammasuperior",
-    "gangiacoptic",
-    "gbopomofo",
-    "gbreve",
-    "gcaron",
-    "gcedilla",
-    "gcircle",
-    "gcircumflex",
-    "gcommaaccent",
-    "gdot",
-    "gdotaccent",
-    "gecyrillic",
-    "gehiragana",
-    "gekatakana",
-    "geometricallyequal",
-    "gereshaccenthebrew",
-    "gereshhebrew",
-    "gereshmuqdamhebrew",
-    "gershayimaccenthebrew",
-    "gershayimhebrew",
-    "getamark",
-    "ghabengali",
-    "ghadarmenian",
-    "ghadeva",
-    "ghagujarati",
-    "ghagurmukhi",
-    "ghainarabic",
-    "ghainfinalarabic",
-    "ghaininitialarabic",
-    "ghainmedialarabic",
-    "ghemiddlehookcyrillic",
-    "ghestrokecyrillic",
-    "gheupturncyrillic",
-    "ghhadeva",
-    "ghhagurmukhi",
-    "ghook",
-    "ghzsquare",
-    "gihiragana",
-    "gikatakana",
-    "gimarmenian",
-    "gimel",
-    "gimeldagesh",
-    "gimeldageshhebrew",
-    "gimelhebrew",
-    "gjecyrillic",
-    "glottalinvertedstroke",
-    "glottalstop",
-    "glottalstopinverted",
-    "glottalstopmod",
-    "glottalstopreversed",
-    "glottalstopreversedmod",
-    "glottalstopreversedsuperior",
-    "glottalstopstroke",
-    "glottalstopstrokereversed",
-    "gmacron",
-    "gmonospace",
-    "gohiragana",
-    "gokatakana",
-    "gparen",
-    "gpasquare",
-    "gradient",
-    "gravebelowcmb",
-    "gravecmb",
-    "gravecomb",
-    "gravedeva",
-    "gravelowmod",
-    "gravemonospace",
-    "gravetonecmb",
-    "greaterequal",
-    "greaterequalorless",
-    "greatermonospace",
-    "greaterorequivalent",
-    "greaterorless",
-    "greateroverequal",
-    "greatersmall",
-    "gscript",
-    "gstroke",
-    "guhiragana",
-    "gukatakana",
-    "guramusquare",
-    "gysquare",
-    "haabkhasiancyrillic",
-    "haaltonearabic",
-    "habengali",
-    "hadescendercyrillic",
-    "hadeva",
-    "hagujarati",
-    "hagurmukhi",
-    "haharabic",
-    "hahfinalarabic",
-    "hahinitialarabic",
-    "hahiragana",
-    "hahmedialarabic",
-    "haitusquare",
-    "hakatakana",
-    "hakatakanahalfwidth",
-    "halantgurmukhi",
-    "hamzaarabic",
-    "hamzadammaarabic",
-    "hamzadammatanarabic",
-    "hamzafathaarabic",
-    "hamzafathatanarabic",
-    "hamzalowarabic",
-    "hamzalowkasraarabic",
-    "hamzalowkasratanarabic",
-    "hamzasukunarabic",
-    "hangulfiller",
-    "hardsigncyrillic",
-    "harpoonleftbarbup",
-    "harpoonrightbarbup",
-    "hasquare",
-    "hatafpatah",
-    "hatafpatah16",
-    "hatafpatah23",
-    "hatafpatah2f",
-    "hatafpatahhebrew",
-    "hatafpatahnarrowhebrew",
-    "hatafpatahquarterhebrew",
-    "hatafpatahwidehebrew",
-    "hatafqamats",
-    "hatafqamats1b",
-    "hatafqamats28",
-    "hatafqamats34",
-    "hatafqamatshebrew",
-    "hatafqamatsnarrowhebrew",
-    "hatafqamatsquarterhebrew",
-    "hatafqamatswidehebrew",
-    "hatafsegol",
-    "hatafsegol17",
-    "hatafsegol24",
-    "hatafsegol30",
-    "hatafsegolhebrew",
-    "hatafsegolnarrowhebrew",
-    "hatafsegolquarterhebrew",
-    "hatafsegolwidehebrew",
-    "hbar",
-    "hbopomofo",
-    "hbrevebelow",
-    "hcedilla",
-    "hcircle",
-    "hcircumflex",
-    "hdieresis",
-    "hdotaccent",
-    "hdotbelow",
-    "he",
-    "heart",
-    "heartsuitblack",
-    "heartsuitwhite",
-    "hedagesh",
-    "hedageshhebrew",
-    "hehaltonearabic",
-    "heharabic",
-    "hehebrew",
-    "hehfinalaltonearabic",
-    "hehfinalalttwoarabic",
-    "hehfinalarabic",
-    "hehhamzaabovefinalarabic",
-    "hehhamzaaboveisolatedarabic",
-    "hehinitialaltonearabic",
-    "hehinitialarabic",
-    "hehiragana",
-    "hehmedialaltonearabic",
-    "hehmedialarabic",
-    "heiseierasquare",
-    "hekatakana",
-    "hekatakanahalfwidth",
-    "hekutaarusquare",
-    "henghook",
-    "herutusquare",
-    "het",
-    "hethebrew",
-    "hhook",
-    "hhooksuperior",
-    "hieuhacirclekorean",
-    "hieuhaparenkorean",
-    "hieuhcirclekorean",
-    "hieuhkorean",
-    "hieuhparenkorean",
-    "hihiragana",
-    "hikatakana",
-    "hikatakanahalfwidth",
-    "hiriq",
-    "hiriq14",
-    "hiriq21",
-    "hiriq2d",
-    "hiriqhebrew",
-    "hiriqnarrowhebrew",
-    "hiriqquarterhebrew",
-    "hiriqwidehebrew",
-    "hlinebelow",
-    "hmonospace",
-    "hoarmenian",
-    "hohipthai",
-    "hohiragana",
-    "hokatakana",
-    "hokatakanahalfwidth",
-    "holam",
-    "holam19",
-    "holam26",
-    "holam32",
-    "holamhebrew",
-    "holamnarrowhebrew",
-    "holamquarterhebrew",
-    "holamwidehebrew",
-    "honokhukthai",
-    "hookabovecomb",
-    "hookcmb",
-    "hookpalatalizedbelowcmb",
-    "hookretroflexbelowcmb",
-    "hoonsquare",
-    "horicoptic",
-    "horizontalbar",
-    "horncmb",
-    "hotsprings",
-    "house",
-    "hparen",
-    "hsuperior",
-    "hturned",
-    "huhiragana",
-    "huiitosquare",
-    "hukatakana",
-    "hukatakanahalfwidth",
-    "hungarumlautcmb",
-    "hv",
-    "hyphenmonospace",
-    "hyphensmall",
-    "hyphentwo",
-    "iacyrillic",
-    "ibengali",
-    "ibopomofo",
-    "ibreve",
-    "icaron",
-    "icircle",
-    "icyrillic",
-    "idblgrave",
-    "ideographearthcircle",
-    "ideographfirecircle",
-    "ideographicallianceparen",
-    "ideographiccallparen",
-    "ideographiccentrecircle",
-    "ideographicclose",
-    "ideographiccomma",
-    "ideographiccommaleft",
-    "ideographiccongratulationparen",
-    "ideographiccorrectcircle",
-    "ideographicearthparen",
-    "ideographicenterpriseparen",
-    "ideographicexcellentcircle",
-    "ideographicfestivalparen",
-    "ideographicfinancialcircle",
-    "ideographicfinancialparen",
-    "ideographicfireparen",
-    "ideographichaveparen",
-    "ideographichighcircle",
-    "ideographiciterationmark",
-    "ideographiclaborcircle",
-    "ideographiclaborparen",
-    "ideographicleftcircle",
-    "ideographiclowcircle",
-    "ideographicmedicinecircle",
-    "ideographicmetalparen",
-    "ideographicmoonparen",
-    "ideographicnameparen",
-    "ideographicperiod",
-    "ideographicprintcircle",
-    "ideographicreachparen",
-    "ideographicrepresentparen",
-    "ideographicresourceparen",
-    "ideographicrightcircle",
-    "ideographicsecretcircle",
-    "ideographicselfparen",
-    "ideographicsocietyparen",
-    "ideographicspace",
-    "ideographicspecialparen",
-    "ideographicstockparen",
-    "ideographicstudyparen",
-    "ideographicsunparen",
-    "ideographicsuperviseparen",
-    "ideographicwaterparen",
-    "ideographicwoodparen",
-    "ideographiczero",
-    "ideographmetalcircle",
-    "ideographmooncircle",
-    "ideographnamecircle",
-    "ideographsuncircle",
-    "ideographwatercircle",
-    "ideographwoodcircle",
-    "ideva",
-    "idieresisacute",
-    "idieresiscyrillic",
-    "idotbelow",
-    "iebrevecyrillic",
-    "iecyrillic",
-    "ieungacirclekorean",
-    "ieungaparenkorean",
-    "ieungcirclekorean",
-    "ieungkorean",
-    "ieungparenkorean",
-    "igujarati",
-    "igurmukhi",
-    "ihiragana",
-    "ihookabove",
-    "iibengali",
-    "iicyrillic",
-    "iideva",
-    "iigujarati",
-    "iigurmukhi",
-    "iimatragurmukhi",
-    "iinvertedbreve",
-    "iishortcyrillic",
-    "iivowelsignbengali",
-    "iivowelsigndeva",
-    "iivowelsigngujarati",
-    "ij",
-    "ikatakana",
-    "ikatakanahalfwidth",
-    "ikorean",
-    "ilde",
-    "iluyhebrew",
-    "imacron",
-    "imacroncyrillic",
-    "imageorapproximatelyequal",
-    "imatragurmukhi",
-    "imonospace",
-    "increment",
-    "infinity",
-    "iniarmenian",
-    "integral",
-    "integralbottom",
-    "integralbt",
-    "integralex",
-    "integraltop",
-    "integraltp",
-    "intersection",
-    "intisquare",
-    "invbullet",
-    "invcircle",
-    "invsmileface",
-    "iocyrillic",
-    "iogonek",
-    "iota",
-    "iotadieresis",
-    "iotadieresistonos",
-    "iotalatin",
-    "iotatonos",
-    "iparen",
-    "irigurmukhi",
-    "ismallhiragana",
-    "ismallkatakana",
-    "ismallkatakanahalfwidth",
-    "issharbengali",
-    "istroke",
-    "iterationhiragana",
-    "iterationkatakana",
-    "itilde",
-    "itildebelow",
-    "iubopomofo",
-    "iucyrillic",
-    "ivowelsignbengali",
-    "ivowelsigndeva",
-    "ivowelsigngujarati",
-    "izhitsacyrillic",
-    "izhitsadblgravecyrillic",
-    "jaarmenian",
-    "jabengali",
-    "jadeva",
-    "jagujarati",
-    "jagurmukhi",
-    "jbopomofo",
-    "jcaron",
-    "jcircle",
-    "jcircumflex",
-    "jcrossedtail",
-    "jdotlessstroke",
-    "jecyrillic",
-    "jeemarabic",
-    "jeemfinalarabic",
-    "jeeminitialarabic",
-    "jeemmedialarabic",
-    "jeharabic",
-    "jehfinalarabic",
-    "jhabengali",
-    "jhadeva",
-    "jhagujarati",
-    "jhagurmukhi",
-    "jheharmenian",
-    "jis",
-    "jmonospace",
-    "jparen",
-    "jsuperior",
-    "kabashkircyrillic",
-    "kabengali",
-    "kacute",
-    "kacyrillic",
-    "kadescendercyrillic",
-    "kadeva",
-    "kaf",
-    "kafarabic",
-    "kafdagesh",
-    "kafdageshhebrew",
-    "kaffinalarabic",
-    "kafhebrew",
-    "kafinitialarabic",
-    "kafmedialarabic",
-    "kafrafehebrew",
-    "kagujarati",
-    "kagurmukhi",
-    "kahiragana",
-    "kahookcyrillic",
-    "kakatakana",
-    "kakatakanahalfwidth",
-    "kappa",
-    "kappasymbolgreek",
-    "kapyeounmieumkorean",
-    "kapyeounphieuphkorean",
-    "kapyeounpieupkorean",
-    "kapyeounssangpieupkorean",
-    "karoriisquare",
-    "kashidaautoarabic",
-    "kashidaautonosidebearingarabic",
-    "kasmallkatakana",
-    "kasquare",
-    "kasraarabic",
-    "kasratanarabic",
-    "kastrokecyrillic",
-    "katahiraprolongmarkhalfwidth",
-    "kaverticalstrokecyrillic",
-    "kbopomofo",
-    "kcalsquare",
-    "kcaron",
-    "kcedilla",
-    "kcircle",
-    "kcommaaccent",
-    "kdotbelow",
-    "keharmenian",
-    "kehiragana",
-    "kekatakana",
-    "kekatakanahalfwidth",
-    "kenarmenian",
-    "kesmallkatakana",
-    "kgreenlandic",
-    "khabengali",
-    "khacyrillic",
-    "khadeva",
-    "khagujarati",
-    "khagurmukhi",
-    "khaharabic",
-    "khahfinalarabic",
-    "khahinitialarabic",
-    "khahmedialarabic",
-    "kheicoptic",
-    "khhadeva",
-    "khhagurmukhi",
-    "khieukhacirclekorean",
-    "khieukhaparenkorean",
-    "khieukhcirclekorean",
-    "khieukhkorean",
-    "khieukhparenkorean",
-    "khokhaithai",
-    "khokhonthai",
-    "khokhuatthai",
-    "khokhwaithai",
-    "khomutthai",
-    "khook",
-    "khorakhangthai",
-    "khzsquare",
-    "kihiragana",
-    "kikatakana",
-    "kikatakanahalfwidth",
-    "kiroguramusquare",
-    "kiromeetorusquare",
-    "kirosquare",
-    "kiyeokacirclekorean",
-    "kiyeokaparenkorean",
-    "kiyeokcirclekorean",
-    "kiyeokkorean",
-    "kiyeokparenkorean",
-    "kiyeoksioskorean",
-    "kjecyrillic",
-    "klinebelow",
-    "klsquare",
-    "kmcubedsquare",
-    "kmonospace",
-    "kmsquaredsquare",
-    "kohiragana",
-    "kohmsquare",
-    "kokaithai",
-    "kokatakana",
-    "kokatakanahalfwidth",
-    "kooposquare",
-    "koppacyrillic",
-    "koreanstandardsymbol",
-    "koroniscmb",
-    "kparen",
-    "kpasquare",
-    "ksicyrillic",
-    "ktsquare",
-    "kturned",
-    "kuhiragana",
-    "kukatakana",
-    "kukatakanahalfwidth",
-    "kvsquare",
-    "kwsquare",
-    "labengali",
-    "lacute",
-    "ladeva",
-    "lagujarati",
-    "lagurmukhi",
-    "lakkhangyaothai",
-    "lamaleffinalarabic",
-    "lamalefhamzaabovefinalarabic",
-    "lamalefhamzaaboveisolatedarabic",
-    "lamalefhamzabelowfinalarabic",
-    "lamalefhamzabelowisolatedarabic",
-    "lamalefisolatedarabic",
-    "lamalefmaddaabovefinalarabic",
-    "lamalefmaddaaboveisolatedarabic",
-    "lamarabic",
-    "lambda",
-    "lambdastroke",
-    "lamed",
-    "lameddagesh",
-    "lameddageshhebrew",
-    "lamedhebrew",
-    "lamedholam",
-    "lamedholamdagesh",
-    "lamedholamdageshhebrew",
-    "lamedholamhebrew",
-    "lamfinalarabic",
-    "lamhahinitialarabic",
-    "laminitialarabic",
-    "lamjeeminitialarabic",
-    "lamkhahinitialarabic",
-    "lamlamhehisolatedarabic",
-    "lammedialarabic",
-    "lammeemhahinitialarabic",
-    "lammeeminitialarabic",
-    "lammeemjeeminitialarabic",
-    "lammeemkhahinitialarabic",
-    "largecircle",
-    "lbar",
-    "lbelt",
-    "lbopomofo",
-    "lcaron",
-    "lcedilla",
-    "lcircle",
-    "lcircumflexbelow",
-    "lcommaaccent",
-    "ldot",
-    "ldotaccent",
-    "ldotbelow",
-    "ldotbelowmacron",
-    "leftangleabovecmb",
-    "lefttackbelowcmb",
-    "lessequal",
-    "lessequalorgreater",
-    "lessmonospace",
-    "lessorequivalent",
-    "lessorgreater",
-    "lessoverequal",
-    "lesssmall",
-    "lezh",
-    "lfblock",
-    "lhookretroflex",
-    "lira",
-    "liwnarmenian",
-    "lj",
-    "ljecyrillic",
-    "ll",
-    "lladeva",
-    "llagujarati",
-    "llinebelow",
-    "llladeva",
-    "llvocalicbengali",
-    "llvocalicdeva",
-    "llvocalicvowelsignbengali",
-    "llvocalicvowelsigndeva",
-    "lmiddletilde",
-    "lmonospace",
-    "lmsquare",
-    "lochulathai",
-    "logicaland",
-    "logicalnotreversed",
-    "logicalor",
-    "lolingthai",
-    "longs",
-    "lowlinecenterline",
-    "lowlinecmb",
-    "lowlinedashed",
-    "lozenge",
-    "lparen",
-    "lsquare",
-    "ltshade",
-    "luthai",
-    "lvocalicbengali",
-    "lvocalicdeva",
-    "lvocalicvowelsignbengali",
-    "lvocalicvowelsigndeva",
-    "lxsquare",
-    "mabengali",
-    "macronbelowcmb",
-    "macroncmb",
-    "macronlowmod",
-    "macronmonospace",
-    "macute",
-    "madeva",
-    "magujarati",
-    "magurmukhi",
-    "mahapakhhebrew",
-    "mahapakhlefthebrew",
-    "mahiragana",
-    "maichattawalowleftthai",
-    "maichattawalowrightthai",
-    "maichattawathai",
-    "maichattawaupperleftthai",
-    "maieklowleftthai",
-    "maieklowrightthai",
-    "maiekthai",
-    "maiekupperleftthai",
-    "maihanakatleftthai",
-    "maihanakatthai",
-    "maitaikhuleftthai",
-    "maitaikhuthai",
-    "maitholowleftthai",
-    "maitholowrightthai",
-    "maithothai",
-    "maithoupperleftthai",
-    "maitrilowleftthai",
-    "maitrilowrightthai",
-    "maitrithai",
-    "maitriupperleftthai",
-    "maiyamokthai",
-    "makatakana",
-    "makatakanahalfwidth",
-    "male",
-    "mansyonsquare",
-    "maqafhebrew",
-    "mars",
-    "masoracirclehebrew",
-    "masquare",
-    "mbopomofo",
-    "mbsquare",
-    "mcircle",
-    "mcubedsquare",
-    "mdotaccent",
-    "mdotbelow",
-    "meemarabic",
-    "meemfinalarabic",
-    "meeminitialarabic",
-    "meemmedialarabic",
-    "meemmeeminitialarabic",
-    "meemmeemisolatedarabic",
-    "meetorusquare",
-    "mehiragana",
-    "meizierasquare",
-    "mekatakana",
-    "mekatakanahalfwidth",
-    "mem",
-    "memdagesh",
-    "memdageshhebrew",
-    "memhebrew",
-    "menarmenian",
-    "merkhahebrew",
-    "merkhakefulahebrew",
-    "merkhakefulalefthebrew",
-    "merkhalefthebrew",
-    "mhook",
-    "mhzsquare",
-    "middledotkatakanahalfwidth",
-    "middot",
-    "mieumacirclekorean",
-    "mieumaparenkorean",
-    "mieumcirclekorean",
-    "mieumkorean",
-    "mieumpansioskorean",
-    "mieumparenkorean",
-    "mieumpieupkorean",
-    "mieumsioskorean",
-    "mihiragana",
-    "mikatakana",
-    "mikatakanahalfwidth",
-    "minusbelowcmb",
-    "minuscircle",
-    "minusmod",
-    "minusplus",
-    "minute",
-    "miribaarusquare",
-    "mirisquare",
-    "mlonglegturned",
-    "mlsquare",
-    "mmcubedsquare",
-    "mmonospace",
-    "mmsquaredsquare",
-    "mohiragana",
-    "mohmsquare",
-    "mokatakana",
-    "mokatakanahalfwidth",
-    "molsquare",
-    "momathai",
-    "moverssquare",
-    "moverssquaredsquare",
-    "mparen",
-    "mpasquare",
-    "mssquare",
-    "mturned",
-    "mu1",
-    "muasquare",
-    "muchgreater",
-    "muchless",
-    "mufsquare",
-    "mugreek",
-    "mugsquare",
-    "muhiragana",
-    "mukatakana",
-    "mukatakanahalfwidth",
-    "mulsquare",
-    "mumsquare",
-    "munahhebrew",
-    "munahlefthebrew",
-    "musicalnote",
-    "musicalnotedbl",
-    "musicflatsign",
-    "musicsharpsign",
-    "mussquare",
-    "muvsquare",
-    "muwsquare",
-    "mvmegasquare",
-    "mvsquare",
-    "mwmegasquare",
-    "mwsquare",
-    "nabengali",
-    "nabla",
-    "nacute",
-    "nadeva",
-    "nagujarati",
-    "nagurmukhi",
-    "nahiragana",
-    "nakatakana",
-    "nakatakanahalfwidth",
-    "napostrophe",
-    "nasquare",
-    "nbopomofo",
-    "nbspace",
-    "ncaron",
-    "ncedilla",
-    "ncircle",
-    "ncircumflexbelow",
-    "ncommaaccent",
-    "ndotaccent",
-    "ndotbelow",
-    "nehiragana",
-    "nekatakana",
-    "nekatakanahalfwidth",
-    "newsheqelsign",
-    "nfsquare",
-    "ngabengali",
-    "ngadeva",
-    "ngagujarati",
-    "ngagurmukhi",
-    "ngonguthai",
-    "nhiragana",
-    "nhookleft",
-    "nhookretroflex",
-    "nieunacirclekorean",
-    "nieunaparenkorean",
-    "nieuncieuckorean",
-    "nieuncirclekorean",
-    "nieunhieuhkorean",
-    "nieunkorean",
-    "nieunpansioskorean",
-    "nieunparenkorean",
-    "nieunsioskorean",
-    "nieuntikeutkorean",
-    "nihiragana",
-    "nikatakana",
-    "nikatakanahalfwidth",
-    "nikhahitleftthai",
-    "nikhahitthai",
-    "ninearabic",
-    "ninebengali",
-    "ninecircle",
-    "ninecircleinversesansserif",
-    "ninedeva",
-    "ninegujarati",
-    "ninegurmukhi",
-    "ninehackarabic",
-    "ninehangzhou",
-    "nineideographicparen",
-    "ninemonospace",
-    "nineparen",
-    "nineperiod",
-    "ninepersian",
-    "nineroman",
-    "nineteencircle",
-    "nineteenparen",
-    "nineteenperiod",
-    "ninethai",
-    "nj",
-    "njecyrillic",
-    "nkatakana",
-    "nkatakanahalfwidth",
-    "nlegrightlong",
-    "nlinebelow",
-    "nmonospace",
-    "nmsquare",
-    "nnabengali",
-    "nnadeva",
-    "nnagujarati",
-    "nnagurmukhi",
-    "nnnadeva",
-    "nohiragana",
-    "nokatakana",
-    "nokatakanahalfwidth",
-    "nonbreakingspace",
-    "nonenthai",
-    "nonuthai",
-    "noonarabic",
-    "noonfinalarabic",
-    "noonghunnaarabic",
-    "noonghunnafinalarabic",
-    "noonhehinitialarabic",
-    "nooninitialarabic",
-    "noonjeeminitialarabic",
-    "noonjeemisolatedarabic",
-    "noonmedialarabic",
-    "noonmeeminitialarabic",
-    "noonmeemisolatedarabic",
-    "noonnoonfinalarabic",
-    "notcontains",
-    "notelement",
-    "notelementof",
-    "notequal",
-    "notgreater",
-    "notgreaternorequal",
-    "notgreaternorless",
-    "notidentical",
-    "notless",
-    "notlessnorequal",
-    "notparallel",
-    "notprecedes",
-    "notsubset",
-    "notsucceeds",
-    "notsuperset",
-    "nowarmenian",
-    "nparen",
-    "nssquare",
-    "nu",
-    "nuhiragana",
-    "nukatakana",
-    "nukatakanahalfwidth",
-    "nuktabengali",
-    "nuktadeva",
-    "nuktagujarati",
-    "nuktagurmukhi",
-    "numbersignmonospace",
-    "numbersignsmall",
-    "numeralsigngreek",
-    "numeralsignlowergreek",
-    "numero",
-    "nun",
-    "nundagesh",
-    "nundageshhebrew",
-    "nunhebrew",
-    "nvsquare",
-    "nwsquare",
-    "nyabengali",
-    "nyadeva",
-    "nyagujarati",
-    "nyagurmukhi",
-    "oangthai",
-    "obarred",
-    "obarredcyrillic",
-    "obarreddieresiscyrillic",
-    "obengali",
-    "obopomofo",
-    "obreve",
-    "ocandradeva",
-    "ocandragujarati",
-    "ocandravowelsigndeva",
-    "ocandravowelsigngujarati",
-    "ocaron",
-    "ocircle",
-    "ocircumflexacute",
-    "ocircumflexdotbelow",
-    "ocircumflexgrave",
-    "ocircumflexhookabove",
-    "ocircumflextilde",
-    "ocyrillic",
-    "odblacute",
-    "odblgrave",
-    "odeva",
-    "odieresiscyrillic",
-    "odotbelow",
-    "oekorean",
-    "ogonekcmb",
-    "ogujarati",
-    "oharmenian",
-    "ohiragana",
-    "ohookabove",
-    "ohorn",
-    "ohornacute",
-    "ohorndotbelow",
-    "ohorngrave",
-    "ohornhookabove",
-    "ohorntilde",
-    "ohungarumlaut",
-    "oi",
-    "oinvertedbreve",
-    "okatakana",
-    "okatakanahalfwidth",
-    "okorean",
-    "olehebrew",
-    "omacron",
-    "omacronacute",
-    "omacrongrave",
-    "omdeva",
-    "omega",
-    "omega1",
-    "omegacyrillic",
-    "omegalatinclosed",
-    "omegaroundcyrillic",
-    "omegatitlocyrillic",
-    "omegatonos",
-    "omgujarati",
-    "omicron",
-    "omicrontonos",
-    "omonospace",
-    "onearabic",
-    "onebengali",
-    "onecircle",
-    "onecircleinversesansserif",
-    "onedeva",
-    "onegujarati",
-    "onegurmukhi",
-    "onehackarabic",
-    "onehangzhou",
-    "oneideographicparen",
-    "onemonospace",
-    "onenumeratorbengali",
-    "oneparen",
-    "oneperiod",
-    "onepersian",
-    "oneroman",
-    "onethai",
-    "oogonek",
-    "oogonekmacron",
-    "oogurmukhi",
-    "oomatragurmukhi",
-    "oopen",
-    "oparen",
-    "openbullet",
-    "option",
-    "orthogonal",
-    "oshortdeva",
-    "oshortvowelsigndeva",
-    "oslashacute",
-    "osmallhiragana",
-    "osmallkatakana",
-    "osmallkatakanahalfwidth",
-    "ostrokeacute",
-    "otcyrillic",
-    "otildeacute",
-    "otildedieresis",
-    "oubopomofo",
-    "overline",
-    "overlinecenterline",
-    "overlinecmb",
-    "overlinedashed",
-    "overlinedblwavy",
-    "overlinewavy",
-    "overscore",
-    "ovowelsignbengali",
-    "ovowelsigndeva",
-    "ovowelsigngujarati",
-    "paampssquare",
-    "paasentosquare",
-    "pabengali",
-    "pacute",
-    "padeva",
-    "pagedown",
-    "pageup",
-    "pagujarati",
-    "pagurmukhi",
-    "pahiragana",
-    "paiyannoithai",
-    "pakatakana",
-    "palatalizationcyrilliccmb",
-    "palochkacyrillic",
-    "pansioskorean",
-    "parallel",
-    "parenleftaltonearabic",
-    "parenleftbt",
-    "parenleftex",
-    "parenleftmonospace",
-    "parenleftsmall",
-    "parenlefttp",
-    "parenleftvertical",
-    "parenrightaltonearabic",
-    "parenrightbt",
-    "parenrightex",
-    "parenrightmonospace",
-    "parenrightsmall",
-    "parenrighttp",
-    "parenrightvertical",
-    "partialdiff",
-    "paseqhebrew",
-    "pashtahebrew",
-    "pasquare",
-    "patah",
-    "patah11",
-    "patah1d",
-    "patah2a",
-    "patahhebrew",
-    "patahnarrowhebrew",
-    "patahquarterhebrew",
-    "patahwidehebrew",
-    "pazerhebrew",
-    "pbopomofo",
-    "pcircle",
-    "pdotaccent",
-    "pe",
-    "pecyrillic",
-    "pedagesh",
-    "pedageshhebrew",
-    "peezisquare",
-    "pefinaldageshhebrew",
-    "peharabic",
-    "peharmenian",
-    "pehebrew",
-    "pehfinalarabic",
-    "pehinitialarabic",
-    "pehiragana",
-    "pehmedialarabic",
-    "pekatakana",
-    "pemiddlehookcyrillic",
-    "perafehebrew",
-    "percentarabic",
-    "percentmonospace",
-    "percentsmall",
-    "periodarmenian",
-    "periodhalfwidth",
-    "periodmonospace",
-    "periodsmall",
-    "perispomenigreekcmb",
-    "perpendicular",
-    "peseta",
-    "pfsquare",
-    "phabengali",
-    "phadeva",
-    "phagujarati",
-    "phagurmukhi",
-    "phi",
-    "phi1",
-    "phieuphacirclekorean",
-    "phieuphaparenkorean",
-    "phieuphcirclekorean",
-    "phieuphkorean",
-    "phieuphparenkorean",
-    "philatin",
-    "phinthuthai",
-    "phisymbolgreek",
-    "phook",
-    "phophanthai",
-    "phophungthai",
-    "phosamphaothai",
-    "pi",
-    "pieupacirclekorean",
-    "pieupaparenkorean",
-    "pieupcieuckorean",
-    "pieupcirclekorean",
-    "pieupkiyeokkorean",
-    "pieupkorean",
-    "pieupparenkorean",
-    "pieupsioskiyeokkorean",
-    "pieupsioskorean",
-    "pieupsiostikeutkorean",
-    "pieupthieuthkorean",
-    "pieuptikeutkorean",
-    "pihiragana",
-    "pikatakana",
-    "pisymbolgreek",
-    "piwrarmenian",
-    "plusbelowcmb",
-    "pluscircle",
-    "plusmod",
-    "plusmonospace",
-    "plussmall",
-    "plussuperior",
-    "pmonospace",
-    "pmsquare",
-    "pohiragana",
-    "pointingindexdownwhite",
-    "pointingindexleftwhite",
-    "pointingindexrightwhite",
-    "pointingindexupwhite",
-    "pokatakana",
-    "poplathai",
-    "postalmark",
-    "postalmarkface",
-    "pparen",
-    "precedes",
-    "prescription",
-    "primemod",
-    "primereversed",
-    "product",
-    "projective",
-    "prolongedkana",
-    "propellor",
-    "propersubset",
-    "propersuperset",
-    "proportion",
-    "proportional",
-    "psi",
-    "psicyrillic",
-    "psilipneumatacyrilliccmb",
-    "pssquare",
-    "puhiragana",
-    "pukatakana",
-    "pvsquare",
-    "pwsquare",
-    "qadeva",
-    "qadmahebrew",
-    "qafarabic",
-    "qaffinalarabic",
-    "qafinitialarabic",
-    "qafmedialarabic",
-    "qamats",
-    "qamats10",
-    "qamats1a",
-    "qamats1c",
-    "qamats27",
-    "qamats29",
-    "qamats33",
-    "qamatsde",
-    "qamatshebrew",
-    "qamatsnarrowhebrew",
-    "qamatsqatanhebrew",
-    "qamatsqatannarrowhebrew",
-    "qamatsqatanquarterhebrew",
-    "qamatsqatanwidehebrew",
-    "qamatsquarterhebrew",
-    "qamatswidehebrew",
-    "qarneyparahebrew",
-    "qbopomofo",
-    "qcircle",
-    "qhook",
-    "qmonospace",
-    "qof",
-    "qofdagesh",
-    "qofdageshhebrew",
-    "qofhatafpatah",
-    "qofhatafpatahhebrew",
-    "qofhatafsegol",
-    "qofhatafsegolhebrew",
-    "qofhebrew",
-    "qofhiriq",
-    "qofhiriqhebrew",
-    "qofholam",
-    "qofholamhebrew",
-    "qofpatah",
-    "qofpatahhebrew",
-    "qofqamats",
-    "qofqamatshebrew",
-    "qofqubuts",
-    "qofqubutshebrew",
-    "qofsegol",
-    "qofsegolhebrew",
-    "qofsheva",
-    "qofshevahebrew",
-    "qoftsere",
-    "qoftserehebrew",
-    "qparen",
-    "quarternote",
-    "qubuts",
-    "qubuts18",
-    "qubuts25",
-    "qubuts31",
-    "qubutshebrew",
-    "qubutsnarrowhebrew",
-    "qubutsquarterhebrew",
-    "qubutswidehebrew",
-    "questionarabic",
-    "questionarmenian",
-    "questiongreek",
-    "questionmonospace",
-    "quotedblmonospace",
-    "quotedblprime",
-    "quotedblprimereversed",
-    "quoteleftreversed",
-    "quotereversed",
-    "quoterightn",
-    "quotesinglemonospace",
-    "raarmenian",
-    "rabengali",
-    "racute",
-    "radeva",
-    "radical",
-    "radicalex",
-    "radoverssquare",
-    "radoverssquaredsquare",
-    "radsquare",
-    "rafe",
-    "rafehebrew",
-    "ragujarati",
-    "ragurmukhi",
-    "rahiragana",
-    "rakatakana",
-    "rakatakanahalfwidth",
-    "ralowerdiagonalbengali",
-    "ramiddlediagonalbengali",
-    "ramshorn",
-    "ratio",
-    "rbopomofo",
-    "rcaron",
-    "rcedilla",
-    "rcircle",
-    "rcommaaccent",
-    "rdblgrave",
-    "rdotaccent",
-    "rdotbelow",
-    "rdotbelowmacron",
-    "referencemark",
-    "reflexsubset",
-    "reflexsuperset",
-    "registersans",
-    "registerserif",
-    "reharabic",
-    "reharmenian",
-    "rehfinalarabic",
-    "rehiragana",
-    "rehyehaleflamarabic",
-    "rekatakana",
-    "rekatakanahalfwidth",
-    "resh",
-    "reshdageshhebrew",
-    "reshhatafpatah",
-    "reshhatafpatahhebrew",
-    "reshhatafsegol",
-    "reshhatafsegolhebrew",
-    "reshhebrew",
-    "reshhiriq",
-    "reshhiriqhebrew",
-    "reshholam",
-    "reshholamhebrew",
-    "reshpatah",
-    "reshpatahhebrew",
-    "reshqamats",
-    "reshqamatshebrew",
-    "reshqubuts",
-    "reshqubutshebrew",
-    "reshsegol",
-    "reshsegolhebrew",
-    "reshsheva",
-    "reshshevahebrew",
-    "reshtsere",
-    "reshtserehebrew",
-    "reversedtilde",
-    "reviahebrew",
-    "reviamugrashhebrew",
-    "revlogicalnot",
-    "rfishhook",
-    "rfishhookreversed",
-    "rhabengali",
-    "rhadeva",
-    "rho",
-    "rhook",
-    "rhookturned",
-    "rhookturnedsuperior",
-    "rhosymbolgreek",
-    "rhotichookmod",
-    "rieulacirclekorean",
-    "rieulaparenkorean",
-    "rieulcirclekorean",
-    "rieulhieuhkorean",
-    "rieulkiyeokkorean",
-    "rieulkiyeoksioskorean",
-    "rieulkorean",
-    "rieulmieumkorean",
-    "rieulpansioskorean",
-    "rieulparenkorean",
-    "rieulphieuphkorean",
-    "rieulpieupkorean",
-    "rieulpieupsioskorean",
-    "rieulsioskorean",
-    "rieulthieuthkorean",
-    "rieultikeutkorean",
-    "rieulyeorinhieuhkorean",
-    "rightangle",
-    "righttackbelowcmb",
-    "righttriangle",
-    "rihiragana",
-    "rikatakana",
-    "rikatakanahalfwidth",
-    "ringbelowcmb",
-    "ringcmb",
-    "ringhalfleft",
-    "ringhalfleftarmenian",
-    "ringhalfleftbelowcmb",
-    "ringhalfleftcentered",
-    "ringhalfright",
-    "ringhalfrightbelowcmb",
-    "ringhalfrightcentered",
-    "rinvertedbreve",
-    "rittorusquare",
-    "rlinebelow",
-    "rlongleg",
-    "rlonglegturned",
-    "rmonospace",
-    "rohiragana",
-    "rokatakana",
-    "rokatakanahalfwidth",
-    "roruathai",
-    "rparen",
-    "rrabengali",
-    "rradeva",
-    "rragurmukhi",
-    "rreharabic",
-    "rrehfinalarabic",
-    "rrvocalicbengali",
-    "rrvocalicdeva",
-    "rrvocalicgujarati",
-    "rrvocalicvowelsignbengali",
-    "rrvocalicvowelsigndeva",
-    "rrvocalicvowelsigngujarati",
-    "rtblock",
-    "rturned",
-    "rturnedsuperior",
-    "ruhiragana",
-    "rukatakana",
-    "rukatakanahalfwidth",
-    "rupeemarkbengali",
-    "rupeesignbengali",
-    "ruthai",
-    "rvocalicbengali",
-    "rvocalicdeva",
-    "rvocalicgujarati",
-    "rvocalicvowelsignbengali",
-    "rvocalicvowelsigndeva",
-    "rvocalicvowelsigngujarati",
-    "sabengali",
-    "sacute",
-    "sacutedotaccent",
-    "sadarabic",
-    "sadeva",
-    "sadfinalarabic",
-    "sadinitialarabic",
-    "sadmedialarabic",
-    "sagujarati",
-    "sagurmukhi",
-    "sahiragana",
-    "sakatakana",
-    "sakatakanahalfwidth",
-    "sallallahoualayhewasallamarabic",
-    "samekh",
-    "samekhdagesh",
-    "samekhdageshhebrew",
-    "samekhhebrew",
-    "saraaathai",
-    "saraaethai",
-    "saraaimaimalaithai",
-    "saraaimaimuanthai",
-    "saraamthai",
-    "saraathai",
-    "saraethai",
-    "saraiileftthai",
-    "saraiithai",
-    "saraileftthai",
-    "saraithai",
-    "saraothai",
-    "saraueeleftthai",
-    "saraueethai",
-    "saraueleftthai",
-    "sarauethai",
-    "sarauthai",
-    "sarauuthai",
-    "sbopomofo",
-    "scarondotaccent",
-    "scedilla",
-    "schwa",
-    "schwacyrillic",
-    "schwadieresiscyrillic",
-    "schwahook",
-    "scircle",
-    "scircumflex",
-    "scommaaccent",
-    "sdotaccent",
-    "sdotbelow",
-    "sdotbelowdotaccent",
-    "seagullbelowcmb",
-    "second",
-    "secondtonechinese",
-    "seenarabic",
-    "seenfinalarabic",
-    "seeninitialarabic",
-    "seenmedialarabic",
-    "segol",
-    "segol13",
-    "segol1f",
-    "segol2c",
-    "segolhebrew",
-    "segolnarrowhebrew",
-    "segolquarterhebrew",
-    "segoltahebrew",
-    "segolwidehebrew",
-    "seharmenian",
-    "sehiragana",
-    "sekatakana",
-    "sekatakanahalfwidth",
-    "semicolonarabic",
-    "semicolonmonospace",
-    "semicolonsmall",
-    "semivoicedmarkkana",
-    "semivoicedmarkkanahalfwidth",
-    "sentisquare",
-    "sentosquare",
-    "sevenarabic",
-    "sevenbengali",
-    "sevencircle",
-    "sevencircleinversesansserif",
-    "sevendeva",
-    "sevengujarati",
-    "sevengurmukhi",
-    "sevenhackarabic",
-    "sevenhangzhou",
-    "sevenideographicparen",
-    "sevenmonospace",
-    "sevenparen",
-    "sevenperiod",
-    "sevenpersian",
-    "sevenroman",
-    "seventeencircle",
-    "seventeenparen",
-    "seventeenperiod",
-    "seventhai",
-    "sfthyphen",
-    "shaarmenian",
-    "shabengali",
-    "shacyrillic",
-    "shaddaarabic",
-    "shaddadammaarabic",
-    "shaddadammatanarabic",
-    "shaddafathaarabic",
-    "shaddafathatanarabic",
-    "shaddakasraarabic",
-    "shaddakasratanarabic",
-    "shade",
-    "shadedark",
-    "shadelight",
-    "shademedium",
-    "shadeva",
-    "shagujarati",
-    "shagurmukhi",
-    "shalshelethebrew",
-    "shbopomofo",
-    "shchacyrillic",
-    "sheenarabic",
-    "sheenfinalarabic",
-    "sheeninitialarabic",
-    "sheenmedialarabic",
-    "sheicoptic",
-    "sheqel",
-    "sheqelhebrew",
-    "sheva",
-    "sheva115",
-    "sheva15",
-    "sheva22",
-    "sheva2e",
-    "shevahebrew",
-    "shevanarrowhebrew",
-    "shevaquarterhebrew",
-    "shevawidehebrew",
-    "shhacyrillic",
-    "shimacoptic",
-    "shin",
-    "shindagesh",
-    "shindageshhebrew",
-    "shindageshshindot",
-    "shindageshshindothebrew",
-    "shindageshsindot",
-    "shindageshsindothebrew",
-    "shindothebrew",
-    "shinhebrew",
-    "shinshindot",
-    "shinshindothebrew",
-    "shinsindot",
-    "shinsindothebrew",
-    "shook",
-    "sigma",
-    "sigma1",
-    "sigmafinal",
-    "sigmalunatesymbolgreek",
-    "sihiragana",
-    "sikatakana",
-    "sikatakanahalfwidth",
-    "siluqhebrew",
-    "siluqlefthebrew",
-    "similar",
-    "sindothebrew",
-    "siosacirclekorean",
-    "siosaparenkorean",
-    "sioscieuckorean",
-    "sioscirclekorean",
-    "sioskiyeokkorean",
-    "sioskorean",
-    "siosnieunkorean",
-    "siosparenkorean",
-    "siospieupkorean",
-    "siostikeutkorean",
-    "sixarabic",
-    "sixbengali",
-    "sixcircle",
-    "sixcircleinversesansserif",
-    "sixdeva",
-    "sixgujarati",
-    "sixgurmukhi",
-    "sixhackarabic",
-    "sixhangzhou",
-    "sixideographicparen",
-    "sixmonospace",
-    "sixparen",
-    "sixperiod",
-    "sixpersian",
-    "sixroman",
-    "sixteencircle",
-    "sixteencurrencydenominatorbengali",
-    "sixteenparen",
-    "sixteenperiod",
-    "sixthai",
-    "slashmonospace",
-    "slong",
-    "slongdotaccent",
-    "smileface",
-    "smonospace",
-    "sofpasuqhebrew",
-    "softhyphen",
-    "softsigncyrillic",
-    "sohiragana",
-    "sokatakana",
-    "sokatakanahalfwidth",
-    "soliduslongoverlaycmb",
-    "solidusshortoverlaycmb",
-    "sorusithai",
-    "sosalathai",
-    "sosothai",
-    "sosuathai",
-    "spacehackarabic",
-    "spade",
-    "spadesuitblack",
-    "spadesuitwhite",
-    "sparen",
-    "squarebelowcmb",
-    "squarecc",
-    "squarecm",
-    "squarediagonalcrosshatchfill",
-    "squarehorizontalfill",
-    "squarekg",
-    "squarekm",
-    "squarekmcapital",
-    "squareln",
-    "squarelog",
-    "squaremg",
-    "squaremil",
-    "squaremm",
-    "squaremsquared",
-    "squareorthogonalcrosshatchfill",
-    "squareupperlefttolowerrightfill",
-    "squareupperrighttolowerleftfill",
-    "squareverticalfill",
-    "squarewhitewithsmallblack",
-    "srsquare",
-    "ssabengali",
-    "ssadeva",
-    "ssagujarati",
-    "ssangcieuckorean",
-    "ssanghieuhkorean",
-    "ssangieungkorean",
-    "ssangkiyeokkorean",
-    "ssangnieunkorean",
-    "ssangpieupkorean",
-    "ssangsioskorean",
-    "ssangtikeutkorean",
-    "sterlingmonospace",
-    "strokelongoverlaycmb",
-    "strokeshortoverlaycmb",
-    "subset",
-    "subsetnotequal",
-    "subsetorequal",
-    "succeeds",
-    "suchthat",
-    "suhiragana",
-    "sukatakana",
-    "sukatakanahalfwidth",
-    "sukunarabic",
-    "summation",
-    "sun",
-    "superset",
-    "supersetnotequal",
-    "supersetorequal",
-    "svsquare",
-    "syouwaerasquare",
-    "tabengali",
-    "tackdown",
-    "tackleft",
-    "tadeva",
-    "tagujarati",
-    "tagurmukhi",
-    "taharabic",
-    "tahfinalarabic",
-    "tahinitialarabic",
-    "tahiragana",
-    "tahmedialarabic",
-    "taisyouerasquare",
-    "takatakana",
-    "takatakanahalfwidth",
-    "tatweelarabic",
-    "tau",
-    "tav",
-    "tavdages",
-    "tavdagesh",
-    "tavdageshhebrew",
-    "tavhebrew",
-    "tbar",
-    "tbopomofo",
-    "tcaron",
-    "tccurl",
-    "tcedilla",
-    "tcheharabic",
-    "tchehfinalarabic",
-    "tchehinitialarabic",
-    "tchehmedialarabic",
-    "tchehmeeminitialarabic",
-    "tcircle",
-    "tcircumflexbelow",
-    "tcommaaccent",
-    "tdieresis",
-    "tdotaccent",
-    "tdotbelow",
-    "tecyrillic",
-    "tedescendercyrillic",
-    "teharabic",
-    "tehfinalarabic",
-    "tehhahinitialarabic",
-    "tehhahisolatedarabic",
-    "tehinitialarabic",
-    "tehiragana",
-    "tehjeeminitialarabic",
-    "tehjeemisolatedarabic",
-    "tehmarbutaarabic",
-    "tehmarbutafinalarabic",
-    "tehmedialarabic",
-    "tehmeeminitialarabic",
-    "tehmeemisolatedarabic",
-    "tehnoonfinalarabic",
-    "tekatakana",
-    "tekatakanahalfwidth",
-    "telephone",
-    "telephoneblack",
-    "telishagedolahebrew",
-    "telishaqetanahebrew",
-    "tencircle",
-    "tenideographicparen",
-    "tenparen",
-    "tenperiod",
-    "tenroman",
-    "tesh",
-    "tet",
-    "tetdagesh",
-    "tetdageshhebrew",
-    "tethebrew",
-    "tetsecyrillic",
-    "tevirhebrew",
-    "tevirlefthebrew",
-    "thabengali",
-    "thadeva",
-    "thagujarati",
-    "thagurmukhi",
-    "thalarabic",
-    "thalfinalarabic",
-    "thanthakhatlowleftthai",
-    "thanthakhatlowrightthai",
-    "thanthakhatthai",
-    "thanthakhatupperleftthai",
-    "theharabic",
-    "thehfinalarabic",
-    "thehinitialarabic",
-    "thehmedialarabic",
-    "thereexists",
-    "therefore",
-    "theta",
-    "theta1",
-    "thetasymbolgreek",
-    "thieuthacirclekorean",
-    "thieuthaparenkorean",
-    "thieuthcirclekorean",
-    "thieuthkorean",
-    "thieuthparenkorean",
-    "thirteencircle",
-    "thirteenparen",
-    "thirteenperiod",
-    "thonangmonthothai",
-    "thook",
-    "thophuthaothai",
-    "thothahanthai",
-    "thothanthai",
-    "thothongthai",
-    "thothungthai",
-    "thousandcyrillic",
-    "thousandsseparatorarabic",
-    "thousandsseparatorpersian",
-    "threearabic",
-    "threebengali",
-    "threecircle",
-    "threecircleinversesansserif",
-    "threedeva",
-    "threegujarati",
-    "threegurmukhi",
-    "threehackarabic",
-    "threehangzhou",
-    "threeideographicparen",
-    "threemonospace",
-    "threenumeratorbengali",
-    "threeparen",
-    "threeperiod",
-    "threepersian",
-    "threeroman",
-    "threethai",
-    "thzsquare",
-    "tihiragana",
-    "tikatakana",
-    "tikatakanahalfwidth",
-    "tikeutacirclekorean",
-    "tikeutaparenkorean",
-    "tikeutcirclekorean",
-    "tikeutkorean",
-    "tikeutparenkorean",
-    "tildebelowcmb",
-    "tildecmb",
-    "tildecomb",
-    "tildedoublecmb",
-    "tildeoperator",
-    "tildeoverlaycmb",
-    "tildeverticalcmb",
-    "timescircle",
-    "tipehahebrew",
-    "tipehalefthebrew",
-    "tippigurmukhi",
-    "titlocyrilliccmb",
-    "tiwnarmenian",
-    "tlinebelow",
-    "tmonospace",
-    "toarmenian",
-    "tohiragana",
-    "tokatakana",
-    "tokatakanahalfwidth",
-    "tonebarextrahighmod",
-    "tonebarextralowmod",
-    "tonebarhighmod",
-    "tonebarlowmod",
-    "tonebarmidmod",
-    "tonefive",
-    "tonesix",
-    "tonetwo",
-    "tonos",
-    "tonsquare",
-    "topatakthai",
-    "tortoiseshellbracketleft",
-    "tortoiseshellbracketleftsmall",
-    "tortoiseshellbracketleftvertical",
-    "tortoiseshellbracketright",
-    "tortoiseshellbracketrightsmall",
-    "tortoiseshellbracketrightvertical",
-    "totaothai",
-    "tpalatalhook",
-    "tparen",
-    "trademarksans",
-    "trademarkserif",
-    "tretroflexhook",
-    "triagdn",
-    "triaglf",
-    "triagrt",
-    "triagup",
-    "ts",
-    "tsadi",
-    "tsadidagesh",
-    "tsadidageshhebrew",
-    "tsadihebrew",
-    "tsecyrillic",
-    "tsere",
-    "tsere12",
-    "tsere1e",
-    "tsere2b",
-    "tserehebrew",
-    "tserenarrowhebrew",
-    "tserequarterhebrew",
-    "tserewidehebrew",
-    "tshecyrillic",
-    "ttabengali",
-    "ttadeva",
-    "ttagujarati",
-    "ttagurmukhi",
-    "tteharabic",
-    "ttehfinalarabic",
-    "ttehinitialarabic",
-    "ttehmedialarabic",
-    "tthabengali",
-    "tthadeva",
-    "tthagujarati",
-    "tthagurmukhi",
-    "tturned",
-    "tuhiragana",
-    "tukatakana",
-    "tukatakanahalfwidth",
-    "tusmallhiragana",
-    "tusmallkatakana",
-    "tusmallkatakanahalfwidth",
-    "twelvecircle",
-    "twelveparen",
-    "twelveperiod",
-    "twelveroman",
-    "twentycircle",
-    "twentyhangzhou",
-    "twentyparen",
-    "twentyperiod",
-    "twoarabic",
-    "twobengali",
-    "twocircle",
-    "twocircleinversesansserif",
-    "twodeva",
-    "twodotleader",
-    "twodotleadervertical",
-    "twogujarati",
-    "twogurmukhi",
-    "twohackarabic",
-    "twohangzhou",
-    "twoideographicparen",
-    "twomonospace",
-    "twonumeratorbengali",
-    "twoparen",
-    "twoperiod",
-    "twopersian",
-    "tworoman",
-    "twostroke",
-    "twothai",
-    "ubar",
-    "ubengali",
-    "ubopomofo",
-    "ubreve",
-    "ucaron",
-    "ucircle",
-    "ucircumflexbelow",
-    "ucyrillic",
-    "udattadeva",
-    "udblacute",
-    "udblgrave",
-    "udeva",
-    "udieresisacute",
-    "udieresisbelow",
-    "udieresiscaron",
-    "udieresiscyrillic",
-    "udieresisgrave",
-    "udieresismacron",
-    "udotbelow",
-    "ugujarati",
-    "ugurmukhi",
-    "uhiragana",
-    "uhookabove",
-    "uhorn",
-    "uhornacute",
-    "uhorndotbelow",
-    "uhorngrave",
-    "uhornhookabove",
-    "uhorntilde",
-    "uhungarumlaut",
-    "uhungarumlautcyrillic",
-    "uinvertedbreve",
-    "ukatakana",
-    "ukatakanahalfwidth",
-    "ukcyrillic",
-    "ukorean",
-    "umacron",
-    "umacroncyrillic",
-    "umacrondieresis",
-    "umatragurmukhi",
-    "umonospace",
-    "underscoredbl",
-    "underscoremonospace",
-    "underscorevertical",
-    "underscorewavy",
-    "union",
-    "universal",
-    "uogonek",
-    "uparen",
-    "upblock",
-    "upperdothebrew",
-    "upsilon",
-    "upsilondieresis",
-    "upsilondieresistonos",
-    "upsilonlatin",
-    "upsilontonos",
-    "uptackbelowcmb",
-    "uptackmod",
-    "uragurmukhi",
-    "uring",
-    "ushortcyrillic",
-    "usmallhiragana",
-    "usmallkatakana",
-    "usmallkatakanahalfwidth",
-    "ustraightcyrillic",
-    "ustraightstrokecyrillic",
-    "utilde",
-    "utildeacute",
-    "utildebelow",
-    "uubengali",
-    "uudeva",
-    "uugujarati",
-    "uugurmukhi",
-    "uumatragurmukhi",
-    "uuvowelsignbengali",
-    "uuvowelsigndeva",
-    "uuvowelsigngujarati",
-    "uvowelsignbengali",
-    "uvowelsigndeva",
-    "uvowelsigngujarati",
-    "vadeva",
-    "vagujarati",
-    "vagurmukhi",
-    "vakatakana",
-    "vav",
-    "vavdagesh",
-    "vavdagesh65",
-    "vavdageshhebrew",
-    "vavhebrew",
-    "vavholam",
-    "vavholamhebrew",
-    "vavvavhebrew",
-    "vavyodhebrew",
-    "vcircle",
-    "vdotbelow",
-    "vecyrillic",
-    "veharabic",
-    "vehfinalarabic",
-    "vehinitialarabic",
-    "vehmedialarabic",
-    "vekatakana",
-    "venus",
-    "verticalbar",
-    "verticallineabovecmb",
-    "verticallinebelowcmb",
-    "verticallinelowmod",
-    "verticallinemod",
-    "vewarmenian",
-    "vhook",
-    "vikatakana",
-    "viramabengali",
-    "viramadeva",
-    "viramagujarati",
-    "visargabengali",
-    "visargadeva",
-    "visargagujarati",
-    "vmonospace",
-    "voarmenian",
-    "voicediterationhiragana",
-    "voicediterationkatakana",
-    "voicedmarkkana",
-    "voicedmarkkanahalfwidth",
-    "vokatakana",
-    "vparen",
-    "vtilde",
-    "vturned",
-    "vuhiragana",
-    "vukatakana",
-    "wacute",
-    "waekorean",
-    "wahiragana",
-    "wakatakana",
-    "wakatakanahalfwidth",
-    "wakorean",
-    "wasmallhiragana",
-    "wasmallkatakana",
-    "wattosquare",
-    "wavedash",
-    "wavyunderscorevertical",
-    "wawarabic",
-    "wawfinalarabic",
-    "wawhamzaabovearabic",
-    "wawhamzaabovefinalarabic",
-    "wbsquare",
-    "wcircle",
-    "wcircumflex",
-    "wdieresis",
-    "wdotaccent",
-    "wdotbelow",
-    "wehiragana",
-    "weierstrass",
-    "wekatakana",
-    "wekorean",
-    "weokorean",
-    "wgrave",
-    "whitebullet",
-    "whitecircle",
-    "whitecircleinverse",
-    "whitecornerbracketleft",
-    "whitecornerbracketleftvertical",
-    "whitecornerbracketright",
-    "whitecornerbracketrightvertical",
-    "whitediamond",
-    "whitediamondcontainingblacksmalldiamond",
-    "whitedownpointingsmalltriangle",
-    "whitedownpointingtriangle",
-    "whiteleftpointingsmalltriangle",
-    "whiteleftpointingtriangle",
-    "whitelenticularbracketleft",
-    "whitelenticularbracketright",
-    "whiterightpointingsmalltriangle",
-    "whiterightpointingtriangle",
-    "whitesmallsquare",
-    "whitesmilingface",
-    "whitesquare",
-    "whitestar",
-    "whitetelephone",
-    "whitetortoiseshellbracketleft",
-    "whitetortoiseshellbracketright",
-    "whiteuppointingsmalltriangle",
-    "whiteuppointingtriangle",
-    "wihiragana",
-    "wikatakana",
-    "wikorean",
-    "wmonospace",
-    "wohiragana",
-    "wokatakana",
-    "wokatakanahalfwidth",
-    "won",
-    "wonmonospace",
-    "wowaenthai",
-    "wparen",
-    "wring",
-    "wsuperior",
-    "wturned",
-    "wynn",
-    "xabovecmb",
-    "xbopomofo",
-    "xcircle",
-    "xdieresis",
-    "xdotaccent",
-    "xeharmenian",
-    "xi",
-    "xmonospace",
-    "xparen",
-    "xsuperior",
-    "yaadosquare",
-    "yabengali",
-    "yadeva",
-    "yaekorean",
-    "yagujarati",
-    "yagurmukhi",
-    "yahiragana",
-    "yakatakana",
-    "yakatakanahalfwidth",
-    "yakorean",
-    "yamakkanthai",
-    "yasmallhiragana",
-    "yasmallkatakana",
-    "yasmallkatakanahalfwidth",
-    "yatcyrillic",
-    "ycircle",
-    "ycircumflex",
-    "ydotaccent",
-    "ydotbelow",
-    "yeharabic",
-    "yehbarreearabic",
-    "yehbarreefinalarabic",
-    "yehfinalarabic",
-    "yehhamzaabovearabic",
-    "yehhamzaabovefinalarabic",
-    "yehhamzaaboveinitialarabic",
-    "yehhamzaabovemedialarabic",
-    "yehinitialarabic",
-    "yehmedialarabic",
-    "yehmeeminitialarabic",
-    "yehmeemisolatedarabic",
-    "yehnoonfinalarabic",
-    "yehthreedotsbelowarabic",
-    "yekorean",
-    "yenmonospace",
-    "yeokorean",
-    "yeorinhieuhkorean",
-    "yerahbenyomohebrew",
-    "yerahbenyomolefthebrew",
-    "yericyrillic",
-    "yerudieresiscyrillic",
-    "yesieungkorean",
-    "yesieungpansioskorean",
-    "yesieungsioskorean",
-    "yetivhebrew",
-    "ygrave",
-    "yhook",
-    "yhookabove",
-    "yiarmenian",
-    "yicyrillic",
-    "yikorean",
-    "yinyang",
-    "yiwnarmenian",
-    "ymonospace",
-    "yod",
-    "yoddagesh",
-    "yoddageshhebrew",
-    "yodhebrew",
-    "yodyodhebrew",
-    "yodyodpatahhebrew",
-    "yohiragana",
-    "yoikorean",
-    "yokatakana",
-    "yokatakanahalfwidth",
-    "yokorean",
-    "yosmallhiragana",
-    "yosmallkatakana",
-    "yosmallkatakanahalfwidth",
-    "yotgreek",
-    "yoyaekorean",
-    "yoyakorean",
-    "yoyakthai",
-    "yoyingthai",
-    "yparen",
-    "ypogegrammeni",
-    "ypogegrammenigreekcmb",
-    "yr",
-    "yring",
-    "ysuperior",
-    "ytilde",
-    "yturned",
-    "yuhiragana",
-    "yuikorean",
-    "yukatakana",
-    "yukatakanahalfwidth",
-    "yukorean",
-    "yusbigcyrillic",
-    "yusbigiotifiedcyrillic",
-    "yuslittlecyrillic",
-    "yuslittleiotifiedcyrillic",
-    "yusmallhiragana",
-    "yusmallkatakana",
-    "yusmallkatakanahalfwidth",
-    "yuyekorean",
-    "yuyeokorean",
-    "yyabengali",
-    "yyadeva",
-    "zaarmenian",
-    "zacute",
-    "zadeva",
-    "zagurmukhi",
-    "zaharabic",
-    "zahfinalarabic",
-    "zahinitialarabic",
-    "zahiragana",
-    "zahmedialarabic",
-    "zainarabic",
-    "zainfinalarabic",
-    "zakatakana",
-    "zaqefgadolhebrew",
-    "zaqefqatanhebrew",
-    "zarqahebrew",
-    "zayin",
-    "zayindagesh",
-    "zayindageshhebrew",
-    "zayinhebrew",
-    "zbopomofo",
-    "zcircle",
-    "zcircumflex",
-    "zcurl",
-    "zdot",
-    "zdotaccent",
-    "zdotbelow",
-    "zecyrillic",
-    "zedescendercyrillic",
-    "zedieresiscyrillic",
-    "zehiragana",
-    "zekatakana",
-    "zeroarabic",
-    "zerobengali",
-    "zerodeva",
-    "zerogujarati",
-    "zerogurmukhi",
-    "zerohackarabic",
-    "zeromonospace",
-    "zeropersian",
-    "zerothai",
-    "zerowidthjoiner",
-    "zerowidthnonjoiner",
-    "zerowidthspace",
-    "zeta",
-    "zhbopomofo",
-    "zhearmenian",
-    "zhebrevecyrillic",
-    "zhecyrillic",
-    "zhedescendercyrillic",
-    "zhedieresiscyrillic",
-    "zihiragana",
-    "zikatakana",
-    "zinorhebrew",
-    "zlinebelow",
-    "zmonospace",
-    "zohiragana",
-    "zokatakana",
-    "zparen",
-    "zretroflexhook",
-    "zstroke",
-    "zuhiragana",
-    "zukatakana",
+#define FT_NUM_MAC_NAMES  258
 
-#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
+  /* Values are offsets into the `ft_standard_glyph_names' table */
 
-    NULL
+  static const short  ft_mac_names[FT_NUM_MAC_NAMES] =
+  {
+     253,   0,   6, 261, 267, 274, 283, 294, 301, 309, 758, 330, 340, 351,
+     360, 365, 371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430,
+     436, 441, 447, 457, 462, 468, 476, 485, 488, 490, 492, 494, 496, 498,
+     500, 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526,
+     528, 530, 532, 534, 536, 538, 540, 552, 562, 575, 587, 979, 608, 610,
+     612, 614, 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638,
+     640, 642, 644, 646, 648, 650, 652, 654, 656, 658, 660, 670, 674, 685,
+    1375,1392,1405,1414,1486,1512,1562,1603,1632,1610,1622,1645,1639,1652,
+    1661,1690,1668,1680,1697,1726,1704,1716,1733,1740,1769,1747,1759,1776,
+    1790,1819,1797,1809, 839,1263, 707, 712, 741, 881, 871,1160,1302,1346,
+    1197, 985,1031,  23,1086,1108,  32,1219,  41,  51, 730,1194,  64,  76,
+      86,  94,  97,1089,1118, 106,1131,1150, 966, 696,1183, 112, 734, 120,
+     132, 783, 930, 945, 138,1385,1398,1529,1115,1157, 832,1079, 770, 916,
+     598, 319,1246, 155,1833,1586, 721, 749, 797, 811, 826, 829, 846, 856,
+     888, 903, 954,1363,1421,1356,1433,1443,1450,1457,1469,1479,1493,1500,
+     163,1522,1543,1550,1572,1134, 991,1002,1008,1015,1021,1040,1045,1053,
+    1066,1073,1101,1143,1536,1783,1596,1843,1253,1207,1319,1579,1826,1229,
+    1270,1313,1323,1171,1290,1332,1211,1235,1276, 169, 175, 182, 189, 200,
+     209, 218, 225, 232, 239, 246
   };
 
 
-  static const char* const * const  sid_standard_names = ps_glyph_names + 2;
+#define FT_NUM_SID_NAMES  391
 
+  /* Values are offsets into the `ft_standard_glyph_names' table */
 
-#define NUM_SID_GLYPHS 391
+  static const short  ft_sid_names[FT_NUM_SID_NAMES] =
+  {
+     253, 261, 267, 274, 283, 294, 301, 309, 319, 330, 340, 351, 360, 365,
+     371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430, 436, 441,
+     447, 457, 462, 468, 476, 485, 488, 490, 492, 494, 496, 498, 500, 502,
+     504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530,
+     532, 534, 536, 538, 540, 552, 562, 575, 587, 598, 608, 610, 612, 614,
+     616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642,
+     644, 646, 648, 650, 652, 654, 656, 658, 660, 670, 674, 685, 696, 707,
+     712, 721, 730, 734, 741, 749, 758, 770, 783, 797, 811, 826, 829, 832,
+     839, 846, 856, 871, 881, 888, 903, 916, 930, 945, 954, 966, 979, 985,
+     991,1002,1008,1015,1021,1031,1040,1045,1053,1066,1073,1079,1086,1089,
+    1101,1108,1115,1118,1131,1134,1143,1150,1157,1160,1171,1183,1194,1197,
+    1207,1211,1219,1229,1235,1246,1253,1263,1270,1276,1290,1302,1313,1319,
+    1323,1332,1346,1356,1363,1375,1385,1392,1398,1405,1414,1421,1433,1443,
+    1450,1457,1469,1479,1486,1493,1500,1512,1522,1529,1536,1543,1550,1562,
+    1572,1579,1586,1596,1603,1610,1622,1632,1639,1645,1652,1661,1668,1680,
+    1690,1697,1704,1716,1726,1733,1740,1747,1759,1769,1776,1783,1790,1797,
+    1809,1819,1826,1833,1843,1850,1862,1880,1895,1910,1925,1936,1954,1973,
+    1988,2003,2016,2028,2040,2054,2067,2080,2092,2106,2120,2133,2147,2167,
+    2182,2196,2206,2216,2229,2239,2249,2259,2269,2279,2289,2299,2309,2319,
+    2329,2332,2336,2340,2358,2377,2393,2408,2419,2426,2433,2440,2447,2454,
+    2461,2468,2475,2482,2489,2496,2503,2510,2517,2524,2531,2538,2545,2552,
+    2559,2566,2573,2580,2587,2594,2601,2615,2625,2632,2643,2659,2672,2684,
+    2696,2708,2722,2733,2744,2759,2771,2782,2797,2809,2819,2832,2850,2860,
+    2873,2885,2898,2907,2917,2930,2943,2956,2968,2982,2996,3009,3022,3034,
+    3046,3060,3073,3086,3098,3112,3126,3139,3152,3167,3182,3196,3208,3220,
+    3237,3249,3264,3275,3283,3297,3309,3321,3338,3353,3365,3377,3394,3409,
+    3418,3430,3442,3454,3471,3483,3498,3506,3518,3530,3542,3559,3574,3586,
+    3597,3612,3620,3628,3636,3644,3650,3655,3660,3666,3673,3681,3687
+  };
 
-#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
-#define NUM_ADOBE_GLYPHS 4294
-#else
-#define NUM_ADOBE_GLYPHS 391
-#endif
+
+  /* the following are indices into the SID name table */
+  static const unsigned short  t1_standard_encoding[256] =
+  {
+      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
+     17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+     33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+     49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+     65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+     81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,  0,
+      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      0, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,
+      0,111,112,113,114,  0,115,116,117,118,119,120,121,122,  0,123,
+      0,124,125,126,127,128,129,130,131,  0,132,133,  0,134,135,136,
+    137,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      0,138,  0,139,  0,  0,  0,  0,140,141,142,143,  0,  0,  0,  0,
+      0,144,  0,  0,  0,145,  0,  0,146,147,148,149,  0,  0,  0,  0
+  };
 
 
-  static const unsigned short  mac_standard_names[259] =
+  /* the following are indices into the SID name table */
+  static const unsigned short  t1_expert_encoding[256] =
   {
-    2,
-    0,
-    1,
-    3,
-    4,
-    5,
-    6,
-    7,
-    8,
-    9,
-    106,
-    11,
-    12,
-    13,
-    14,
-    15,
-    16,
-    17,
-    18,
-    19,
-    20,
-    21,
-    22,
-    23,
-    24,
-    25,
-    26,
-    27,
-    28,
-    29,
-    30,
-    31,
-    32,
-    33,
-    34,
-    35,
-    36,
-    37,
-    38,
-    39,
-    40,
-    41,
-    42,
-    43,
-    44,
-    45,
-    46,
-    47,
-    48,
-    49,
-    50,
-    51,
-    52,
-    53,
-    54,
-    55,
-    56,
-    57,
-    58,
-    59,
-    60,
-    61,
-    62,
-    63,
-    64,
-    65,
-    66,
-    126,
-    68,
-    69,
-    70,
-    71,
-    72,
-    73,
-    74,
-    75,
-    76,
-    77,
-    78,
-    79,
-    80,
-    81,
-    82,
-    83,
-    84,
-    85,
-    86,
-    87,
-    88,
-    89,
-    90,
-    91,
-    92,
-    93,
-    94,
-    95,
-    96,
-    97,
-    175,
-    177,
-    179,
-    180,
-    188,
-    191,
-    197,
-    202,
-    205,
-    203,
-    204,
-    207,
-    206,
-    208,
-    209,
-    212,
-    210,
-    211,
-    213,
-    216,
-    214,
-    215,
-    217,
-    218,
-    221,
-    219,
-    220,
-    222,
-    224,
-    227,
-    225,
-    226,
-    114,
-    163,
-    99,
-    100,
-    104,
-    118,
-    117,
-    151,
-    167,
-    172,
-    155,
-    127,
-    133,
-    2919,
-    140,
-    143,
-    2413,
-    158,
-    2642,
-    2156,
-    102,
-    154,
-    3092,
-    3681,
-    3192,
-    3153,
-    2415,
-    141,
-    145,
-    741,
-    146,
-    149,
-    125,
-    98,
-    153,
-    3284,
-    103,
-    1353,
-    472,
-    108,
-    122,
-    123,
-    2901,
-    176,
-    178,
-    193,
-    144,
-    150,
-    113,
-    139,
-    107,
-    121,
-    67,
-    10,
-    161,
-    2677,
-    229,
-    200,
-    101,
-    105,
-    109,
-    110,
-    111,
-    112,
-    115,
-    116,
-    119,
-    120,
-    124,
-    174,
-    181,
-    173,
-    182,
-    183,
-    184,
-    185,
-    186,
-    187,
-    189,
-    190,
-    1351,
-    192,
-    195,
-    196,
-    198,
-    147,
-    128,
-    129,
-    130,
-    131,
-    132,
-    134,
-    135,
-    136,
-    137,
-    138,
-    142,
-    148,
-    194,
-    223,
-    201,
-    230,
-    162,
-    156,
-    169,
-    199,
-    228,
-    159,
-    164,
-    168,
-    170,
-    152,
-    166,
-    171,
-    157,
-    160,
-    165,
-    2074,
-    556,
-    2091,
-    609,
-    836,
-    3465,
-    438,
-    1545,
-    440,
-    1560,
-    1767,
-    0
+      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      1,229,230,  0,231,232,233,234,235,236,237,238, 13, 14, 15, 99,
+    239,240,241,242,243,244,245,246,247,248, 27, 28,249,250,251,252,
+      0,253,254,255,256,257,  0,  0,  0,258,  0,  0,259,260,261,262,
+      0,  0,263,264,265,  0,266,109,110,267,268,269,  0,270,271,272,
+    273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,
+    289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,  0,
+      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+      0,304,305,306,  0,  0,307,308,309,310,311,  0,312,  0,  0,313,
+      0,  0,314,315,  0,  0,316,317,318,  0,  0,  0,158,155,163,319,
+    320,321,322,323,324,325,  0,  0,326,150,164,169,327,328,329,330,
+    331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,
+    347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,
+    363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378
   };
 
 
+  /*
+   *  This table is a compressed version of the Adobe Glyph List (AGL),
+   *  optimized for efficient searching.  It has been generated by the
+   *  `glnames.py' python script located in the `src/tools' directory.
+   *
+   *  The lookup function to get the Unicode value for a given string
+   *  is defined below the table.
+   */
+  static const unsigned char  ft_adobe_glyph_list[54791] =
+  {
+      0, 52,  0,106,  2,167,  3, 63,  4,220,  6,125,  9,143, 10, 23,
+     11,137, 12,199, 14,246, 15, 87, 16,233, 17,219, 18,104, 19, 88,
+     22,110, 23, 32, 23, 71, 24, 77, 27,156, 29, 73, 31,247, 32,107,
+     32,222, 33, 55, 34,154, 35,218, 53, 84, 59,196, 68,  6, 75,183,
+     83,178, 88,135, 93,242,101,165,109,185,111, 55,117,254,123, 73,
+    130,238,138,206,145, 31,153,182,156,189,163,249,178,221,193, 17,
+    197, 99,199,240,204, 27,204,155,210,100, 65,143,  0, 65,  0,140,
+      0,175,  0,193,  1, 15,  1,147,  1,233,  1,251,  2,  7,  2, 40,
+      2, 57,  2, 82,  2, 91,  2,128,  2,136,  2,154, 69,131,  0,198,
+      0,150,  0,158,  0,167,225,227,245,244,101,128,  1,252,237,225,
+    227,242,239,110,128,  1,226,243,237,225,236,108,128,247,230,225,
+    227,245,244,101,129,  0,193,  0,185,243,237,225,236,108,128,247,
+    225,226,242,229,246,101,134,  1,  2,  0,213,  0,221,  0,232,  0,
+    243,  0,251,  1,  7,225,227,245,244,101,128, 30,174,227,249,242,
+    233,236,236,233, 99,128,  4,208,228,239,244,226,229,236,239,119,
+    128, 30,182,231,242,225,246,101,128, 30,176,232,239,239,235,225,
+    226,239,246,101,128, 30,178,244,233,236,228,101,128, 30,180, 99,
+      4,  1, 25,  1, 32,  1,121,  1,137,225,242,239,110,128,  1,205,
+    233,242, 99,  2,  1, 40,  1, 45,236,101,128, 36,182,245,237,230,
+    236,229,120,134,  0,194,  1, 66,  1, 74,  1, 85,  1, 93,  1,105,
+      1,113,225,227,245,244,101,128, 30,164,228,239,244,226,229,236,
+    239,119,128, 30,172,231,242,225,246,101,128, 30,166,232,239,239,
+    235,225,226,239,246,101,128, 30,168,243,237,225,236,108,128,247,
+    226,244,233,236,228,101,128, 30,170,245,244,101,129,246,201,  1,
+    129,243,237,225,236,108,128,247,180,249,242,233,236,236,233, 99,
+    128,  4, 16,100,  3,  1,155,  1,165,  1,209,226,236,231,242,225,
+    246,101,128,  2,  0,233,229,242,229,243,233,115,131,  0,196,  1,
+    181,  1,192,  1,201,227,249,242,233,236,236,233, 99,128,  4,210,
+    237,225,227,242,239,110,128,  1,222,243,237,225,236,108,128,247,
+    228,239,116,  2,  1,216,  1,224,226,229,236,239,119,128, 30,160,
+    237,225,227,242,239,110,128,  1,224,231,242,225,246,101,129,  0,
+    192,  1,243,243,237,225,236,108,128,247,224,232,239,239,235,225,
+    226,239,246,101,128, 30,162,105,  2,  2, 13,  2, 25,229,227,249,
+    242,233,236,236,233, 99,128,  4,212,238,246,229,242,244,229,228,
+    226,242,229,246,101,128,  2,  2,236,240,232, 97,129,  3,145,  2,
+     49,244,239,238,239,115,128,  3,134,109,  2,  2, 63,  2, 71,225,
+    227,242,239,110,128,  1,  0,239,238,239,243,240,225,227,101,128,
+    255, 33,239,231,239,238,229,107,128,  1,  4,242,233,238,103,131,
+      0,197,  2,104,  2,112,  2,120,225,227,245,244,101,128,  1,250,
+    226,229,236,239,119,128, 30,  0,243,237,225,236,108,128,247,229,
+    243,237,225,236,108,128,247, 97,244,233,236,228,101,129,  0,195,
+      2,146,243,237,225,236,108,128,247,227,249,226,225,242,237,229,
+    238,233,225,110,128,  5, 49, 66,137,  0, 66,  2,189,  2,198,  2,
+    223,  3,  3,  3, 10,  3, 22,  3, 34,  3, 46,  3, 54,227,233,242,
+    227,236,101,128, 36,183,228,239,116,  2,  2,206,  2,215,225,227,
+    227,229,238,116,128, 30,  2,226,229,236,239,119,128, 30,  4,101,
+      3,  2,231,  2,242,  2,254,227,249,242,233,236,236,233, 99,128,
+      4, 17,238,225,242,237,229,238,233,225,110,128,  5, 50,244, 97,
+    128,  3,146,232,239,239,107,128,  1,129,236,233,238,229,226,229,
+    236,239,119,128, 30,  6,237,239,238,239,243,240,225,227,101,128,
+    255, 34,242,229,246,229,243,237,225,236,108,128,246,244,243,237,
+    225,236,108,128,247, 98,244,239,240,226,225,114,128,  1,130, 67,
+    137,  0, 67,  3, 85,  3,127,  3,193,  3,210,  3,224,  4,171,  4,
+    188,  4,200,  4,212, 97,  3,  3, 93,  3,104,  3,111,225,242,237,
+    229,238,233,225,110,128,  5, 62,227,245,244,101,128,  1,  6,242,
+    239,110,129,246,202,  3,119,243,237,225,236,108,128,246,245, 99,
+      3,  3,135,  3,142,  3,171,225,242,239,110,128,  1, 12,229,228,
+    233,236,236, 97,130,  0,199,  3,155,  3,163,225,227,245,244,101,
+    128, 30,  8,243,237,225,236,108,128,247,231,233,242, 99,  2,  3,
+    179,  3,184,236,101,128, 36,184,245,237,230,236,229,120,128,  1,
+      8,228,239,116,129,  1, 10,  3,201,225,227,227,229,238,116,128,
+      1, 10,229,228,233,236,236,225,243,237,225,236,108,128,247,184,
+    104,  4,  3,234,  3,246,  4,161,  4,165,225,225,242,237,229,238,
+    233,225,110,128,  5, 73,101,  6,  4,  4,  4, 24,  4, 35,  4,103,
+      4,115,  4,136,225,226,235,232,225,243,233,225,238,227,249,242,
+    233,236,236,233, 99,128,  4,188,227,249,242,233,236,236,233, 99,
+    128,  4, 39,100,  2,  4, 41,  4, 85,229,243,227,229,238,228,229,
+    114,  2,  4, 54,  4, 74,225,226,235,232,225,243,233,225,238,227,
+    249,242,233,236,236,233, 99,128,  4,190,227,249,242,233,236,236,
+    233, 99,128,  4,182,233,229,242,229,243,233,243,227,249,242,233,
+    236,236,233, 99,128,  4,244,232,225,242,237,229,238,233,225,110,
+    128,  5, 67,235,232,225,235,225,243,243,233,225,238,227,249,242,
+    233,236,236,233, 99,128,  4,203,246,229,242,244,233,227,225,236,
+    243,244,242,239,235,229,227,249,242,233,236,236,233, 99,128,  4,
+    184,105,128,  3,167,239,239,107,128,  1,135,233,242,227,245,237,
+    230,236,229,248,243,237,225,236,108,128,246,246,237,239,238,239,
+    243,240,225,227,101,128,255, 35,239,225,242,237,229,238,233,225,
+    110,128,  5, 81,243,237,225,236,108,128,247, 99, 68,142,  0, 68,
+      4,252,  5, 10,  5, 36,  5, 96,  5,121,  5,166,  5,173,  5,231,
+      5,244,  6,  0,  6, 12,  6, 28,  6, 48,  6, 57, 90,129,  1,241,
+      5,  2,227,225,242,239,110,128,  1,196, 97,  2,  5, 16,  5, 27,
+    225,242,237,229,238,233,225,110,128,  5, 52,230,242,233,227,225,
+    110,128,  1,137, 99,  4,  5, 46,  5, 53,  5, 62,  5, 89,225,242,
+    239,110,128,  1, 14,229,228,233,236,236, 97,128, 30, 16,233,242,
+     99,  2,  5, 70,  5, 75,236,101,128, 36,185,245,237,230,236,229,
+    248,226,229,236,239,119,128, 30, 18,242,239,225,116,128,  1, 16,
+    228,239,116,  2,  5,104,  5,113,225,227,227,229,238,116,128, 30,
+     10,226,229,236,239,119,128, 30, 12,101,  3,  5,129,  5,140,  5,
+    150,227,249,242,233,236,236,233, 99,128,  4, 20,233,227,239,240,
+    244,233, 99,128,  3,238,236,244, 97,129, 34,  6,  5,158,231,242,
+    229,229,107,128,  3,148,232,239,239,107,128,  1,138,105,  2,  5,
+    179,  5,218,229,242,229,243,233,115,131,246,203,  5,194,  5,202,
+      5,210,193,227,245,244,101,128,246,204,199,242,225,246,101,128,
+    246,205,243,237,225,236,108,128,247,168,231,225,237,237,225,231,
+    242,229,229,107,128,  3,220,234,229,227,249,242,233,236,236,233,
+     99,128,  4,  2,236,233,238,229,226,229,236,239,119,128, 30, 14,
+    237,239,238,239,243,240,225,227,101,128,255, 36,239,244,225,227,
+    227,229,238,244,243,237,225,236,108,128,246,247,115,  2,  6, 34,
+      6, 41,236,225,243,104,128,  1, 16,237,225,236,108,128,247,100,
+    244,239,240,226,225,114,128,  1,139,122,131,  1,242,  6, 67,  6,
+     75,  6,112,227,225,242,239,110,128,  1,197,101,  2,  6, 81,  6,
+    101,225,226,235,232,225,243,233,225,238,227,249,242,233,236,236,
+    233, 99,128,  4,224,227,249,242,233,236,236,233, 99,128,  4,  5,
+    232,229,227,249,242,233,236,236,233, 99,128,  4, 15, 69,146,  0,
+     69,  6,165,  6,183,  6,191,  7, 89,  7,153,  7,165,  7,183,  7,
+    211,  8,  7,  8, 36,  8, 94,  8,169,  8,189,  8,208,  8,248,  9,
+     44,  9,109,  9,115,225,227,245,244,101,129,  0,201,  6,175,243,
+    237,225,236,108,128,247,233,226,242,229,246,101,128,  1, 20, 99,
+      5,  6,203,  6,210,  6,224,  6,236,  7, 79,225,242,239,110,128,
+      1, 26,229,228,233,236,236,225,226,242,229,246,101,128, 30, 28,
+    232,225,242,237,229,238,233,225,110,128,  5, 53,233,242, 99,  2,
+      6,244,  6,249,236,101,128, 36,186,245,237,230,236,229,120,135,
+      0,202,  7, 16,  7, 24,  7, 32,  7, 43,  7, 51,  7, 63,  7, 71,
+    225,227,245,244,101,128, 30,190,226,229,236,239,119,128, 30, 24,
+    228,239,244,226,229,236,239,119,128, 30,198,231,242,225,246,101,
+    128, 30,192,232,239,239,235,225,226,239,246,101,128, 30,194,243,
+    237,225,236,108,128,247,234,244,233,236,228,101,128, 30,196,249,
+    242,233,236,236,233, 99,128,  4,  4,100,  3,  7, 97,  7,107,  7,
+    127,226,236,231,242,225,246,101,128,  2,  4,233,229,242,229,243,
+    233,115,129,  0,203,  7,119,243,237,225,236,108,128,247,235,239,
+    116,130,  1, 22,  7,136,  7,145,225,227,227,229,238,116,128,  1,
+     22,226,229,236,239,119,128, 30,184,230,227,249,242,233,236,236,
+    233, 99,128,  4, 36,231,242,225,246,101,129,  0,200,  7,175,243,
+    237,225,236,108,128,247,232,104,  2,  7,189,  7,200,225,242,237,
+    229,238,233,225,110,128,  5, 55,239,239,235,225,226,239,246,101,
+    128, 30,186,105,  3,  7,219,  7,230,  7,245,231,232,244,242,239,
+    237,225,110,128, 33,103,238,246,229,242,244,229,228,226,242,229,
+    246,101,128,  2,  6,239,244,233,230,233,229,228,227,249,242,233,
+    236,236,233, 99,128,  4,100,108,  2,  8, 13,  8, 24,227,249,242,
+    233,236,236,233, 99,128,  4, 27,229,246,229,238,242,239,237,225,
+    110,128, 33,106,109,  3,  8, 44,  8, 72,  8, 83,225,227,242,239,
+    110,130,  1, 18,  8, 56,  8, 64,225,227,245,244,101,128, 30, 22,
+    231,242,225,246,101,128, 30, 20,227,249,242,233,236,236,233, 99,
+    128,  4, 28,239,238,239,243,240,225,227,101,128,255, 37,110,  4,
+      8,104,  8,115,  8,135,  8,154,227,249,242,233,236,236,233, 99,
+    128,  4, 29,228,229,243,227,229,238,228,229,242,227,249,242,233,
+    236,236,233, 99,128,  4,162,103,129,  1, 74,  8,141,232,229,227,
+    249,242,233,236,236,233, 99,128,  4,164,232,239,239,235,227,249,
+    242,233,236,236,233, 99,128,  4,199,111,  2,  8,175,  8,183,231,
+    239,238,229,107,128,  1, 24,240,229,110,128,  1,144,240,243,233,
+    236,239,110,129,  3,149,  8,200,244,239,238,239,115,128,  3,136,
+    114,  2,  8,214,  8,225,227,249,242,233,236,236,233, 99,128,  4,
+     32,229,246,229,242,243,229,100,129,  1,142,  8,237,227,249,242,
+    233,236,236,233, 99,128,  4, 45,115,  4,  9,  2,  9, 13,  9, 33,
+      9, 37,227,249,242,233,236,236,233, 99,128,  4, 33,228,229,243,
+    227,229,238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,
+    170,104,128,  1,169,237,225,236,108,128,247,101,116,  3,  9, 52,
+      9, 78,  9, 92, 97,130,  3,151,  9, 60,  9, 70,242,237,229,238,
+    233,225,110,128,  5, 56,244,239,238,239,115,128,  3,137,104,129,
+      0,208,  9, 84,243,237,225,236,108,128,247,240,233,236,228,101,
+    129, 30,188,  9,101,226,229,236,239,119,128, 30, 26,245,242,111,
+    128, 32,172,250,104,130,  1,183,  9,124,  9,132,227,225,242,239,
+    110,128,  1,238,242,229,246,229,242,243,229,100,128,  1,184, 70,
+    136,  0, 70,  9,163,  9,172,  9,184,  9,212,  9,219,  9,248, 10,
+      4, 10, 15,227,233,242,227,236,101,128, 36,187,228,239,244,225,
+    227,227,229,238,116,128, 30, 30,101,  2,  9,190,  9,202,232,225,
+    242,237,229,238,233,225,110,128,  5, 86,233,227,239,240,244,233,
+     99,128,  3,228,232,239,239,107,128,  1,145,105,  2,  9,225,  9,
+    238,244,225,227,249,242,233,236,236,233, 99,128,  4,114,246,229,
+    242,239,237,225,110,128, 33,100,237,239,238,239,243,240,225,227,
+    101,128,255, 38,239,245,242,242,239,237,225,110,128, 33, 99,243,
+    237,225,236,108,128,247,102, 71,140,  0, 71, 10, 51, 10, 61, 10,
+    107, 10,115, 10,176, 10,193, 10,205, 11, 39, 11, 52, 11, 65, 11,
+     90, 11,107,194,243,241,245,225,242,101,128, 51,135, 97,  3, 10,
+     69, 10, 76, 10, 94,227,245,244,101,128,  1,244,237,237, 97,129,
+      3,147, 10, 84,225,230,242,233,227,225,110,128,  1,148,238,231,
+    233,225,227,239,240,244,233, 99,128,  3,234,226,242,229,246,101,
+    128,  1, 30, 99,  4, 10,125, 10,132, 10,141, 10,163,225,242,239,
+    110,128,  1,230,229,228,233,236,236, 97,128,  1, 34,233,242, 99,
+      2, 10,149, 10,154,236,101,128, 36,188,245,237,230,236,229,120,
+    128,  1, 28,239,237,237,225,225,227,227,229,238,116,128,  1, 34,
+    228,239,116,129,  1, 32, 10,184,225,227,227,229,238,116,128,  1,
+     32,229,227,249,242,233,236,236,233, 99,128,  4, 19,104,  3, 10,
+    213, 10,226, 11, 33,225,228,225,242,237,229,238,233,225,110,128,
+      5, 66,101,  3, 10,234, 10,255, 11, 16,237,233,228,228,236,229,
+    232,239,239,235,227,249,242,233,236,236,233, 99,128,  4,148,243,
+    244,242,239,235,229,227,249,242,233,236,236,233, 99,128,  4,146,
+    245,240,244,245,242,238,227,249,242,233,236,236,233, 99,128,  4,
+    144,239,239,107,128,  1,147,233,237,225,242,237,229,238,233,225,
+    110,128,  5, 51,234,229,227,249,242,233,236,236,233, 99,128,  4,
+      3,109,  2, 11, 71, 11, 79,225,227,242,239,110,128, 30, 32,239,
+    238,239,243,240,225,227,101,128,255, 39,242,225,246,101,129,246,
+    206, 11, 99,243,237,225,236,108,128,247, 96,115,  2, 11,113, 11,
+    129,237,225,236,108,129,247,103, 11,122,232,239,239,107,128,  2,
+    155,244,242,239,235,101,128,  1,228, 72,140,  0, 72, 11,165, 11,
+    190, 11,198, 11,208, 12, 17, 12, 40, 12, 77, 12,117, 12,129, 12,
+    157, 12,165, 12,189,177,184, 53,  3, 11,175, 11,180, 11,185,179,
+     51,128, 37,207,180, 51,128, 37,170,181, 49,128, 37,171,178,178,
+    176,183, 51,128, 37,161,208,243,241,245,225,242,101,128, 51,203,
+     97,  3, 11,216, 11,236, 12,  0,225,226,235,232,225,243,233,225,
+    238,227,249,242,233,236,236,233, 99,128,  4,168,228,229,243,227,
+    229,238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,178,
+    242,228,243,233,231,238,227,249,242,233,236,236,233, 99,128,  4,
+     42, 98,  2, 12, 23, 12, 28,225,114,128,  1, 38,242,229,246,229,
+    226,229,236,239,119,128, 30, 42, 99,  2, 12, 46, 12, 55,229,228,
+    233,236,236, 97,128, 30, 40,233,242, 99,  2, 12, 63, 12, 68,236,
+    101,128, 36,189,245,237,230,236,229,120,128,  1, 36,100,  2, 12,
+     83, 12, 93,233,229,242,229,243,233,115,128, 30, 38,239,116,  2,
+     12,100, 12,109,225,227,227,229,238,116,128, 30, 34,226,229,236,
+    239,119,128, 30, 36,237,239,238,239,243,240,225,227,101,128,255,
+     40,111,  2, 12,135, 12,146,225,242,237,229,238,233,225,110,128,
+      5, 64,242,233,227,239,240,244,233, 99,128,  3,232,243,237,225,
+    236,108,128,247,104,245,238,231,225,242,245,237,236,225,245,116,
+    129,246,207, 12,181,243,237,225,236,108,128,246,248,250,243,241,
+    245,225,242,101,128, 51,144, 73,146,  0, 73, 12,239, 12,251, 12,
+    255, 13, 11, 13, 29, 13, 37, 13, 94, 13,181, 13,214, 13,224, 13,
+    242, 13,254, 14, 48, 14, 86, 14, 99, 14,166, 14,187, 14,205,193,
+    227,249,242,233,236,236,233, 99,128,  4, 47, 74,128,  1, 50,213,
+    227,249,242,233,236,236,233, 99,128,  4, 46,225,227,245,244,101,
+    129,  0,205, 13, 21,243,237,225,236,108,128,247,237,226,242,229,
+    246,101,128,  1, 44, 99,  3, 13, 45, 13, 52, 13, 84,225,242,239,
+    110,128,  1,207,233,242, 99,  2, 13, 60, 13, 65,236,101,128, 36,
+    190,245,237,230,236,229,120,129,  0,206, 13, 76,243,237,225,236,
+    108,128,247,238,249,242,233,236,236,233, 99,128,  4,  6,100,  3,
+     13,102, 13,112, 13,155,226,236,231,242,225,246,101,128,  2,  8,
+    233,229,242,229,243,233,115,131,  0,207, 13,128, 13,136, 13,147,
+    225,227,245,244,101,128, 30, 46,227,249,242,233,236,236,233, 99,
+    128,  4,228,243,237,225,236,108,128,247,239,239,116,130,  1, 48,
+     13,164, 13,173,225,227,227,229,238,116,128,  1, 48,226,229,236,
+    239,119,128, 30,202,101,  2, 13,187, 13,203,226,242,229,246,229,
+    227,249,242,233,236,236,233, 99,128,  4,214,227,249,242,233,236,
+    236,233, 99,128,  4, 21,230,242,225,235,244,245,114,128, 33, 17,
+    231,242,225,246,101,129,  0,204, 13,234,243,237,225,236,108,128,
+    247,236,232,239,239,235,225,226,239,246,101,128, 30,200,105,  3,
+     14,  6, 14, 17, 14, 32,227,249,242,233,236,236,233, 99,128,  4,
+     24,238,246,229,242,244,229,228,226,242,229,246,101,128,  2, 10,
+    243,232,239,242,244,227,249,242,233,236,236,233, 99,128,  4, 25,
+    109,  2, 14, 54, 14, 75,225,227,242,239,110,129,  1, 42, 14, 64,
+    227,249,242,233,236,236,233, 99,128,  4,226,239,238,239,243,240,
+    225,227,101,128,255, 41,238,233,225,242,237,229,238,233,225,110,
+    128,  5, 59,111,  3, 14,107, 14,118, 14,126,227,249,242,233,236,
+    236,233, 99,128,  4,  1,231,239,238,229,107,128,  1, 46,244, 97,
+    131,  3,153, 14,137, 14,147, 14,158,225,230,242,233,227,225,110,
+    128,  1,150,228,233,229,242,229,243,233,115,128,  3,170,244,239,
+    238,239,115,128,  3,138,115,  2, 14,172, 14,179,237,225,236,108,
+    128,247,105,244,242,239,235,101,128,  1,151,244,233,236,228,101,
+    129,  1, 40, 14,197,226,229,236,239,119,128, 30, 44,250,232,233,
+    244,243, 97,  2, 14,216, 14,227,227,249,242,233,236,236,233, 99,
+    128,  4,116,228,226,236,231,242,225,246,229,227,249,242,233,236,
+    236,233, 99,128,  4,118, 74,134,  0, 74, 15,  6, 15, 18, 15, 41,
+     15, 53, 15, 67, 15, 79,225,225,242,237,229,238,233,225,110,128,
+      5, 65,227,233,242, 99,  2, 15, 27, 15, 32,236,101,128, 36,191,
+    245,237,230,236,229,120,128,  1, 52,229,227,249,242,233,236,236,
+    233, 99,128,  4,  8,232,229,232,225,242,237,229,238,233,225,110,
+    128,  5, 75,237,239,238,239,243,240,225,227,101,128,255, 42,243,
+    237,225,236,108,128,247,106, 75,140,  0, 75, 15,115, 15,125, 15,
+    135, 16, 18, 16, 65, 16, 76, 16,106, 16,143, 16,156, 16,168, 16,
+    180, 16,208,194,243,241,245,225,242,101,128, 51,133,203,243,241,
+    245,225,242,101,128, 51,205, 97,  7, 15,151, 15,169, 15,191, 15,
+    211, 15,226, 15,232, 15,249,226,225,243,232,235,233,242,227,249,
+    242,233,236,236,233, 99,128,  4,160, 99,  2, 15,175, 15,181,245,
+    244,101,128, 30, 48,249,242,233,236,236,233, 99,128,  4, 26,228,
+    229,243,227,229,238,228,229,242,227,249,242,233,236,236,233, 99,
+    128,  4,154,232,239,239,235,227,249,242,233,236,236,233, 99,128,
+      4,195,240,240, 97,128,  3,154,243,244,242,239,235,229,227,249,
+    242,233,236,236,233, 99,128,  4,158,246,229,242,244,233,227,225,
+    236,243,244,242,239,235,229,227,249,242,233,236,236,233, 99,128,
+      4,156, 99,  4, 16, 28, 16, 35, 16, 44, 16, 52,225,242,239,110,
+    128,  1,232,229,228,233,236,236, 97,128,  1, 54,233,242,227,236,
+    101,128, 36,192,239,237,237,225,225,227,227,229,238,116,128,  1,
+     54,228,239,244,226,229,236,239,119,128, 30, 50,101,  2, 16, 82,
+     16, 94,232,225,242,237,229,238,233,225,110,128,  5, 84,238,225,
+    242,237,229,238,233,225,110,128,  5, 63,104,  3, 16,114, 16,126,
+     16,137,225,227,249,242,233,236,236,233, 99,128,  4, 37,229,233,
+    227,239,240,244,233, 99,128,  3,230,239,239,107,128,  1,152,234,
+    229,227,249,242,233,236,236,233, 99,128,  4, 12,236,233,238,229,
+    226,229,236,239,119,128, 30, 52,237,239,238,239,243,240,225,227,
+    101,128,255, 43,239,240,240, 97,  2, 16,189, 16,200,227,249,242,
+    233,236,236,233, 99,128,  4,128,231,242,229,229,107,128,  3,222,
+    115,  2, 16,214, 16,226,233,227,249,242,233,236,236,233, 99,128,
+      4,110,237,225,236,108,128,247,107, 76,138,  0, 76, 17,  1, 17,
+      5, 17,  9, 17, 29, 17, 95, 17,133, 17,147, 17,165, 17,177, 17,
+    189, 74,128,  1,199, 76,128,246,191, 97,  2, 17, 15, 17, 22,227,
+    245,244,101,128,  1, 57,237,226,228, 97,128,  3,155, 99,  4, 17,
+     39, 17, 46, 17, 55, 17, 82,225,242,239,110,128,  1, 61,229,228,
+    233,236,236, 97,128,  1, 59,233,242, 99,  2, 17, 63, 17, 68,236,
+    101,128, 36,193,245,237,230,236,229,248,226,229,236,239,119,128,
+     30, 60,239,237,237,225,225,227,227,229,238,116,128,  1, 59,228,
+    239,116,130,  1, 63, 17,105, 17,114,225,227,227,229,238,116,128,
+      1, 63,226,229,236,239,119,129, 30, 54, 17,124,237,225,227,242,
+    239,110,128, 30, 56,233,247,238,225,242,237,229,238,233,225,110,
+    128,  5, 60,106,129,  1,200, 17,153,229,227,249,242,233,236,236,
+    233, 99,128,  4,  9,236,233,238,229,226,229,236,239,119,128, 30,
+     58,237,239,238,239,243,240,225,227,101,128,255, 44,115,  2, 17,
+    195, 17,212,236,225,243,104,129,  1, 65, 17,204,243,237,225,236,
+    108,128,246,249,237,225,236,108,128,247,108, 77,137,  0, 77, 17,
+    241, 17,251, 18, 24, 18, 33, 18, 58, 18, 71, 18, 83, 18, 91, 18,
+    100,194,243,241,245,225,242,101,128, 51,134,225, 99,  2, 18,  2,
+     18, 18,242,239,110,129,246,208, 18, 10,243,237,225,236,108,128,
+    247,175,245,244,101,128, 30, 62,227,233,242,227,236,101,128, 36,
+    194,228,239,116,  2, 18, 41, 18, 50,225,227,227,229,238,116,128,
+     30, 64,226,229,236,239,119,128, 30, 66,229,238,225,242,237,229,
+    238,233,225,110,128,  5, 68,237,239,238,239,243,240,225,227,101,
+    128,255, 45,243,237,225,236,108,128,247,109,244,245,242,238,229,
+    100,128,  1,156,117,128,  3,156, 78,141,  0, 78, 18,134, 18,138,
+     18,146, 18,212, 18,237, 18,248, 19,  3, 19, 21, 19, 33, 19, 45,
+     19, 58, 19, 66, 19, 84, 74,128,  1,202,225,227,245,244,101,128,
+      1, 67, 99,  4, 18,156, 18,163, 18,172, 18,199,225,242,239,110,
+    128,  1, 71,229,228,233,236,236, 97,128,  1, 69,233,242, 99,  2,
+     18,180, 18,185,236,101,128, 36,195,245,237,230,236,229,248,226,
+    229,236,239,119,128, 30, 74,239,237,237,225,225,227,227,229,238,
+    116,128,  1, 69,228,239,116,  2, 18,220, 18,229,225,227,227,229,
+    238,116,128, 30, 68,226,229,236,239,119,128, 30, 70,232,239,239,
+    235,236,229,230,116,128,  1,157,233,238,229,242,239,237,225,110,
+    128, 33,104,106,129,  1,203, 19,  9,229,227,249,242,233,236,236,
+    233, 99,128,  4, 10,236,233,238,229,226,229,236,239,119,128, 30,
+     72,237,239,238,239,243,240,225,227,101,128,255, 46,239,247,225,
+    242,237,229,238,233,225,110,128,  5, 70,243,237,225,236,108,128,
+    247,110,244,233,236,228,101,129,  0,209, 19, 76,243,237,225,236,
+    108,128,247,241,117,128,  3,157, 79,141,  0, 79, 19,118, 19,132,
+     19,150, 19,203, 20, 78, 20,152, 20,187, 21, 48, 21, 69, 21,213,
+     21,223, 21,254, 22, 53, 69,129,  1, 82, 19,124,243,237,225,236,
+    108,128,246,250,225,227,245,244,101,129,  0,211, 19,142,243,237,
+    225,236,108,128,247,243, 98,  2, 19,156, 19,196,225,242,242,229,
+    100,  2, 19,166, 19,177,227,249,242,233,236,236,233, 99,128,  4,
+    232,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233,
+     99,128,  4,234,242,229,246,101,128,  1, 78, 99,  4, 19,213, 19,
+    220, 19,235, 20, 68,225,242,239,110,128,  1,209,229,238,244,229,
+    242,229,228,244,233,236,228,101,128,  1,159,233,242, 99,  2, 19,
+    243, 19,248,236,101,128, 36,196,245,237,230,236,229,120,134,  0,
+    212, 20, 13, 20, 21, 20, 32, 20, 40, 20, 52, 20, 60,225,227,245,
+    244,101,128, 30,208,228,239,244,226,229,236,239,119,128, 30,216,
+    231,242,225,246,101,128, 30,210,232,239,239,235,225,226,239,246,
+    101,128, 30,212,243,237,225,236,108,128,247,244,244,233,236,228,
+    101,128, 30,214,249,242,233,236,236,233, 99,128,  4, 30,100,  3,
+     20, 86, 20,109, 20,142,226,108,  2, 20, 93, 20,101,225,227,245,
+    244,101,128,  1, 80,231,242,225,246,101,128,  2, 12,233,229,242,
+    229,243,233,115,130,  0,214, 20,123, 20,134,227,249,242,233,236,
+    236,233, 99,128,  4,230,243,237,225,236,108,128,247,246,239,244,
+    226,229,236,239,119,128, 30,204,103,  2, 20,158, 20,170,239,238,
+    229,235,243,237,225,236,108,128,246,251,242,225,246,101,129,  0,
+    210, 20,179,243,237,225,236,108,128,247,242,104,  4, 20,197, 20,
+    208, 20,212, 21, 34,225,242,237,229,238,233,225,110,128,  5, 85,
+    109,128, 33, 38,111,  2, 20,218, 20,228,239,235,225,226,239,246,
+    101,128, 30,206,242,110,133,  1,160, 20,243, 20,251, 21,  6, 21,
+     14, 21, 26,225,227,245,244,101,128, 30,218,228,239,244,226,229,
+    236,239,119,128, 30,226,231,242,225,246,101,128, 30,220,232,239,
+    239,235,225,226,239,246,101,128, 30,222,244,233,236,228,101,128,
+     30,224,245,238,231,225,242,245,237,236,225,245,116,128,  1, 80,
+    105,129,  1,162, 21, 54,238,246,229,242,244,229,228,226,242,229,
+    246,101,128,  2, 14,109,  4, 21, 79, 21,107, 21,184, 21,202,225,
+    227,242,239,110,130,  1, 76, 21, 91, 21, 99,225,227,245,244,101,
+    128, 30, 82,231,242,225,246,101,128, 30, 80,229,231, 97,132, 33,
+     38, 21,121, 21,132, 21,140, 21,156,227,249,242,233,236,236,233,
+     99,128,  4, 96,231,242,229,229,107,128,  3,169,242,239,245,238,
+    228,227,249,242,233,236,236,233, 99,128,  4,122,116,  2, 21,162,
+     21,177,233,244,236,239,227,249,242,233,236,236,233, 99,128,  4,
+    124,239,238,239,115,128,  3,143,233,227,242,239,110,129,  3,159,
+     21,194,244,239,238,239,115,128,  3,140,239,238,239,243,240,225,
+    227,101,128,255, 47,238,229,242,239,237,225,110,128, 33, 96,111,
+      2, 21,229, 21,248,231,239,238,229,107,129,  1,234, 21,239,237,
+    225,227,242,239,110,128,  1,236,240,229,110,128,  1,134,115,  3,
+     22,  6, 22, 33, 22, 40,236,225,243,104,130,  0,216, 22, 17, 22,
+     25,225,227,245,244,101,128,  1,254,243,237,225,236,108,128,247,
+    248,237,225,236,108,128,247,111,244,242,239,235,229,225,227,245,
+    244,101,128,  1,254,116,  2, 22, 59, 22, 70,227,249,242,233,236,
+    236,233, 99,128,  4,126,233,236,228,101,131,  0,213, 22, 83, 22,
+     91, 22,102,225,227,245,244,101,128, 30, 76,228,233,229,242,229,
+    243,233,115,128, 30, 78,243,237,225,236,108,128,247,245, 80,136,
+      0, 80, 22,130, 22,138, 22,147, 22,159, 22,211, 22,227, 22,246,
+     23,  2,225,227,245,244,101,128, 30, 84,227,233,242,227,236,101,
+    128, 36,197,228,239,244,225,227,227,229,238,116,128, 30, 86,101,
+      3, 22,167, 22,178, 22,190,227,249,242,233,236,236,233, 99,128,
+      4, 31,232,225,242,237,229,238,233,225,110,128,  5, 74,237,233,
+    228,228,236,229,232,239,239,235,227,249,242,233,236,236,233, 99,
+    128,  4,166,104,  2, 22,217, 22,221,105,128,  3,166,239,239,107,
+    128,  1,164,105,129,  3,160, 22,233,247,242,225,242,237,229,238,
+    233,225,110,128,  5, 83,237,239,238,239,243,240,225,227,101,128,
+    255, 48,115,  2, 23,  8, 23, 25,105,129,  3,168, 23, 14,227,249,
+    242,233,236,236,233, 99,128,  4,112,237,225,236,108,128,247,112,
+     81,131,  0, 81, 23, 42, 23, 51, 23, 63,227,233,242,227,236,101,
+    128, 36,198,237,239,238,239,243,240,225,227,101,128,255, 49,243,
+    237,225,236,108,128,247,113, 82,138,  0, 82, 23, 95, 23,119, 23,
+    166, 23,217, 23,230, 23,240, 23,245, 24, 19, 24, 31, 24, 43, 97,
+      2, 23,101, 23,112,225,242,237,229,238,233,225,110,128,  5, 76,
+    227,245,244,101,128,  1, 84, 99,  4, 23,129, 23,136, 23,145, 23,
+    153,225,242,239,110,128,  1, 88,229,228,233,236,236, 97,128,  1,
+     86,233,242,227,236,101,128, 36,199,239,237,237,225,225,227,227,
+    229,238,116,128,  1, 86,100,  2, 23,172, 23,182,226,236,231,242,
+    225,246,101,128,  2, 16,239,116,  2, 23,189, 23,198,225,227,227,
+    229,238,116,128, 30, 88,226,229,236,239,119,129, 30, 90, 23,208,
+    237,225,227,242,239,110,128, 30, 92,229,232,225,242,237,229,238,
+    233,225,110,128,  5, 80,230,242,225,235,244,245,114,128, 33, 28,
+    232,111,128,  3,161,233,110,  2, 23,252, 24,  5,231,243,237,225,
+    236,108,128,246,252,246,229,242,244,229,228,226,242,229,246,101,
+    128,  2, 18,236,233,238,229,226,229,236,239,119,128, 30, 94,237,
+    239,238,239,243,240,225,227,101,128,255, 50,243,237,225,236,108,
+    129,247,114, 24, 53,233,238,246,229,242,244,229,100,129,  2,129,
+     24, 66,243,245,240,229,242,233,239,114,128,  2,182, 83,139,  0,
+     83, 24,103, 26, 17, 26, 55, 26,182, 26,221, 26,250, 27, 84, 27,
+    105, 27,117, 27,135, 27,143, 70,  6, 24,117, 24,209, 24,241, 25,
+     77, 25,119, 25,221, 48,  9, 24,137, 24,145, 24,153, 24,161, 24,
+    169, 24,177, 24,185, 24,193, 24,201,177,176,176,176, 48,128, 37,
+     12,178,176,176,176, 48,128, 37, 20,179,176,176,176, 48,128, 37,
+     16,180,176,176,176, 48,128, 37, 24,181,176,176,176, 48,128, 37,
+     60,182,176,176,176, 48,128, 37, 44,183,176,176,176, 48,128, 37,
+     52,184,176,176,176, 48,128, 37, 28,185,176,176,176, 48,128, 37,
+     36, 49,  3, 24,217, 24,225, 24,233,176,176,176,176, 48,128, 37,
+      0,177,176,176,176, 48,128, 37,  2,185,176,176,176, 48,128, 37,
+     97, 50,  9, 25,  5, 25, 13, 25, 21, 25, 29, 25, 37, 25, 45, 25,
+     53, 25, 61, 25, 69,176,176,176,176, 48,128, 37, 98,177,176,176,
+    176, 48,128, 37, 86,178,176,176,176, 48,128, 37, 85,179,176,176,
+    176, 48,128, 37, 99,180,176,176,176, 48,128, 37, 81,181,176,176,
+    176, 48,128, 37, 87,182,176,176,176, 48,128, 37, 93,183,176,176,
+    176, 48,128, 37, 92,184,176,176,176, 48,128, 37, 91, 51,  4, 25,
+     87, 25, 95, 25,103, 25,111,182,176,176,176, 48,128, 37, 94,183,
+    176,176,176, 48,128, 37, 95,184,176,176,176, 48,128, 37, 90,185,
+    176,176,176, 48,128, 37, 84, 52, 10, 25,141, 25,149, 25,157, 25,
+    165, 25,173, 25,181, 25,189, 25,197, 25,205, 25,213,176,176,176,
+    176, 48,128, 37,105,177,176,176,176, 48,128, 37,102,178,176,176,
+    176, 48,128, 37, 96,179,176,176,176, 48,128, 37, 80,180,176,176,
+    176, 48,128, 37,108,181,176,176,176, 48,128, 37,103,182,176,176,
+    176, 48,128, 37,104,183,176,176,176, 48,128, 37,100,184,176,176,
+    176, 48,128, 37,101,185,176,176,176, 48,128, 37, 89, 53,  5, 25,
+    233, 25,241, 25,249, 26,  1, 26,  9,176,176,176,176, 48,128, 37,
+     88,177,176,176,176, 48,128, 37, 82,178,176,176,176, 48,128, 37,
+     83,179,176,176,176, 48,128, 37,107,180,176,176,176, 48,128, 37,
+    106, 97,  2, 26, 23, 26, 44,227,245,244,101,129,  1, 90, 26, 32,
+    228,239,244,225,227,227,229,238,116,128, 30,100,237,240,233,231,
+    242,229,229,107,128,  3,224, 99,  5, 26, 67, 26, 98, 26,107, 26,
+    147, 26,169,225,242,239,110,130,  1, 96, 26, 78, 26, 90,228,239,
+    244,225,227,227,229,238,116,128, 30,102,243,237,225,236,108,128,
+    246,253,229,228,233,236,236, 97,128,  1, 94,232,247, 97,130,  1,
+    143, 26,117, 26,128,227,249,242,233,236,236,233, 99,128,  4,216,
+    228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,
+    128,  4,218,233,242, 99,  2, 26,155, 26,160,236,101,128, 36,200,
+    245,237,230,236,229,120,128,  1, 92,239,237,237,225,225,227,227,
+    229,238,116,128,  2, 24,228,239,116,  2, 26,190, 26,199,225,227,
+    227,229,238,116,128, 30, 96,226,229,236,239,119,129, 30, 98, 26,
+    209,228,239,244,225,227,227,229,238,116,128, 30,104,101,  2, 26,
+    227, 26,239,232,225,242,237,229,238,233,225,110,128,  5, 77,246,
+    229,238,242,239,237,225,110,128, 33,102,104,  5, 27,  6, 27, 34,
+     27, 48, 27, 59, 27, 72, 97,  2, 27, 12, 27, 23,225,242,237,229,
+    238,233,225,110,128,  5, 71,227,249,242,233,236,236,233, 99,128,
+      4, 40,227,232,225,227,249,242,233,236,236,233, 99,128,  4, 41,
+    229,233,227,239,240,244,233, 99,128,  3,226,232,225,227,249,242,
+    233,236,236,233, 99,128,  4,186,233,237,225,227,239,240,244,233,
+     99,128,  3,236,105,  2, 27, 90, 27, 96,231,237, 97,128,  3,163,
+    248,242,239,237,225,110,128, 33,101,237,239,238,239,243,240,225,
+    227,101,128,255, 51,239,230,244,243,233,231,238,227,249,242,233,
+    236,236,233, 99,128,  4, 44,243,237,225,236,108,128,247,115,244,
+    233,231,237,225,231,242,229,229,107,128,  3,218, 84,141,  0, 84,
+     27,186, 27,191, 27,197, 28,  7, 28, 32, 28, 96, 28,147, 28,177,
+     28,189, 28,201, 28,246, 29,  6, 29, 46,225,117,128,  3,164,226,
+    225,114,128,  1,102, 99,  4, 27,207, 27,214, 27,223, 27,250,225,
+    242,239,110,128,  1,100,229,228,233,236,236, 97,128,  1, 98,233,
+    242, 99,  2, 27,231, 27,236,236,101,128, 36,201,245,237,230,236,
+    229,248,226,229,236,239,119,128, 30,112,239,237,237,225,225,227,
+    227,229,238,116,128,  1, 98,228,239,116,  2, 28, 15, 28, 24,225,
+    227,227,229,238,116,128, 30,106,226,229,236,239,119,128, 30,108,
+    101,  4, 28, 42, 28, 53, 28, 73, 28, 82,227,249,242,233,236,236,
+    233, 99,128,  4, 34,228,229,243,227,229,238,228,229,242,227,249,
+    242,233,236,236,233, 99,128,  4,172,238,242,239,237,225,110,128,
+     33,105,244,243,229,227,249,242,233,236,236,233, 99,128,  4,180,
+    104,  3, 28,104, 28,110, 28,136,229,244, 97,128,  3,152,111,  2,
+     28,116, 28,121,239,107,128,  1,172,242,110,129,  0,222, 28,128,
+    243,237,225,236,108,128,247,254,242,229,229,242,239,237,225,110,
+    128, 33, 98,105,  2, 28,153, 28,164,236,228,229,243,237,225,236,
+    108,128,246,254,247,238,225,242,237,229,238,233,225,110,128,  5,
+     79,236,233,238,229,226,229,236,239,119,128, 30,110,237,239,238,
+    239,243,240,225,227,101,128,255, 52,111,  2, 28,207, 28,218,225,
+    242,237,229,238,233,225,110,128,  5, 57,238,101,  3, 28,227, 28,
+    234, 28,240,230,233,246,101,128,  1,188,243,233,120,128,  1,132,
+    244,247,111,128,  1,167,242,229,244,242,239,230,236,229,248,232,
+    239,239,107,128,  1,174,115,  3, 29, 14, 29, 26, 29, 39,229,227,
+    249,242,233,236,236,233, 99,128,  4, 38,232,229,227,249,242,233,
+    236,236,233, 99,128,  4, 11,237,225,236,108,128,247,116,119,  2,
+     29, 52, 29, 64,229,236,246,229,242,239,237,225,110,128, 33,107,
+    239,242,239,237,225,110,128, 33, 97, 85,142,  0, 85, 29,105, 29,
+    123, 29,131, 29,198, 30, 69, 30, 87, 30,198, 30,214, 30,226, 31,
+     21, 31, 30, 31,142, 31,149, 31,219,225,227,245,244,101,129,  0,
+    218, 29,115,243,237,225,236,108,128,247,250,226,242,229,246,101,
+    128,  1,108, 99,  3, 29,139, 29,146, 29,188,225,242,239,110,128,
+      1,211,233,242, 99,  2, 29,154, 29,159,236,101,128, 36,202,245,
+    237,230,236,229,120,130,  0,219, 29,172, 29,180,226,229,236,239,
+    119,128, 30,118,243,237,225,236,108,128,247,251,249,242,233,236,
+    236,233, 99,128,  4, 35,100,  3, 29,206, 29,229, 30, 59,226,108,
+      2, 29,213, 29,221,225,227,245,244,101,128,  1,112,231,242,225,
+    246,101,128,  2, 20,233,229,242,229,243,233,115,134,  0,220, 29,
+    251, 30,  3, 30, 11, 30, 34, 30, 42, 30, 51,225,227,245,244,101,
+    128,  1,215,226,229,236,239,119,128, 30,114, 99,  2, 30, 17, 30,
+     24,225,242,239,110,128,  1,217,249,242,233,236,236,233, 99,128,
+      4,240,231,242,225,246,101,128,  1,219,237,225,227,242,239,110,
+    128,  1,213,243,237,225,236,108,128,247,252,239,244,226,229,236,
+    239,119,128, 30,228,231,242,225,246,101,129,  0,217, 30, 79,243,
+    237,225,236,108,128,247,249,104,  2, 30, 93, 30,171,111,  2, 30,
+     99, 30,109,239,235,225,226,239,246,101,128, 30,230,242,110,133,
+      1,175, 30,124, 30,132, 30,143, 30,151, 30,163,225,227,245,244,
+    101,128, 30,232,228,239,244,226,229,236,239,119,128, 30,240,231,
+    242,225,246,101,128, 30,234,232,239,239,235,225,226,239,246,101,
+    128, 30,236,244,233,236,228,101,128, 30,238,245,238,231,225,242,
+    245,237,236,225,245,116,129,  1,112, 30,187,227,249,242,233,236,
+    236,233, 99,128,  4,242,233,238,246,229,242,244,229,228,226,242,
+    229,246,101,128,  2, 22,235,227,249,242,233,236,236,233, 99,128,
+      4,120,109,  2, 30,232, 31, 10,225,227,242,239,110,130,  1,106,
+     30,244, 30,255,227,249,242,233,236,236,233, 99,128,  4,238,228,
+    233,229,242,229,243,233,115,128, 30,122,239,238,239,243,240,225,
+    227,101,128,255, 53,239,231,239,238,229,107,128,  1,114,240,243,
+    233,236,239,110,133,  3,165, 31, 49, 31, 53, 31, 90, 31,121, 31,
+    134, 49,128,  3,210, 97,  2, 31, 59, 31, 81,227,245,244,229,232,
+    239,239,235,243,249,237,226,239,236,231,242,229,229,107,128,  3,
+    211,230,242,233,227,225,110,128,  1,177,228,233,229,242,229,243,
+    233,115,129,  3,171, 31,103,232,239,239,235,243,249,237,226,239,
+    236,231,242,229,229,107,128,  3,212,232,239,239,235,243,249,237,
+    226,239,108,128,  3,210,244,239,238,239,115,128,  3,142,242,233,
+    238,103,128,  1,110,115,  3, 31,157, 31,172, 31,179,232,239,242,
+    244,227,249,242,233,236,236,233, 99,128,  4, 14,237,225,236,108,
+    128,247,117,244,242,225,233,231,232,116,  2, 31,191, 31,202,227,
+    249,242,233,236,236,233, 99,128,  4,174,243,244,242,239,235,229,
+    227,249,242,233,236,236,233, 99,128,  4,176,244,233,236,228,101,
+    130,  1,104, 31,231, 31,239,225,227,245,244,101,128, 30,120,226,
+    229,236,239,119,128, 30,116, 86,136,  0, 86, 32, 11, 32, 20, 32,
+     31, 32, 60, 32, 67, 32, 79, 32, 91, 32, 99,227,233,242,227,236,
+    101,128, 36,203,228,239,244,226,229,236,239,119,128, 30,126,101,
+      2, 32, 37, 32, 48,227,249,242,233,236,236,233, 99,128,  4, 18,
+    247,225,242,237,229,238,233,225,110,128,  5, 78,232,239,239,107,
+    128,  1,178,237,239,238,239,243,240,225,227,101,128,255, 54,239,
+    225,242,237,229,238,233,225,110,128,  5, 72,243,237,225,236,108,
+    128,247,118,244,233,236,228,101,128, 30,124, 87,134,  0, 87, 32,
+    123, 32,131, 32,154, 32,194, 32,202, 32,214,225,227,245,244,101,
+    128, 30,130,227,233,242, 99,  2, 32,140, 32,145,236,101,128, 36,
+    204,245,237,230,236,229,120,128,  1,116,100,  2, 32,160, 32,170,
+    233,229,242,229,243,233,115,128, 30,132,239,116,  2, 32,177, 32,
+    186,225,227,227,229,238,116,128, 30,134,226,229,236,239,119,128,
+     30,136,231,242,225,246,101,128, 30,128,237,239,238,239,243,240,
+    225,227,101,128,255, 55,243,237,225,236,108,128,247,119, 88,134,
+      0, 88, 32,238, 32,247, 33, 18, 33, 31, 33, 35, 33, 47,227,233,
+    242,227,236,101,128, 36,205,100,  2, 32,253, 33,  7,233,229,242,
+    229,243,233,115,128, 30,140,239,244,225,227,227,229,238,116,128,
+     30,138,229,232,225,242,237,229,238,233,225,110,128,  5, 61,105,
+    128,  3,158,237,239,238,239,243,240,225,227,101,128,255, 56,243,
+    237,225,236,108,128,247,120, 89,139,  0, 89, 33, 81, 33,116, 33,
+    139, 33,189, 33,228, 33,236, 33,253, 34, 40, 34, 52, 34, 60, 34,
+     68, 97,  2, 33, 87, 33,104,227,245,244,101,129,  0,221, 33, 96,
+    243,237,225,236,108,128,247,253,244,227,249,242,233,236,236,233,
+     99,128,  4, 98,227,233,242, 99,  2, 33,125, 33,130,236,101,128,
+     36,206,245,237,230,236,229,120,128,  1,118,100,  2, 33,145, 33,
+    165,233,229,242,229,243,233,115,129,  1,120, 33,157,243,237,225,
+    236,108,128,247,255,239,116,  2, 33,172, 33,181,225,227,227,229,
+    238,116,128, 30,142,226,229,236,239,119,128, 30,244,229,114,  2,
+     33,196, 33,208,233,227,249,242,233,236,236,233, 99,128,  4, 43,
+    245,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233,
+     99,128,  4,248,231,242,225,246,101,128, 30,242,232,239,239,107,
+    129,  1,179, 33,245,225,226,239,246,101,128, 30,246,105,  3, 34,
+      5, 34, 16, 34, 27,225,242,237,229,238,233,225,110,128,  5, 69,
+    227,249,242,233,236,236,233, 99,128,  4,  7,247,238,225,242,237,
+    229,238,233,225,110,128,  5, 82,237,239,238,239,243,240,225,227,
+    101,128,255, 57,243,237,225,236,108,128,247,121,244,233,236,228,
+    101,128, 30,248,245,115,  2, 34, 75, 34,113,226,233,103,  2, 34,
+     83, 34, 94,227,249,242,233,236,236,233, 99,128,  4,106,233,239,
+    244,233,230,233,229,228,227,249,242,233,236,236,233, 99,128,  4,
+    108,236,233,244,244,236,101,  2, 34,124, 34,135,227,249,242,233,
+    236,236,233, 99,128,  4,102,233,239,244,233,230,233,229,228,227,
+    249,242,233,236,236,233, 99,128,  4,104, 90,136,  0, 90, 34,174,
+     34,198, 34,243, 35, 14, 35, 81, 35,173, 35,185, 35,197, 97,  2,
+     34,180, 34,191,225,242,237,229,238,233,225,110,128,  5, 54,227,
+    245,244,101,128,  1,121, 99,  2, 34,204, 34,221,225,242,239,110,
+    129,  1,125, 34,213,243,237,225,236,108,128,246,255,233,242, 99,
+      2, 34,229, 34,234,236,101,128, 36,207,245,237,230,236,229,120,
+    128, 30,144,228,239,116,130,  1,123, 34,253, 35,  6,225,227,227,
+    229,238,116,128,  1,123,226,229,236,239,119,128, 30,146,101,  3,
+     35, 22, 35, 33, 35, 76,227,249,242,233,236,236,233, 99,128,  4,
+     23,100,  2, 35, 39, 35, 58,229,243,227,229,238,228,229,242,227,
+    249,242,233,236,236,233, 99,128,  4,152,233,229,242,229,243,233,
+    243,227,249,242,233,236,236,233, 99,128,  4,222,244, 97,128,  3,
+    150,232,101,  4, 35, 92, 35,103, 35,119, 35,130,225,242,237,229,
+    238,233,225,110,128,  5, 58,226,242,229,246,229,227,249,242,233,
+    236,236,233, 99,128,  4,193,227,249,242,233,236,236,233, 99,128,
+      4, 22,100,  2, 35,136, 35,155,229,243,227,229,238,228,229,242,
+    227,249,242,233,236,236,233, 99,128,  4,150,233,229,242,229,243,
+    233,243,227,249,242,233,236,236,233, 99,128,  4,220,236,233,238,
+    229,226,229,236,239,119,128, 30,148,237,239,238,239,243,240,225,
+    227,101,128,255, 58,115,  2, 35,203, 35,210,237,225,236,108,128,
+    247,122,244,242,239,235,101,128,  1,181, 97,149,  0, 97, 36,  8,
+     36,144, 37, 35, 37,211, 38, 55, 38, 91, 45, 10, 45, 47, 45, 74,
+     46, 43, 46, 81, 47,170, 47,242, 48,197, 48,206, 49, 79, 51, 87,
+     52, 77, 52,124, 53, 19, 53, 33, 97,  7, 36, 24, 36, 34, 36, 41,
+     36, 48, 36, 73, 36, 89, 36,100,226,229,238,231,225,236,105,128,
+      9,134,227,245,244,101,128,  0,225,228,229,246, 97,128,  9,  6,
+    231,117,  2, 36, 55, 36, 64,234,225,242,225,244,105,128, 10,134,
+    242,237,245,235,232,105,128, 10,  6,237,225,244,242,225,231,245,
+    242,237,245,235,232,105,128, 10, 62,242,245,243,241,245,225,242,
+    101,128, 51,  3,246,239,247,229,236,243,233,231,110,  3, 36,116,
+     36,126, 36,133,226,229,238,231,225,236,105,128,  9,190,228,229,
+    246, 97,128,  9, 62,231,245,234,225,242,225,244,105,128, 10,190,
+     98,  4, 36,154, 36,195, 36,204, 36,214,226,242,229,246,233,225,
+    244,233,239,110,  2, 36,169, 36,184,237,225,242,235,225,242,237,
+    229,238,233,225,110,128,  5, 95,243,233,231,238,228,229,246, 97,
+    128,  9,112,229,238,231,225,236,105,128,  9,133,239,240,239,237,
+    239,230,111,128, 49, 26,242,229,246,101,134,  1,  3, 36,233, 36,
+    241, 36,252, 37,  7, 37, 15, 37, 27,225,227,245,244,101,128, 30,
+    175,227,249,242,233,236,236,233, 99,128,  4,209,228,239,244,226,
+    229,236,239,119,128, 30,183,231,242,225,246,101,128, 30,177,232,
+    239,239,235,225,226,239,246,101,128, 30,179,244,233,236,228,101,
+    128, 30,181, 99,  4, 37, 45, 37, 52, 37,131, 37,201,225,242,239,
+    110,128,  1,206,233,242, 99,  2, 37, 60, 37, 65,236,101,128, 36,
+    208,245,237,230,236,229,120,133,  0,226, 37, 84, 37, 92, 37,103,
+     37,111, 37,123,225,227,245,244,101,128, 30,165,228,239,244,226,
+    229,236,239,119,128, 30,173,231,242,225,246,101,128, 30,167,232,
+    239,239,235,225,226,239,246,101,128, 30,169,244,233,236,228,101,
+    128, 30,171,245,244,101,133,  0,180, 37,147, 37,158, 37,175, 37,
+    182, 37,191,226,229,236,239,247,227,237, 98,128,  3, 23, 99,  2,
+     37,164, 37,169,237, 98,128,  3,  1,239,237, 98,128,  3,  1,228,
+    229,246, 97,128,  9, 84,236,239,247,237,239,100,128,  2,207,244,
+    239,238,229,227,237, 98,128,  3, 65,249,242,233,236,236,233, 99,
+    128,  4, 48,100,  5, 37,223, 37,233, 37,247, 37,253, 38, 31,226,
+    236,231,242,225,246,101,128,  2,  1,228,225,235,231,245,242,237,
+    245,235,232,105,128, 10,113,229,246, 97,128,  9,  5,233,229,242,
+    229,243,233,115,130,  0,228, 38, 11, 38, 22,227,249,242,233,236,
+    236,233, 99,128,  4,211,237,225,227,242,239,110,128,  1,223,239,
+    116,  2, 38, 38, 38, 46,226,229,236,239,119,128, 30,161,237,225,
+    227,242,239,110,128,  1,225,101,131,  0,230, 38, 65, 38, 73, 38,
+     82,225,227,245,244,101,128,  1,253,235,239,242,229,225,110,128,
+     49, 80,237,225,227,242,239,110,128,  1,227,230,233,105,  6, 38,
+    107, 38,127, 41, 64, 41, 70, 41, 85, 44,185, 48,  2, 38,113, 38,
+    120,176,178,176, 56,128, 32, 21,184,185,180, 49,128, 32,164,177,
+     48,  3, 38,136, 40,160, 41, 39, 48,  9, 38,156, 38,176, 38,238,
+     39, 44, 39,106, 39,168, 39,230, 40, 36, 40, 98, 49,  3, 38,164,
+     38,168, 38,172, 55,128,  4, 16, 56,128,  4, 17, 57,128,  4, 18,
+     50, 10, 38,198, 38,202, 38,206, 38,210, 38,214, 38,218, 38,222,
+     38,226, 38,230, 38,234, 48,128,  4, 19, 49,128,  4, 20, 50,128,
+      4, 21, 51,128,  4,  1, 52,128,  4, 22, 53,128,  4, 23, 54,128,
+      4, 24, 55,128,  4, 25, 56,128,  4, 26, 57,128,  4, 27, 51, 10,
+     39,  4, 39,  8, 39, 12, 39, 16, 39, 20, 39, 24, 39, 28, 39, 32,
+     39, 36, 39, 40, 48,128,  4, 28, 49,128,  4, 29, 50,128,  4, 30,
+     51,128,  4, 31, 52,128,  4, 32, 53,128,  4, 33, 54,128,  4, 34,
+     55,128,  4, 35, 56,128,  4, 36, 57,128,  4, 37, 52, 10, 39, 66,
+     39, 70, 39, 74, 39, 78, 39, 82, 39, 86, 39, 90, 39, 94, 39, 98,
+     39,102, 48,128,  4, 38, 49,128,  4, 39, 50,128,  4, 40, 51,128,
+      4, 41, 52,128,  4, 42, 53,128,  4, 43, 54,128,  4, 44, 55,128,
+      4, 45, 56,128,  4, 46, 57,128,  4, 47, 53, 10, 39,128, 39,132,
+     39,136, 39,140, 39,144, 39,148, 39,152, 39,156, 39,160, 39,164,
+     48,128,  4,144, 49,128,  4,  2, 50,128,  4,  3, 51,128,  4,  4,
+     52,128,  4,  5, 53,128,  4,  6, 54,128,  4,  7, 55,128,  4,  8,
+     56,128,  4,  9, 57,128,  4, 10, 54, 10, 39,190, 39,194, 39,198,
+     39,202, 39,206, 39,210, 39,214, 39,218, 39,222, 39,226, 48,128,
+      4, 11, 49,128,  4, 12, 50,128,  4, 14, 51,128,246,196, 52,128,
+    246,197, 53,128,  4, 48, 54,128,  4, 49, 55,128,  4, 50, 56,128,
+      4, 51, 57,128,  4, 52, 55, 10, 39,252, 40,  0, 40,  4, 40,  8,
+     40, 12, 40, 16, 40, 20, 40, 24, 40, 28, 40, 32, 48,128,  4, 53,
+     49,128,  4, 81, 50,128,  4, 54, 51,128,  4, 55, 52,128,  4, 56,
+     53,128,  4, 57, 54,128,  4, 58, 55,128,  4, 59, 56,128,  4, 60,
+     57,128,  4, 61, 56, 10, 40, 58, 40, 62, 40, 66, 40, 70, 40, 74,
+     40, 78, 40, 82, 40, 86, 40, 90, 40, 94, 48,128,  4, 62, 49,128,
+      4, 63, 50,128,  4, 64, 51,128,  4, 65, 52,128,  4, 66, 53,128,
+      4, 67, 54,128,  4, 68, 55,128,  4, 69, 56,128,  4, 70, 57,128,
+      4, 71, 57, 10, 40,120, 40,124, 40,128, 40,132, 40,136, 40,140,
+     40,144, 40,148, 40,152, 40,156, 48,128,  4, 72, 49,128,  4, 73,
+     50,128,  4, 74, 51,128,  4, 75, 52,128,  4, 76, 53,128,  4, 77,
+     54,128,  4, 78, 55,128,  4, 79, 56,128,  4,145, 57,128,  4, 82,
+     49,  4, 40,170, 40,232, 40,237, 41,  7, 48, 10, 40,192, 40,196,
+     40,200, 40,204, 40,208, 40,212, 40,216, 40,220, 40,224, 40,228,
+     48,128,  4, 83, 49,128,  4, 84, 50,128,  4, 85, 51,128,  4, 86,
+     52,128,  4, 87, 53,128,  4, 88, 54,128,  4, 89, 55,128,  4, 90,
+     56,128,  4, 91, 57,128,  4, 92,177, 48,128,  4, 94, 52,  4, 40,
+    247, 40,251, 40,255, 41,  3, 53,128,  4, 15, 54,128,  4, 98, 55,
+    128,  4,114, 56,128,  4,116, 57,  5, 41, 19, 41, 23, 41, 27, 41,
+     31, 41, 35, 50,128,246,198, 51,128,  4, 95, 52,128,  4, 99, 53,
+    128,  4,115, 54,128,  4,117, 56,  2, 41, 45, 41, 59, 51,  2, 41,
+     51, 41, 55, 49,128,246,199, 50,128,246,200,180, 54,128,  4,217,
+    178,185, 57,128, 32, 14,179, 48,  2, 41, 77, 41, 81, 48,128, 32,
+     15, 49,128, 32, 13,181, 55,  7, 41,102, 41,172, 42,237, 43, 58,
+     44, 15, 44,108, 44,179, 51,  2, 41,108, 41,122, 56,  2, 41,114,
+     41,118, 49,128,  6,106, 56,128,  6, 12, 57,  8, 41,140, 41,144,
+     41,148, 41,152, 41,156, 41,160, 41,164, 41,168, 50,128,  6, 96,
+     51,128,  6, 97, 52,128,  6, 98, 53,128,  6, 99, 54,128,  6,100,
+     55,128,  6,101, 56,128,  6,102, 57,128,  6,103, 52,  7, 41,188,
+     41,220, 42, 26, 42, 88, 42,120, 42,176, 42,232, 48,  5, 41,200,
+     41,204, 41,208, 41,212, 41,216, 48,128,  6,104, 49,128,  6,105,
+     51,128,  6, 27, 55,128,  6, 31, 57,128,  6, 33, 49, 10, 41,242,
+     41,246, 41,250, 41,254, 42,  2, 42,  6, 42, 10, 42, 14, 42, 18,
+     42, 22, 48,128,  6, 34, 49,128,  6, 35, 50,128,  6, 36, 51,128,
+      6, 37, 52,128,  6, 38, 53,128,  6, 39, 54,128,  6, 40, 55,128,
+      6, 41, 56,128,  6, 42, 57,128,  6, 43, 50, 10, 42, 48, 42, 52,
+     42, 56, 42, 60, 42, 64, 42, 68, 42, 72, 42, 76, 42, 80, 42, 84,
+     48,128,  6, 44, 49,128,  6, 45, 50,128,  6, 46, 51,128,  6, 47,
+     52,128,  6, 48, 53,128,  6, 49, 54,128,  6, 50, 55,128,  6, 51,
+     56,128,  6, 52, 57,128,  6, 53, 51,  5, 42,100, 42,104, 42,108,
+     42,112, 42,116, 48,128,  6, 54, 49,128,  6, 55, 50,128,  6, 56,
+     51,128,  6, 57, 52,128,  6, 58, 52,  9, 42,140, 42,144, 42,148,
+     42,152, 42,156, 42,160, 42,164, 42,168, 42,172, 48,128,  6, 64,
+     49,128,  6, 65, 50,128,  6, 66, 51,128,  6, 67, 52,128,  6, 68,
+     53,128,  6, 69, 54,128,  6, 70, 56,128,  6, 72, 57,128,  6, 73,
+     53,  9, 42,196, 42,200, 42,204, 42,208, 42,212, 42,216, 42,220,
+     42,224, 42,228, 48,128,  6, 74, 49,128,  6, 75, 50,128,  6, 76,
+     51,128,  6, 77, 52,128,  6, 78, 53,128,  6, 79, 54,128,  6, 80,
+     55,128,  6, 81, 56,128,  6, 82,183, 48,128,  6, 71, 53,  3, 42,
+    245, 43, 21, 43, 53, 48,  5, 43,  1, 43,  5, 43,  9, 43, 13, 43,
+     17, 53,128,  6,164, 54,128,  6,126, 55,128,  6,134, 56,128,  6,
+    152, 57,128,  6,175, 49,  5, 43, 33, 43, 37, 43, 41, 43, 45, 43,
+     49, 49,128,  6,121, 50,128,  6,136, 51,128,  6,145, 52,128,  6,
+    186, 57,128,  6,210,179, 52,128,  6,213, 54,  7, 43, 74, 43, 79,
+     43, 84, 43, 89, 43,127, 43,189, 43,251,179, 54,128, 32,170,180,
+     53,128,  5,190,181, 56,128,  5,195, 54,  6, 43,103, 43,107, 43,
+    111, 43,115, 43,119, 43,123, 52,128,  5,208, 53,128,  5,209, 54,
+    128,  5,210, 55,128,  5,211, 56,128,  5,212, 57,128,  5,213, 55,
+     10, 43,149, 43,153, 43,157, 43,161, 43,165, 43,169, 43,173, 43,
+    177, 43,181, 43,185, 48,128,  5,214, 49,128,  5,215, 50,128,  5,
+    216, 51,128,  5,217, 52,128,  5,218, 53,128,  5,219, 54,128,  5,
+    220, 55,128,  5,221, 56,128,  5,222, 57,128,  5,223, 56, 10, 43,
+    211, 43,215, 43,219, 43,223, 43,227, 43,231, 43,235, 43,239, 43,
+    243, 43,247, 48,128,  5,224, 49,128,  5,225, 50,128,  5,226, 51,
+    128,  5,227, 52,128,  5,228, 53,128,  5,229, 54,128,  5,230, 55,
+    128,  5,231, 56,128,  5,232, 57,128,  5,233, 57,  3, 44,  3, 44,
+      7, 44, 11, 48,128,  5,234, 52,128,251, 42, 53,128,251, 43, 55,
+      4, 44, 25, 44, 39, 44, 59, 44, 64, 48,  2, 44, 31, 44, 35, 48,
+    128,251, 75, 53,128,251, 31, 49,  3, 44, 47, 44, 51, 44, 55, 54,
+    128,  5,240, 55,128,  5,241, 56,128,  5,242,178, 51,128,251, 53,
+     57,  7, 44, 80, 44, 84, 44, 88, 44, 92, 44, 96, 44,100, 44,104,
+     51,128,  5,180, 52,128,  5,181, 53,128,  5,182, 54,128,  5,187,
+     55,128,  5,184, 56,128,  5,183, 57,128,  5,176, 56,  3, 44,116,
+     44,160, 44,165, 48,  7, 44,132, 44,136, 44,140, 44,144, 44,148,
+     44,152, 44,156, 48,128,  5,178, 49,128,  5,177, 50,128,  5,179,
+     51,128,  5,194, 52,128,  5,193, 54,128,  5,185, 55,128,  5,188,
+    179, 57,128,  5,189, 52,  2, 44,171, 44,175, 49,128,  5,191, 50,
+    128,  5,192,185,178, 57,128,  2,188, 54,  3, 44,193, 44,252, 45,
+      3, 49,  4, 44,203, 44,219, 44,225, 44,246, 50,  2, 44,209, 44,
+    214,180, 56,128, 33,  5,184, 57,128, 33, 19,179,181, 50,128, 33,
+     22,181, 55,  3, 44,234, 44,238, 44,242, 51,128, 32, 44, 52,128,
+     32, 45, 53,128, 32, 46,182,182, 52,128, 32, 12,179,177,182, 55,
+    128,  6,109,180,185,179, 55,128,  2,189,103,  2, 45, 16, 45, 23,
+    242,225,246,101,128,  0,224,117,  2, 45, 29, 45, 38,234,225,242,
+    225,244,105,128, 10,133,242,237,245,235,232,105,128, 10,  5,104,
+      2, 45, 53, 45, 63,233,242,225,231,225,238, 97,128, 48, 66,239,
+    239,235,225,226,239,246,101,128, 30,163,105,  7, 45, 90, 45,115,
+     45,122, 45,134, 45,159, 45,175, 45,255, 98,  2, 45, 96, 45,105,
+    229,238,231,225,236,105,128,  9,144,239,240,239,237,239,230,111,
+    128, 49, 30,228,229,246, 97,128,  9, 16,229,227,249,242,233,236,
+    236,233, 99,128,  4,213,231,117,  2, 45,141, 45,150,234,225,242,
+    225,244,105,128, 10,144,242,237,245,235,232,105,128, 10, 16,237,
+    225,244,242,225,231,245,242,237,245,235,232,105,128, 10, 72,110,
+      5, 45,187, 45,196, 45,210, 45,226, 45,241,225,242,225,226,233,
+     99,128,  6, 57,230,233,238,225,236,225,242,225,226,233, 99,128,
+    254,202,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,
+    254,203,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,
+    204,246,229,242,244,229,228,226,242,229,246,101,128,  2,  3,246,
+    239,247,229,236,243,233,231,110,  3, 46, 15, 46, 25, 46, 32,226,
+    229,238,231,225,236,105,128,  9,200,228,229,246, 97,128,  9, 72,
+    231,245,234,225,242,225,244,105,128, 10,200,107,  2, 46, 49, 46,
+     73,225,244,225,235,225,238, 97,129, 48,162, 46, 61,232,225,236,
+    230,247,233,228,244,104,128,255,113,239,242,229,225,110,128, 49,
+     79,108,  3, 46, 89, 47,145, 47,154,101,  2, 46, 95, 47,140,102,
+    136,  5,208, 46,115, 46,124, 46,139, 46,153, 46,242, 47,  0, 47,
+    111, 47,125,225,242,225,226,233, 99,128,  6, 39,228,225,231,229,
+    243,232,232,229,226,242,229,119,128,251, 48,230,233,238,225,236,
+    225,242,225,226,233, 99,128,254,142,104,  2, 46,159, 46,234,225,
+    237,250, 97,  2, 46,168, 46,201,225,226,239,246,101,  2, 46,178,
+     46,187,225,242,225,226,233, 99,128,  6, 35,230,233,238,225,236,
+    225,242,225,226,233, 99,128,254,132,226,229,236,239,119,  2, 46,
+    211, 46,220,225,242,225,226,233, 99,128,  6, 37,230,233,238,225,
+    236,225,242,225,226,233, 99,128,254,136,229,226,242,229,119,128,
+      5,208,236,225,237,229,228,232,229,226,242,229,119,128,251, 79,
+    237, 97,  2, 47,  7, 47, 43,228,228,225,225,226,239,246,101,  2,
+     47, 20, 47, 29,225,242,225,226,233, 99,128,  6, 34,230,233,238,
+    225,236,225,242,225,226,233, 99,128,254,130,235,243,245,242, 97,
+      4, 47, 57, 47, 66, 47, 80, 47, 96,225,242,225,226,233, 99,128,
+      6, 73,230,233,238,225,236,225,242,225,226,233, 99,128,254,240,
+    233,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,243,
+    237,229,228,233,225,236,225,242,225,226,233, 99,128,254,244,240,
+    225,244,225,232,232,229,226,242,229,119,128,251, 46,241,225,237,
+    225,244,243,232,229,226,242,229,119,128,251, 47,240,104,128, 33,
+     53,236,229,241,245,225,108,128, 34, 76,240,232, 97,129,  3,177,
+     47,162,244,239,238,239,115,128,  3,172,109,  4, 47,180, 47,188,
+     47,199, 47,233,225,227,242,239,110,128,  1,  1,239,238,239,243,
+    240,225,227,101,128,255, 65,240,229,242,243,225,238,100,130,  0,
+     38, 47,213, 47,225,237,239,238,239,243,240,225,227,101,128,255,
+      6,243,237,225,236,108,128,247, 38,243,241,245,225,242,101,128,
+     51,194,110,  4, 47,252, 48,  7, 48,129, 48,139,226,239,240,239,
+    237,239,230,111,128, 49, 34,103,  4, 48, 17, 48, 28, 48, 42, 48,
+    121,226,239,240,239,237,239,230,111,128, 49, 36,235,232,225,238,
+    235,232,245,244,232,225,105,128, 14, 90,236,101,131, 34, 32, 48,
+     53, 48,106, 48,113,226,242,225,227,235,229,116,  2, 48, 65, 48,
+     85,236,229,230,116,129, 48,  8, 48, 74,246,229,242,244,233,227,
+    225,108,128,254, 63,242,233,231,232,116,129, 48,  9, 48, 95,246,
+    229,242,244,233,227,225,108,128,254, 64,236,229,230,116,128, 35,
+     41,242,233,231,232,116,128, 35, 42,243,244,242,239,109,128, 33,
+     43,239,244,229,236,229,233, 97,128,  3,135,117,  2, 48,145, 48,
+    157,228,225,244,244,225,228,229,246, 97,128,  9, 82,243,246,225,
+    242, 97,  3, 48,169, 48,179, 48,186,226,229,238,231,225,236,105,
+    128,  9,130,228,229,246, 97,128,  9,  2,231,245,234,225,242,225,
+    244,105,128, 10,130,239,231,239,238,229,107,128,  1,  5,112,  3,
+     48,214, 48,238, 49, 12, 97,  2, 48,220, 48,232,225,244,239,243,
+    241,245,225,242,101,128, 51,  0,242,229,110,128, 36,156,239,243,
+    244,242,239,240,232,101,  2, 48,251, 49,  6,225,242,237,229,238,
+    233,225,110,128,  5, 90,237,239,100,128,  2,188,112,  2, 49, 18,
+     49, 23,236,101,128,248,255,242,111,  2, 49, 30, 49, 38,225,227,
+    232,229,115,128, 34, 80,120,  2, 49, 44, 49, 64,229,241,245,225,
+    108,129, 34, 72, 49, 54,239,242,233,237,225,231,101,128, 34, 82,
+    233,237,225,244,229,236,249,229,241,245,225,108,128, 34, 69,114,
+      4, 49, 89, 49,116, 49,120, 49,165,225,229, 97,  2, 49, 97, 49,
+    107,229,235,239,242,229,225,110,128, 49,142,235,239,242,229,225,
+    110,128, 49,141, 99,128, 35, 18,105,  2, 49,126, 49,140,231,232,
+    244,232,225,236,230,242,233,238,103,128, 30,154,238,103,130,  0,
+    229, 49,149, 49,157,225,227,245,244,101,128,  1,251,226,229,236,
+    239,119,128, 30,  1,242,239,119,  8, 49,185, 49,192, 50, 65, 50,
+    131, 50,181, 50,236, 51,  3, 51, 78,226,239,244,104,128, 33,148,
+    100,  3, 49,200, 49,239, 50, 30,225,243,104,  4, 49,212, 49,219,
+     49,226, 49,234,228,239,247,110,128, 33,227,236,229,230,116,128,
+     33,224,242,233,231,232,116,128, 33,226,245,112,128, 33,225,226,
+    108,  5, 49,252, 50,  3, 50, 10, 50, 17, 50, 25,226,239,244,104,
+    128, 33,212,228,239,247,110,128, 33,211,236,229,230,116,128, 33,
+    208,242,233,231,232,116,128, 33,210,245,112,128, 33,209,239,247,
+    110,131, 33,147, 50, 42, 50, 49, 50, 57,236,229,230,116,128, 33,
+    153,242,233,231,232,116,128, 33,152,247,232,233,244,101,128, 33,
+    233,104,  2, 50, 71, 50,122,229,225,100,  4, 50, 83, 50, 93, 50,
+    103, 50,114,228,239,247,238,237,239,100,128,  2,197,236,229,230,
+    244,237,239,100,128,  2,194,242,233,231,232,244,237,239,100,128,
+      2,195,245,240,237,239,100,128,  2,196,239,242,233,250,229,120,
+    128,248,231,236,229,230,116,131, 33,144, 50,144, 50,161, 50,173,
+    228,226,108,129, 33,208, 50,152,243,244,242,239,235,101,128, 33,
+    205,239,246,229,242,242,233,231,232,116,128, 33,198,247,232,233,
+    244,101,128, 33,230,242,233,231,232,116,132, 33,146, 50,197, 50,
+    209, 50,217, 50,228,228,226,236,243,244,242,239,235,101,128, 33,
+    207,232,229,225,246,121,128, 39,158,239,246,229,242,236,229,230,
+    116,128, 33,196,247,232,233,244,101,128, 33,232,244,225, 98,  2,
+     50,244, 50,251,236,229,230,116,128, 33,228,242,233,231,232,116,
+    128, 33,229,245,112,132, 33,145, 51, 16, 51, 44, 51, 62, 51, 70,
+    100,  2, 51, 22, 51, 34,110,129, 33,149, 51, 28,226,243,101,128,
+     33,168,239,247,238,226,225,243,101,128, 33,168,236,229,230,116,
+    129, 33,150, 51, 53,239,230,228,239,247,110,128, 33,197,242,233,
+    231,232,116,128, 33,151,247,232,233,244,101,128, 33,231,246,229,
+    242,244,229,120,128,248,230,115,  5, 51, 99, 51,175, 51,220, 52,
+     47, 52, 57, 99,  2, 51,105, 51,157,233,105,  2, 51,112, 51,135,
+    227,233,242,227,245,109,129,  0, 94, 51,123,237,239,238,239,243,
+    240,225,227,101,128,255, 62,244,233,236,228,101,129,  0,126, 51,
+    145,237,239,238,239,243,240,225,227,101,128,255, 94,242,233,240,
+    116,129,  2, 81, 51,166,244,245,242,238,229,100,128,  2, 82,237,
+    225,236,108,  2, 51,184, 51,195,232,233,242,225,231,225,238, 97,
+    128, 48, 65,235,225,244,225,235,225,238, 97,129, 48,161, 51,208,
+    232,225,236,230,247,233,228,244,104,128,255,103,244,229,242,233,
+    115,  2, 51,230, 52, 43,107,131,  0, 42, 51,240, 52, 12, 52, 35,
+     97,  2, 51,246, 52,  4,236,244,239,238,229,225,242,225,226,233,
+     99,128,  6,109,242,225,226,233, 99,128,  6,109,109,  2, 52, 18,
+     52, 24,225,244,104,128, 34, 23,239,238,239,243,240,225,227,101,
+    128,255, 10,243,237,225,236,108,128,254, 97,109,128, 32, 66,245,
+    240,229,242,233,239,114,128,246,233,249,237,240,244,239,244,233,
+    227,225,236,236,249,229,241,245,225,108,128, 34, 67,116,132,  0,
+     64, 52, 89, 52, 96, 52,108, 52,116,233,236,228,101,128,  0,227,
+    237,239,238,239,243,240,225,227,101,128,255, 32,243,237,225,236,
+    108,128,254,107,245,242,238,229,100,128,  2, 80,117,  6, 52,138,
+     52,163, 52,170, 52,195, 52,215, 52,231, 98,  2, 52,144, 52,153,
+    229,238,231,225,236,105,128,  9,148,239,240,239,237,239,230,111,
+    128, 49, 32,228,229,246, 97,128,  9, 20,231,117,  2, 52,177, 52,
+    186,234,225,242,225,244,105,128, 10,148,242,237,245,235,232,105,
+    128, 10, 20,236,229,238,231,244,232,237,225,242,235,226,229,238,
+    231,225,236,105,128,  9,215,237,225,244,242,225,231,245,242,237,
+    245,235,232,105,128, 10, 76,246,239,247,229,236,243,233,231,110,
+      3, 52,247, 53,  1, 53,  8,226,229,238,231,225,236,105,128,  9,
+    204,228,229,246, 97,128,  9, 76,231,245,234,225,242,225,244,105,
+    128, 10,204,246,225,231,242,225,232,225,228,229,246, 97,128,  9,
+     61,121,  2, 53, 39, 53, 51,226,225,242,237,229,238,233,225,110,
+    128,  5, 97,233,110,130,  5,226, 53, 60, 53, 75,225,236,244,239,
+    238,229,232,229,226,242,229,119,128,251, 32,232,229,226,242,229,
+    119,128,  5,226, 98,144,  0, 98, 53,120, 53,255, 54, 10, 54, 19,
+     54, 44, 55, 85, 55,147, 55,220, 57,146, 57,158, 57,201, 57,209,
+     57,219, 59, 89, 59,113, 59,122, 97,  7, 53,136, 53,146, 53,170,
+     53,177, 53,202, 53,226, 53,237,226,229,238,231,225,236,105,128,
+      9,172,227,235,243,236,225,243,104,129,  0, 92, 53,158,237,239,
+    238,239,243,240,225,227,101,128,255, 60,228,229,246, 97,128,  9,
+     44,231,117,  2, 53,184, 53,193,234,225,242,225,244,105,128, 10,
+    172,242,237,245,235,232,105,128, 10, 44,104,  2, 53,208, 53,218,
+    233,242,225,231,225,238, 97,128, 48,112,244,244,232,225,105,128,
+     14, 63,235,225,244,225,235,225,238, 97,128, 48,208,114,129,  0,
+    124, 53,243,237,239,238,239,243,240,225,227,101,128,255, 92,226,
+    239,240,239,237,239,230,111,128, 49,  5,227,233,242,227,236,101,
+    128, 36,209,228,239,116,  2, 54, 27, 54, 36,225,227,227,229,238,
+    116,128, 30,  3,226,229,236,239,119,128, 30,  5,101,  6, 54, 58,
+     54, 79, 54,102, 54,244, 54,255, 55, 11,225,237,229,228,243,233,
+    248,244,229,229,238,244,232,238,239,244,229,115,128, 38,108, 99,
+      2, 54, 85, 54, 92,225,245,243,101,128, 34, 53,249,242,233,236,
+    236,233, 99,128,  4, 49,104,  5, 54,114, 54,123, 54,137, 54,167,
+     54,226,225,242,225,226,233, 99,128,  6, 40,230,233,238,225,236,
+    225,242,225,226,233, 99,128,254,144,105,  2, 54,143, 54,158,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,254,145,242,225,
+    231,225,238, 97,128, 48,121,237,101,  2, 54,174, 54,187,228,233,
+    225,236,225,242,225,226,233, 99,128,254,146,229,237,105,  2, 54,
+    195, 54,210,238,233,244,233,225,236,225,242,225,226,233, 99,128,
+    252,159,243,239,236,225,244,229,228,225,242,225,226,233, 99,128,
+    252,  8,238,239,239,238,230,233,238,225,236,225,242,225,226,233,
+     99,128,252,109,235,225,244,225,235,225,238, 97,128, 48,217,238,
+    225,242,237,229,238,233,225,110,128,  5, 98,116,132,  5,209, 55,
+     23, 55, 43, 55, 63, 55, 72, 97,129,  3,178, 55, 29,243,249,237,
+    226,239,236,231,242,229,229,107,128,  3,208,228,225,231,229,243,
+    104,129,251, 49, 55, 54,232,229,226,242,229,119,128,251, 49,232,
+    229,226,242,229,119,128,  5,209,242,225,230,229,232,229,226,242,
+    229,119,128,251, 76,104,  2, 55, 91, 55,141, 97,  3, 55, 99, 55,
+    109, 55,116,226,229,238,231,225,236,105,128,  9,173,228,229,246,
+     97,128,  9, 45,231,117,  2, 55,123, 55,132,234,225,242,225,244,
+    105,128, 10,173,242,237,245,235,232,105,128, 10, 45,239,239,107,
+    128,  2, 83,105,  5, 55,159, 55,170, 55,181, 55,195, 55,209,232,
+    233,242,225,231,225,238, 97,128, 48,115,235,225,244,225,235,225,
+    238, 97,128, 48,211,236,225,226,233,225,236,227,236,233,227,107,
+    128,  2,152,238,228,233,231,245,242,237,245,235,232,105,128, 10,
+      2,242,245,243,241,245,225,242,101,128, 51, 49,108,  3, 55,228,
+     57,129, 57,140, 97,  2, 55,234, 57,124,227,107,  6, 55,249, 56,
+      2, 56, 39, 56,188, 56,243, 57, 39,227,233,242,227,236,101,128,
+     37,207,100,  2, 56,  8, 56, 17,233,225,237,239,238,100,128, 37,
+    198,239,247,238,240,239,233,238,244,233,238,231,244,242,233,225,
+    238,231,236,101,128, 37,188,108,  2, 56, 45, 56,148,101,  2, 56,
+     51, 56, 87,230,244,240,239,233,238,244,233,238,103,  2, 56, 66,
+     56, 76,240,239,233,238,244,229,114,128, 37,196,244,242,233,225,
+    238,231,236,101,128, 37,192,238,244,233,227,245,236,225,242,226,
+    242,225,227,235,229,116,  2, 56,107, 56,127,236,229,230,116,129,
+     48, 16, 56,116,246,229,242,244,233,227,225,108,128,254, 59,242,
+    233,231,232,116,129, 48, 17, 56,137,246,229,242,244,233,227,225,
+    108,128,254, 60,239,247,229,114,  2, 56,157, 56,172,236,229,230,
+    244,244,242,233,225,238,231,236,101,128, 37,227,242,233,231,232,
+    244,244,242,233,225,238,231,236,101,128, 37,226,114,  2, 56,194,
+     56,205,229,227,244,225,238,231,236,101,128, 37,172,233,231,232,
+    244,240,239,233,238,244,233,238,103,  2, 56,222, 56,232,240,239,
+    233,238,244,229,114,128, 37,186,244,242,233,225,238,231,236,101,
+    128, 37,182,115,  3, 56,251, 57, 25, 57, 33,109,  2, 57,  1, 57,
+     13,225,236,236,243,241,245,225,242,101,128, 37,170,233,236,233,
+    238,231,230,225,227,101,128, 38, 59,241,245,225,242,101,128, 37,
+    160,244,225,114,128, 38,  5,245,240,112,  2, 57, 47, 57, 85,229,
+    114,  2, 57, 54, 57, 69,236,229,230,244,244,242,233,225,238,231,
+    236,101,128, 37,228,242,233,231,232,244,244,242,233,225,238,231,
+    236,101,128, 37,229,239,233,238,244,233,238,103,  2, 57, 97, 57,
+    113,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,
+    180,244,242,233,225,238,231,236,101,128, 37,178,238,107,128, 36,
+     35,233,238,229,226,229,236,239,119,128, 30,  7,239,227,107,128,
+     37,136,237,239,238,239,243,240,225,227,101,128,255, 66,111,  3,
+     57,166, 57,179, 57,190,226,225,233,237,225,233,244,232,225,105,
+    128, 14, 26,232,233,242,225,231,225,238, 97,128, 48,124,235,225,
+    244,225,235,225,238, 97,128, 48,220,240,225,242,229,110,128, 36,
+    157,241,243,241,245,225,242,101,128, 51,195,114,  4, 57,229, 58,
+    223, 59, 40, 59, 79,225, 99,  2, 57,236, 58,130,101,  3, 57,244,
+     57,249, 58, 61,229,120,128,248,244,236,229,230,116,133,  0,123,
+     58, 10, 58, 15, 58, 37, 58, 45, 58, 50,226,116,128,248,243,109,
+      2, 58, 21, 58, 26,233,100,128,248,242,239,238,239,243,240,225,
+    227,101,128,255, 91,243,237,225,236,108,128,254, 91,244,112,128,
+    248,241,246,229,242,244,233,227,225,108,128,254, 55,242,233,231,
+    232,116,133,  0,125, 58, 79, 58, 84, 58,106, 58,114, 58,119,226,
+    116,128,248,254,109,  2, 58, 90, 58, 95,233,100,128,248,253,239,
+    238,239,243,240,225,227,101,128,255, 93,243,237,225,236,108,128,
+    254, 92,244,112,128,248,252,246,229,242,244,233,227,225,108,128,
+    254, 56,235,229,116,  2, 58,138, 58,180,236,229,230,116,132,  0,
+     91, 58,153, 58,158, 58,163, 58,175,226,116,128,248,240,229,120,
+    128,248,239,237,239,238,239,243,240,225,227,101,128,255, 59,244,
+    112,128,248,238,242,233,231,232,116,132,  0, 93, 58,196, 58,201,
+     58,206, 58,218,226,116,128,248,251,229,120,128,248,250,237,239,
+    238,239,243,240,225,227,101,128,255, 61,244,112,128,248,249,229,
+    246,101,131,  2,216, 58,235, 58,246, 58,252,226,229,236,239,247,
+    227,237, 98,128,  3, 46,227,237, 98,128,  3,  6,233,238,246,229,
+    242,244,229,100,  3, 59, 11, 59, 22, 59, 28,226,229,236,239,247,
+    227,237, 98,128,  3, 47,227,237, 98,128,  3, 17,228,239,245,226,
+    236,229,227,237, 98,128,  3, 97,233,228,231,101,  2, 59, 49, 59,
+     60,226,229,236,239,247,227,237, 98,128,  3, 42,233,238,246,229,
+    242,244,229,228,226,229,236,239,247,227,237, 98,128,  3, 58,239,
+    235,229,238,226,225,114,128,  0,166,115,  2, 59, 95, 59,103,244,
+    242,239,235,101,128,  1,128,245,240,229,242,233,239,114,128,246,
+    234,244,239,240,226,225,114,128,  1,131,117,  3, 59,130, 59,141,
+     59,152,232,233,242,225,231,225,238, 97,128, 48,118,235,225,244,
+    225,235,225,238, 97,128, 48,214,236,108,  2, 59,159, 59,189,229,
+    116,130, 32, 34, 59,168, 59,178,233,238,246,229,242,243,101,128,
+     37,216,239,240,229,242,225,244,239,114,128, 34, 25,243,229,249,
+    101,128, 37,206, 99,143,  0, 99, 59,230, 60,179, 60,190, 60,254,
+     61, 29, 61,122, 63, 33, 64, 17, 64,117, 64,166, 67,158, 67,166,
+     67,176, 67,188, 67,221, 97,  9, 59,250, 60,  5, 60, 15, 60, 22,
+     60, 29, 60, 54, 60, 64, 60,116, 60,125,225,242,237,229,238,233,
+    225,110,128,  5,110,226,229,238,231,225,236,105,128,  9,154,227,
+    245,244,101,128,  1,  7,228,229,246, 97,128,  9, 26,231,117,  2,
+     60, 36, 60, 45,234,225,242,225,244,105,128, 10,154,242,237,245,
+    235,232,105,128, 10, 26,236,243,241,245,225,242,101,128, 51,136,
+    238,228,242,225,226,233,238,228,117,  4, 60, 82, 60, 92, 60, 98,
+     60,105,226,229,238,231,225,236,105,128,  9,129,227,237, 98,128,
+      3, 16,228,229,246, 97,128,  9,  1,231,245,234,225,242,225,244,
+    105,128, 10,129,240,243,236,239,227,107,128, 33,234,114,  3, 60,
+    133, 60,139, 60,165,229,239,102,128, 33,  5,239,110,130,  2,199,
+     60,148, 60,159,226,229,236,239,247,227,237, 98,128,  3, 44,227,
+    237, 98,128,  3, 12,242,233,225,231,229,242,229,244,245,242,110,
+    128, 33,181,226,239,240,239,237,239,230,111,128, 49, 24, 99,  4,
+     60,200, 60,207, 60,226, 60,248,225,242,239,110,128,  1, 13,229,
+    228,233,236,236, 97,129,  0,231, 60,218,225,227,245,244,101,128,
+     30,  9,233,242, 99,  2, 60,234, 60,239,236,101,128, 36,210,245,
+    237,230,236,229,120,128,  1,  9,245,242,108,128,  2, 85,100,  2,
+     61,  4, 61, 20,239,116,129,  1, 11, 61, 11,225,227,227,229,238,
+    116,128,  1, 11,243,241,245,225,242,101,128, 51,197,101,  2, 61,
+     35, 61, 51,228,233,236,236, 97,129,  0,184, 61, 45,227,237, 98,
+    128,  3, 39,238,116,132,  0,162, 61, 64, 61, 88, 61,100, 61,111,
+    105,  2, 61, 70, 61, 78,231,242,225,228,101,128, 33,  3,238,230,
+    229,242,233,239,114,128,246,223,237,239,238,239,243,240,225,227,
+    101,128,255,224,239,236,228,243,244,249,236,101,128,247,162,243,
+    245,240,229,242,233,239,114,128,246,224,104,  5, 61,134, 61,197,
+     61,208, 62,136, 62,228, 97,  4, 61,144, 61,155, 61,165, 61,172,
+    225,242,237,229,238,233,225,110,128,  5,121,226,229,238,231,225,
+    236,105,128,  9,155,228,229,246, 97,128,  9, 27,231,117,  2, 61,
+    179, 61,188,234,225,242,225,244,105,128, 10,155,242,237,245,235,
+    232,105,128, 10, 27,226,239,240,239,237,239,230,111,128, 49, 20,
+    101,  6, 61,222, 61,242, 62, 10, 62, 78, 62, 90, 62,111,225,226,
+    235,232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128,
+      4,189, 99,  2, 61,248, 62,  0,235,237,225,242,107,128, 39, 19,
+    249,242,233,236,236,233, 99,128,  4, 71,100,  2, 62, 16, 62, 60,
+    229,243,227,229,238,228,229,114,  2, 62, 29, 62, 49,225,226,235,
+    232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128,  4,
+    191,227,249,242,233,236,236,233, 99,128,  4,183,233,229,242,229,
+    243,233,243,227,249,242,233,236,236,233, 99,128,  4,245,232,225,
+    242,237,229,238,233,225,110,128,  5,115,235,232,225,235,225,243,
+    243,233,225,238,227,249,242,233,236,236,233, 99,128,  4,204,246,
+    229,242,244,233,227,225,236,243,244,242,239,235,229,227,249,242,
+    233,236,236,233, 99,128,  4,185,105,129,  3,199, 62,142,229,245,
+    227,104,  4, 62,155, 62,190, 62,205, 62,214, 97,  2, 62,161, 62,
+    176,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,119,
+    240,225,242,229,238,235,239,242,229,225,110,128, 50, 23,227,233,
+    242,227,236,229,235,239,242,229,225,110,128, 50,105,235,239,242,
+    229,225,110,128, 49, 74,240,225,242,229,238,235,239,242,229,225,
+    110,128, 50,  9,111,  2, 62,234, 63, 28,227,104,  3, 62,243, 63,
+      9, 63, 19,225,110,  2, 62,250, 63,  2,231,244,232,225,105,128,
+     14, 10,244,232,225,105,128, 14,  8,233,238,231,244,232,225,105,
+    128, 14,  9,239,229,244,232,225,105,128, 14, 12,239,107,128,  1,
+    136,105,  2, 63, 39, 63,141,229,245, 99,  5, 63, 53, 63, 88, 63,
+    103, 63,112, 63,126, 97,  2, 63, 59, 63, 74,227,233,242,227,236,
+    229,235,239,242,229,225,110,128, 50,118,240,225,242,229,238,235,
+    239,242,229,225,110,128, 50, 22,227,233,242,227,236,229,235,239,
+    242,229,225,110,128, 50,104,235,239,242,229,225,110,128, 49, 72,
+    240,225,242,229,238,235,239,242,229,225,110,128, 50,  8,245,240,
+    225,242,229,238,235,239,242,229,225,110,128, 50, 28,242, 99,  2,
+     63,148, 63,243,236,101,132, 37,203, 63,161, 63,172, 63,177, 63,
+    201,237,245,236,244,233,240,236,121,128, 34,151,239,116,128, 34,
+    153,112,  2, 63,183, 63,189,236,245,115,128, 34,149,239,243,244,
+    225,236,237,225,242,107,128, 48, 54,247,233,244,104,  2, 63,210,
+     63,226,236,229,230,244,232,225,236,230,226,236,225,227,107,128,
+     37,208,242,233,231,232,244,232,225,236,230,226,236,225,227,107,
+    128, 37,209,245,237,230,236,229,120,130,  2,198, 64,  0, 64, 11,
+    226,229,236,239,247,227,237, 98,128,  3, 45,227,237, 98,128,  3,
+      2,108,  3, 64, 25, 64, 31, 64, 85,229,225,114,128, 35, 39,233,
+    227,107,  4, 64, 43, 64, 54, 64, 63, 64, 73,225,236,246,229,239,
+    236,225,114,128,  1,194,228,229,238,244,225,108,128,  1,192,236,
+    225,244,229,242,225,108,128,  1,193,242,229,244,242,239,230,236,
+    229,120,128,  1,195,245, 98,129, 38, 99, 64, 92,243,245,233,116,
+      2, 64,101, 64,109,226,236,225,227,107,128, 38, 99,247,232,233,
+    244,101,128, 38,103,109,  3, 64,125, 64,139, 64,150,227,245,226,
+    229,228,243,241,245,225,242,101,128, 51,164,239,238,239,243,240,
+    225,227,101,128,255, 67,243,241,245,225,242,229,228,243,241,245,
+    225,242,101,128, 51,160,111,  8, 64,184, 64,195, 65, 26, 65,224,
+     66,253, 67, 28, 67,135, 67,144,225,242,237,229,238,233,225,110,
+    128,  5,129,236,239,110,131,  0, 58, 64,207, 64,232, 64,251,237,
+    239,110,  2, 64,215, 64,223,229,244,225,242,121,128, 32,161,239,
+    243,240,225,227,101,128,255, 26,115,  2, 64,238, 64,244,233,231,
+    110,128, 32,161,237,225,236,108,128,254, 85,244,242,233,225,238,
+    231,245,236,225,114,  2, 65, 10, 65, 20,232,225,236,230,237,239,
+    100,128,  2,209,237,239,100,128,  2,208,109,  2, 65, 32, 65,217,
+    237, 97,134,  0, 44, 65, 49, 65,113, 65,124, 65,136, 65,166, 65,
+    189, 97,  3, 65, 57, 65, 83, 65, 91,226,239,246,101,  2, 65, 66,
+     65, 72,227,237, 98,128,  3, 19,242,233,231,232,244,227,237, 98,
+    128,  3, 21,227,227,229,238,116,128,246,195,114,  2, 65, 97, 65,
+    104,225,226,233, 99,128,  6, 12,237,229,238,233,225,110,128,  5,
+     93,233,238,230,229,242,233,239,114,128,246,225,237,239,238,239,
+    243,240,225,227,101,128,255, 12,242,229,246,229,242,243,229,100,
+      2, 65,149, 65,160,225,226,239,246,229,227,237, 98,128,  3, 20,
+    237,239,100,128,  2,189,115,  2, 65,172, 65,179,237,225,236,108,
+    128,254, 80,245,240,229,242,233,239,114,128,246,226,244,245,242,
+    238,229,100,  2, 65,200, 65,211,225,226,239,246,229,227,237, 98,
+    128,  3, 18,237,239,100,128,  2,187,240,225,243,115,128, 38, 60,
+    110,  2, 65,230, 65,239,231,242,245,229,238,116,128, 34, 69,116,
+      2, 65,245, 66,  3,239,245,242,233,238,244,229,231,242,225,108,
+    128, 34, 46,242,239,108,142, 35,  3, 66, 37, 66, 43, 66, 58, 66,
+     73, 66,117, 66,162, 66,176, 66,181, 66,186, 66,191, 66,197, 66,
+    202, 66,243, 66,248,193,195, 75,128,  0,  6, 66,  2, 66, 49, 66,
+     54,197, 76,128,  0,  7, 83,128,  0,  8, 67,  2, 66, 64, 66, 69,
+    193, 78,128,  0, 24, 82,128,  0, 13, 68,  3, 66, 81, 66,107, 66,
+    112, 67,  4, 66, 91, 66, 95, 66, 99, 66,103, 49,128,  0, 17, 50,
+    128,  0, 18, 51,128,  0, 19, 52,128,  0, 20,197, 76,128,  0,127,
+    204, 69,128,  0, 16, 69,  5, 66,129, 66,133, 66,138, 66,143, 66,
+    148, 77,128,  0, 25,206, 81,128,  0,  5,207, 84,128,  0,  4,211,
+     67,128,  0, 27, 84,  2, 66,154, 66,158, 66,128,  0, 23, 88,128,
+      0,  3, 70,  2, 66,168, 66,172, 70,128,  0, 12, 83,128,  0, 28,
+    199, 83,128,  0, 29,200, 84,128,  0,  9,204, 70,128,  0, 10,206,
+    193, 75,128,  0, 21,210, 83,128,  0, 30, 83,  5, 66,214, 66,218,
+     66,228, 66,233, 66,238, 73,128,  0, 15, 79,129,  0, 14, 66,224,
+     84,128,  0,  2,212, 88,128,  0,  1,213, 66,128,  0, 26,217, 78,
+    128,  0, 22,213, 83,128,  0, 31,214, 84,128,  0, 11,240,249,242,
+    233,231,232,116,129,  0,169, 67,  9,115,  2, 67, 15, 67, 21,225,
+    238,115,128,248,233,229,242,233,102,128,246,217,114,  2, 67, 34,
+     67,118,238,229,242,226,242,225,227,235,229,116,  2, 67, 49, 67,
+     83,236,229,230,116,130, 48, 12, 67, 60, 67, 72,232,225,236,230,
+    247,233,228,244,104,128,255, 98,246,229,242,244,233,227,225,108,
+    128,254, 65,242,233,231,232,116,130, 48, 13, 67, 95, 67,107,232,
+    225,236,230,247,233,228,244,104,128,255, 99,246,229,242,244,233,
+    227,225,108,128,254, 66,240,239,242,225,244,233,239,238,243,241,
+    245,225,242,101,128, 51,127,243,241,245,225,242,101,128, 51,199,
+    246,229,242,235,231,243,241,245,225,242,101,128, 51,198,240,225,
+    242,229,110,128, 36,158,242,245,250,229,233,242,111,128, 32,162,
+    243,244,242,229,244,227,232,229,100,128,  2,151,245,114,  2, 67,
+    195, 67,213,236,121,  2, 67,202, 67,208,225,238,100,128, 34,207,
+    239,114,128, 34,206,242,229,238,227,121,128,  0,164,249,114,  4,
+     67,232, 67,240, 67,247, 67,255,194,242,229,246,101,128,246,209,
+    198,236,229,120,128,246,210,226,242,229,246,101,128,246,212,230,
+    236,229,120,128,246,213,100,146,  0,100, 68, 46, 69,184, 70,208,
+     71, 12, 71,188, 72,142, 72,204, 73,133, 73,146, 73,155, 73,181,
+     73,206, 73,215, 75, 26, 75, 34, 75, 45, 75, 65, 75, 93, 97, 11,
+     68, 70, 68, 81, 68, 91, 68,163, 68,226, 68,237, 68,248, 69, 61,
+     69,123, 69,129, 69,159,225,242,237,229,238,233,225,110,128,  5,
+    100,226,229,238,231,225,236,105,128,  9,166,100,  5, 68,103, 68,
+    112, 68,118, 68,132, 68,148,225,242,225,226,233, 99,128,  6, 54,
+    229,246, 97,128,  9, 38,230,233,238,225,236,225,242,225,226,233,
+     99,128,254,190,233,238,233,244,233,225,236,225,242,225,226,233,
+     99,128,254,191,237,229,228,233,225,236,225,242,225,226,233, 99,
+    128,254,192,103,  3, 68,171, 68,188, 68,202,229,243,104,129,  5,
+    188, 68,179,232,229,226,242,229,119,128,  5,188,231,229,114,129,
+     32, 32, 68,196,228,226,108,128, 32, 33,117,  2, 68,208, 68,217,
+    234,225,242,225,244,105,128, 10,166,242,237,245,235,232,105,128,
+     10, 38,232,233,242,225,231,225,238, 97,128, 48, 96,235,225,244,
+    225,235,225,238, 97,128, 48,192,108,  3, 69,  0, 69,  9, 69, 47,
+    225,242,225,226,233, 99,128,  6, 47,229,116,130,  5,211, 69, 18,
+     69, 38,228,225,231,229,243,104,129,251, 51, 69, 29,232,229,226,
+    242,229,119,128,251, 51,232,229,226,242,229,119,128,  5,211,230,
+    233,238,225,236,225,242,225,226,233, 99,128,254,170,237,237, 97,
+      3, 69, 71, 69, 80, 69, 92,225,242,225,226,233, 99,128,  6, 79,
+    236,239,247,225,242,225,226,233, 99,128,  6, 79,244,225,238, 97,
+      2, 69,101, 69,115,236,244,239,238,229,225,242,225,226,233, 99,
+    128,  6, 76,242,225,226,233, 99,128,  6, 76,238,228, 97,128,  9,
+    100,242,231, 97,  2, 69,137, 69,146,232,229,226,242,229,119,128,
+      5,167,236,229,230,244,232,229,226,242,229,119,128,  5,167,243,
+    233,225,240,238,229,245,237,225,244,225,227,249,242,233,236,236,
+    233,227,227,237, 98,128,  4,133, 98,  3, 69,192, 70,189, 70,199,
+    108,  9, 69,212, 69,220, 70, 77, 70, 85, 70,101, 70,112, 70,130,
+     70,144, 70,155,199,242,225,246,101,128,246,211, 97,  2, 69,226,
+     70, 27,238,231,236,229,226,242,225,227,235,229,116,  2, 69,242,
+     70,  6,236,229,230,116,129, 48, 10, 69,251,246,229,242,244,233,
+    227,225,108,128,254, 61,242,233,231,232,116,129, 48, 11, 70, 16,
+    246,229,242,244,233,227,225,108,128,254, 62,114,  2, 70, 33, 70,
+     54,227,232,233,238,246,229,242,244,229,228,226,229,236,239,247,
+    227,237, 98,128,  3, 43,242,239,119,  2, 70, 62, 70, 69,236,229,
+    230,116,128, 33,212,242,233,231,232,116,128, 33,210,228,225,238,
+    228, 97,128,  9,101,231,242,225,246,101,129,246,214, 70, 95,227,
+    237, 98,128,  3, 15,233,238,244,229,231,242,225,108,128, 34, 44,
+    236,239,247,236,233,238,101,129, 32, 23, 70,124,227,237, 98,128,
+      3, 51,239,246,229,242,236,233,238,229,227,237, 98,128,  3, 63,
+    240,242,233,237,229,237,239,100,128,  2,186,246,229,242,244,233,
+    227,225,108,  2, 70,168, 70,174,226,225,114,128, 32, 22,236,233,
+    238,229,225,226,239,246,229,227,237, 98,128,  3, 14,239,240,239,
+    237,239,230,111,128, 49,  9,243,241,245,225,242,101,128, 51,200,
+     99,  4, 70,218, 70,225, 70,234, 71,  5,225,242,239,110,128,  1,
+     15,229,228,233,236,236, 97,128, 30, 17,233,242, 99,  2, 70,242,
+     70,247,236,101,128, 36,211,245,237,230,236,229,248,226,229,236,
+    239,119,128, 30, 19,242,239,225,116,128,  1, 17,100,  4, 71, 22,
+     71,103, 71,113, 71,164, 97,  4, 71, 32, 71, 42, 71, 49, 71, 74,
+    226,229,238,231,225,236,105,128,  9,161,228,229,246, 97,128,  9,
+     33,231,117,  2, 71, 56, 71, 65,234,225,242,225,244,105,128, 10,
+    161,242,237,245,235,232,105,128, 10, 33,108,  2, 71, 80, 71, 89,
+    225,242,225,226,233, 99,128,  6,136,230,233,238,225,236,225,242,
+    225,226,233, 99,128,251,137,228,232,225,228,229,246, 97,128,  9,
+     92,232, 97,  3, 71,122, 71,132, 71,139,226,229,238,231,225,236,
+    105,128,  9,162,228,229,246, 97,128,  9, 34,231,117,  2, 71,146,
+     71,155,234,225,242,225,244,105,128, 10,162,242,237,245,235,232,
+    105,128, 10, 34,239,116,  2, 71,171, 71,180,225,227,227,229,238,
+    116,128, 30, 11,226,229,236,239,119,128, 30, 13,101,  8, 71,206,
+     72,  3, 72, 10, 72, 35, 72, 45, 72, 56, 72,101, 72,137, 99,  2,
+     71,212, 71,249,233,237,225,236,243,229,240,225,242,225,244,239,
+    114,  2, 71,230, 71,239,225,242,225,226,233, 99,128,  6,107,240,
+    229,242,243,233,225,110,128,  6,107,249,242,233,236,236,233, 99,
+    128,  4, 52,231,242,229,101,128,  0,176,232,105,  2, 72, 17, 72,
+     26,232,229,226,242,229,119,128,  5,173,242,225,231,225,238, 97,
+    128, 48,103,233,227,239,240,244,233, 99,128,  3,239,235,225,244,
+    225,235,225,238, 97,128, 48,199,108,  2, 72, 62, 72, 85,229,244,
+    101,  2, 72, 70, 72, 77,236,229,230,116,128, 35, 43,242,233,231,
+    232,116,128, 35, 38,244, 97,129,  3,180, 72, 92,244,245,242,238,
+    229,100,128,  1,141,238,239,237,233,238,225,244,239,242,237,233,
+    238,245,243,239,238,229,238,245,237,229,242,225,244,239,242,226,
+    229,238,231,225,236,105,128,  9,248,250,104,128,  2,164,104,  2,
+     72,148, 72,198, 97,  3, 72,156, 72,166, 72,173,226,229,238,231,
+    225,236,105,128,  9,167,228,229,246, 97,128,  9, 39,231,117,  2,
+     72,180, 72,189,234,225,242,225,244,105,128, 10,167,242,237,245,
+    235,232,105,128, 10, 39,239,239,107,128,  2, 87,105,  6, 72,218,
+     73, 11, 73, 71, 73, 82, 73, 93, 73,103, 97,  2, 72,224, 72,246,
+    236,249,244,233,235,225,244,239,238,239,115,129,  3,133, 72,240,
+    227,237, 98,128,  3, 68,237,239,238,100,129, 38,102, 72,255,243,
+    245,233,244,247,232,233,244,101,128, 38, 98,229,242,229,243,233,
+    115,133,  0,168, 73, 30, 73, 38, 73, 49, 73, 55, 73, 63,225,227,
+    245,244,101,128,246,215,226,229,236,239,247,227,237, 98,128,  3,
+     36,227,237, 98,128,  3,  8,231,242,225,246,101,128,246,216,244,
+    239,238,239,115,128,  3,133,232,233,242,225,231,225,238, 97,128,
+     48, 98,235,225,244,225,235,225,238, 97,128, 48,194,244,244,239,
+    237,225,242,107,128, 48,  3,246,105,  2, 73,110, 73,121,228,101,
+    129,  0,247, 73,117,115,128, 34, 35,243,233,239,238,243,236,225,
+    243,104,128, 34, 21,234,229,227,249,242,233,236,236,233, 99,128,
+      4, 82,235,243,232,225,228,101,128, 37,147,108,  2, 73,161, 73,
+    172,233,238,229,226,229,236,239,119,128, 30, 15,243,241,245,225,
+    242,101,128, 51,151,109,  2, 73,187, 73,195,225,227,242,239,110,
+    128,  1, 17,239,238,239,243,240,225,227,101,128,255, 68,238,226,
+    236,239,227,107,128, 37,132,111, 10, 73,237, 73,249, 74,  3, 74,
+     14, 74, 25, 74, 97, 74,102, 74,113, 74,228, 74,254,227,232,225,
+    228,225,244,232,225,105,128, 14, 14,228,229,235,244,232,225,105,
+    128, 14, 20,232,233,242,225,231,225,238, 97,128, 48,105,235,225,
+    244,225,235,225,238, 97,128, 48,201,236,236,225,114,132,  0, 36,
+     74, 40, 74, 51, 74, 63, 74, 74,233,238,230,229,242,233,239,114,
+    128,246,227,237,239,238,239,243,240,225,227,101,128,255,  4,239,
+    236,228,243,244,249,236,101,128,247, 36,115,  2, 74, 80, 74, 87,
+    237,225,236,108,128,254,105,245,240,229,242,233,239,114,128,246,
+    228,238,103,128, 32,171,242,245,243,241,245,225,242,101,128, 51,
+     38,116,  6, 74,127, 74,144, 74,166, 74,177, 74,209, 74,216,225,
+    227,227,229,238,116,129,  2,217, 74,138,227,237, 98,128,  3,  7,
+    226,229,236,239,247, 99,  2, 74,155, 74,160,237, 98,128,  3, 35,
+    239,237, 98,128,  3, 35,235,225,244,225,235,225,238, 97,128, 48,
+    251,236,229,243,115,  2, 74,186, 74,190,105,128,  1, 49,106,129,
+    246,190, 74,196,243,244,242,239,235,229,232,239,239,107,128,  2,
+    132,237,225,244,104,128, 34,197,244,229,228,227,233,242,227,236,
+    101,128, 37,204,245,226,236,229,249,239,228,240,225,244,225,104,
+    129,251, 31, 74,245,232,229,226,242,229,119,128,251, 31,247,238,
+    244,225,227,107,  2, 75,  9, 75, 20,226,229,236,239,247,227,237,
+     98,128,  3, 30,237,239,100,128,  2,213,240,225,242,229,110,128,
+     36,159,243,245,240,229,242,233,239,114,128,246,235,116,  2, 75,
+     51, 75, 57,225,233,108,128,  2, 86,239,240,226,225,114,128,  1,
+    140,117,  2, 75, 71, 75, 82,232,233,242,225,231,225,238, 97,128,
+     48,101,235,225,244,225,235,225,238, 97,128, 48,197,122,132,  1,
+    243, 75,105, 75,114, 75,133, 75,170,225,236,244,239,238,101,128,
+      2,163, 99,  2, 75,120, 75,127,225,242,239,110,128,  1,198,245,
+    242,108,128,  2,165,101,  2, 75,139, 75,159,225,226,235,232,225,
+    243,233,225,238,227,249,242,233,236,236,233, 99,128,  4,225,227,
+    249,242,233,236,236,233, 99,128,  4, 85,232,229,227,249,242,233,
+    236,236,233, 99,128,  4, 95,101,151,  0,101, 75,233, 75,252, 76,
+     30, 77,  4, 77, 66, 77, 99, 77,111, 77,134, 77,187, 79, 43, 79,
+    101, 79,203, 80, 63, 80,198, 81, 17, 81, 48, 81,110, 81,163, 82,
+     98, 82,231, 82,251, 83, 39, 83,130, 97,  2, 75,239, 75,246,227,
+    245,244,101,128,  0,233,242,244,104,128, 38, 65, 98,  3, 76,  4,
+     76, 13, 76, 23,229,238,231,225,236,105,128,  9,143,239,240,239,
+    237,239,230,111,128, 49, 28,242,229,246,101,128,  1, 21, 99,  5,
+     76, 42, 76,115, 76,129, 76,161, 76,250, 97,  2, 76, 48, 76,109,
+    238,228,242, 97,  3, 76, 59, 76, 66, 76, 77,228,229,246, 97,128,
+      9, 13,231,245,234,225,242,225,244,105,128, 10,141,246,239,247,
+    229,236,243,233,231,110,  2, 76, 91, 76, 98,228,229,246, 97,128,
+      9, 69,231,245,234,225,242,225,244,105,128, 10,197,242,239,110,
+    128,  1, 27,229,228,233,236,236,225,226,242,229,246,101,128, 30,
+     29,104,  2, 76,135, 76,146,225,242,237,229,238,233,225,110,128,
+      5,101,249,233,247,238,225,242,237,229,238,233,225,110,128,  5,
+    135,233,242, 99,  2, 76,169, 76,174,236,101,128, 36,212,245,237,
+    230,236,229,120,134,  0,234, 76,195, 76,203, 76,211, 76,222, 76,
+    230, 76,242,225,227,245,244,101,128, 30,191,226,229,236,239,119,
+    128, 30, 25,228,239,244,226,229,236,239,119,128, 30,199,231,242,
+    225,246,101,128, 30,193,232,239,239,235,225,226,239,246,101,128,
+     30,195,244,233,236,228,101,128, 30,197,249,242,233,236,236,233,
+     99,128,  4, 84,100,  4, 77, 14, 77, 24, 77, 30, 77, 40,226,236,
+    231,242,225,246,101,128,  2,  5,229,246, 97,128,  9, 15,233,229,
+    242,229,243,233,115,128,  0,235,239,116,130,  1, 23, 77, 49, 77,
+     58,225,227,227,229,238,116,128,  1, 23,226,229,236,239,119,128,
+     30,185,101,  2, 77, 72, 77, 83,231,245,242,237,245,235,232,105,
+    128, 10, 15,237,225,244,242,225,231,245,242,237,245,235,232,105,
+    128, 10, 71,230,227,249,242,233,236,236,233, 99,128,  4, 68,103,
+      2, 77,117, 77,124,242,225,246,101,128,  0,232,245,234,225,242,
+    225,244,105,128, 10,143,104,  4, 77,144, 77,155, 77,166, 77,176,
+    225,242,237,229,238,233,225,110,128,  5,103,226,239,240,239,237,
+    239,230,111,128, 49, 29,233,242,225,231,225,238, 97,128, 48, 72,
+    239,239,235,225,226,239,246,101,128, 30,187,105,  4, 77,197, 77,
+    208, 79, 10, 79, 25,226,239,240,239,237,239,230,111,128, 49, 31,
+    231,232,116,142,  0, 56, 77,242, 77,251, 78,  5, 78, 35, 78, 42,
+     78, 80, 78,105, 78,150, 78,184, 78,196, 78,207, 78,240, 78,248,
+     79,  3,225,242,225,226,233, 99,128,  6,104,226,229,238,231,225,
+    236,105,128,  9,238,227,233,242,227,236,101,129, 36,103, 78, 16,
+    233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,102,
+    128, 39,145,228,229,246, 97,128,  9,110,229,229,110,  2, 78, 50,
+     78, 59,227,233,242,227,236,101,128, 36,113,112,  2, 78, 65, 78,
+     72,225,242,229,110,128, 36,133,229,242,233,239,100,128, 36,153,
+    231,117,  2, 78, 87, 78, 96,234,225,242,225,244,105,128, 10,238,
+    242,237,245,235,232,105,128, 10,110,104,  2, 78,111, 78,137, 97,
+      2, 78,117, 78,128,227,235,225,242,225,226,233, 99,128,  6,104,
+    238,231,250,232,239,117,128, 48, 40,238,239,244,229,226,229,225,
+    237,229,100,128, 38,107,105,  2, 78,156, 78,174,228,229,239,231,
+    242,225,240,232,233,227,240,225,242,229,110,128, 50, 39,238,230,
+    229,242,233,239,114,128, 32,136,237,239,238,239,243,240,225,227,
+    101,128,255, 24,239,236,228,243,244,249,236,101,128,247, 56,112,
+      2, 78,213, 78,220,225,242,229,110,128, 36,123,229,114,  2, 78,
+    227, 78,233,233,239,100,128, 36,143,243,233,225,110,128,  6,248,
+    242,239,237,225,110,128, 33,119,243,245,240,229,242,233,239,114,
+    128, 32,120,244,232,225,105,128, 14, 88,238,246,229,242,244,229,
+    228,226,242,229,246,101,128,  2,  7,239,244,233,230,233,229,228,
+    227,249,242,233,236,236,233, 99,128,  4,101,107,  2, 79, 49, 79,
+     73,225,244,225,235,225,238, 97,129, 48,168, 79, 61,232,225,236,
+    230,247,233,228,244,104,128,255,116,111,  2, 79, 79, 79, 94,238,
+    235,225,242,231,245,242,237,245,235,232,105,128, 10,116,242,229,
+    225,110,128, 49, 84,108,  3, 79,109, 79,120, 79,181,227,249,242,
+    233,236,236,233, 99,128,  4, 59,101,  2, 79,126, 79,133,237,229,
+    238,116,128, 34,  8,246,229,110,  3, 79,143, 79,152, 79,173,227,
+    233,242,227,236,101,128, 36,106,112,  2, 79,158, 79,165,225,242,
+    229,110,128, 36,126,229,242,233,239,100,128, 36,146,242,239,237,
+    225,110,128, 33,122,236,233,240,243,233,115,129, 32, 38, 79,192,
+    246,229,242,244,233,227,225,108,128, 34,238,109,  5, 79,215, 79,
+    243, 79,254, 80, 18, 80, 29,225,227,242,239,110,130,  1, 19, 79,
+    227, 79,235,225,227,245,244,101,128, 30, 23,231,242,225,246,101,
+    128, 30, 21,227,249,242,233,236,236,233, 99,128,  4, 60,228,225,
+    243,104,129, 32, 20, 80,  7,246,229,242,244,233,227,225,108,128,
+    254, 49,239,238,239,243,240,225,227,101,128,255, 69,112,  2, 80,
+     35, 80, 55,232,225,243,233,243,237,225,242,235,225,242,237,229,
+    238,233,225,110,128,  5, 91,244,249,243,229,116,128, 34,  5,110,
+      6, 80, 77, 80, 88, 80, 99, 80,143, 80,175, 80,190,226,239,240,
+    239,237,239,230,111,128, 49, 35,227,249,242,233,236,236,233, 99,
+    128,  4, 61,100,  2, 80,105, 80,124,225,243,104,129, 32, 19, 80,
+    113,246,229,242,244,233,227,225,108,128,254, 50,229,243,227,229,
+    238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,163,103,
+    130,  1, 75, 80,151, 80,162,226,239,240,239,237,239,230,111,128,
+     49, 37,232,229,227,249,242,233,236,236,233, 99,128,  4,165,232,
+    239,239,235,227,249,242,233,236,236,233, 99,128,  4,200,243,240,
+    225,227,101,128, 32,  2,111,  3, 80,206, 80,214, 80,223,231,239,
+    238,229,107,128,  1, 25,235,239,242,229,225,110,128, 49, 83,240,
+    229,110,130,  2, 91, 80,233, 80,242,227,236,239,243,229,100,128,
+      2,154,242,229,246,229,242,243,229,100,130,  2, 92, 81,  1, 81,
+     10,227,236,239,243,229,100,128,  2, 94,232,239,239,107,128,  2,
+     93,112,  2, 81, 23, 81, 30,225,242,229,110,128, 36,160,243,233,
+    236,239,110,129,  3,181, 81, 40,244,239,238,239,115,128,  3,173,
+    241,117,  2, 81, 55, 81, 99,225,108,130,  0, 61, 81, 64, 81, 76,
+    237,239,238,239,243,240,225,227,101,128,255, 29,115,  2, 81, 82,
+     81, 89,237,225,236,108,128,254,102,245,240,229,242,233,239,114,
+    128, 32,124,233,246,225,236,229,238,227,101,128, 34, 97,114,  3,
+     81,118, 81,129, 81,140,226,239,240,239,237,239,230,111,128, 49,
+     38,227,249,242,233,236,236,233, 99,128,  4, 64,229,246,229,242,
+    243,229,100,129,  2, 88, 81,152,227,249,242,233,236,236,233, 99,
+    128,  4, 77,115,  6, 81,177, 81,188, 81,208, 82, 33, 82, 78, 82,
+     88,227,249,242,233,236,236,233, 99,128,  4, 65,228,229,243,227,
+    229,238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,171,
+    104,132,  2,131, 81,220, 81,227, 82,  2, 82, 17,227,245,242,108,
+    128,  2,134,239,242,116,  2, 81,235, 81,242,228,229,246, 97,128,
+      9, 14,246,239,247,229,236,243,233,231,238,228,229,246, 97,128,
+      9, 70,242,229,246,229,242,243,229,228,236,239,239,112,128,  1,
+    170,243,241,245,225,244,242,229,246,229,242,243,229,100,128,  2,
+    133,237,225,236,108,  2, 82, 42, 82, 53,232,233,242,225,231,225,
+    238, 97,128, 48, 71,235,225,244,225,235,225,238, 97,129, 48,167,
+     82, 66,232,225,236,230,247,233,228,244,104,128,255,106,244,233,
+    237,225,244,229,100,128, 33, 46,245,240,229,242,233,239,114,128,
+    246,236,116,  5, 82,110, 82,136, 82,140, 82,157, 82,223, 97,130,
+      3,183, 82,118, 82,128,242,237,229,238,233,225,110,128,  5,104,
+    244,239,238,239,115,128,  3,174,104,128,  0,240,233,236,228,101,
+    129, 30,189, 82,149,226,229,236,239,119,128, 30, 27,238,225,232,
+    244, 97,  3, 82,169, 82,201, 82,210,230,239,245,235,104,  2, 82,
+    179, 82,188,232,229,226,242,229,119,128,  5,145,236,229,230,244,
+    232,229,226,242,229,119,128,  5,145,232,229,226,242,229,119,128,
+      5,145,236,229,230,244,232,229,226,242,229,119,128,  5,145,245,
+    242,238,229,100,128,  1,221,117,  2, 82,237, 82,246,235,239,242,
+    229,225,110,128, 49, 97,242,111,128, 32,172,246,239,247,229,236,
+    243,233,231,110,  3, 83, 11, 83, 21, 83, 28,226,229,238,231,225,
+    236,105,128,  9,199,228,229,246, 97,128,  9, 71,231,245,234,225,
+    242,225,244,105,128, 10,199,120,  2, 83, 45, 83,118,227,236,225,
+    109,132,  0, 33, 83, 60, 83, 71, 83, 98, 83,110,225,242,237,229,
+    238,233,225,110,128,  5, 92,100,  2, 83, 77, 83, 82,226,108,128,
+     32, 60,239,247,110,129,  0,161, 83, 90,243,237,225,236,108,128,
+    247,161,237,239,238,239,243,240,225,227,101,128,255,  1,243,237,
+    225,236,108,128,247, 33,233,243,244,229,238,244,233,225,108,128,
+     34,  3,250,104,131,  2,146, 83,141, 83,160, 83,171, 99,  2, 83,
+    147, 83,154,225,242,239,110,128,  1,239,245,242,108,128,  2,147,
+    242,229,246,229,242,243,229,100,128,  1,185,244,225,233,108,128,
+      1,186,102,140,  0,102, 83,206, 84, 32, 84, 43, 84, 52, 84, 64,
+     84,167, 84,183, 86,191, 86,204, 86,230, 88,107, 88,115, 97,  4,
+     83,216, 83,223, 83,234, 83,245,228,229,246, 97,128,  9, 94,231,
+    245,242,237,245,235,232,105,128, 10, 94,232,242,229,238,232,229,
+    233,116,128, 33,  9,244,232, 97,  3, 83,255, 84,  8, 84, 20,225,
+    242,225,226,233, 99,128,  6, 78,236,239,247,225,242,225,226,233,
+     99,128,  6, 78,244,225,238,225,242,225,226,233, 99,128,  6, 75,
+    226,239,240,239,237,239,230,111,128, 49,  8,227,233,242,227,236,
+    101,128, 36,213,228,239,244,225,227,227,229,238,116,128, 30, 31,
+    101,  3, 84, 72, 84,150, 84,160,104,  4, 84, 82, 84,105, 84,119,
+     84,135,225,114,  2, 84, 89, 84, 96,225,226,233, 99,128,  6, 65,
+    237,229,238,233,225,110,128,  5,134,230,233,238,225,236,225,242,
+    225,226,233, 99,128,254,210,233,238,233,244,233,225,236,225,242,
+    225,226,233, 99,128,254,211,237,229,228,233,225,236,225,242,225,
+    226,233, 99,128,254,212,233,227,239,240,244,233, 99,128,  3,229,
+    237,225,236,101,128, 38, 64,102,130,251,  0, 84,175, 84,179,105,
+    128,251,  3,108,128,251,  4,105,136,251,  1, 84,203, 84,243, 84,
+    254, 85, 20, 85,142, 85,159, 85,167, 85,180,230,244,229,229,110,
+      2, 84,213, 84,222,227,233,242,227,236,101,128, 36,110,112,  2,
+     84,228, 84,235,225,242,229,110,128, 36,130,229,242,233,239,100,
+    128, 36,150,231,245,242,229,228,225,243,104,128, 32, 18,236,236,
+    229,100,  2, 85,  7, 85, 13,226,239,120,128, 37,160,242,229,227,
+    116,128, 37,172,238,225,108,  5, 85, 34, 85, 73, 85, 90, 85,107,
+     85,123,235,225,102,130,  5,218, 85, 44, 85, 64,228,225,231,229,
+    243,104,129,251, 58, 85, 55,232,229,226,242,229,119,128,251, 58,
+    232,229,226,242,229,119,128,  5,218,237,229,109,129,  5,221, 85,
+     81,232,229,226,242,229,119,128,  5,221,238,245,110,129,  5,223,
+     85, 98,232,229,226,242,229,119,128,  5,223,240,101,129,  5,227,
+     85,114,232,229,226,242,229,119,128,  5,227,244,243,225,228,105,
+    129,  5,229, 85,133,232,229,226,242,229,119,128,  5,229,242,243,
+    244,244,239,238,229,227,232,233,238,229,243,101,128,  2,201,243,
+    232,229,249,101,128, 37,201,244,225,227,249,242,233,236,236,233,
+     99,128,  4,115,246,101,142,  0, 53, 85,213, 85,222, 85,232, 86,
+      6, 86, 13, 86, 23, 86, 48, 86, 75, 86,109, 86,121, 86,132, 86,
+    165, 86,173, 86,184,225,242,225,226,233, 99,128,  6,101,226,229,
+    238,231,225,236,105,128,  9,235,227,233,242,227,236,101,129, 36,
+    100, 85,243,233,238,246,229,242,243,229,243,225,238,243,243,229,
+    242,233,102,128, 39,142,228,229,246, 97,128,  9,107,229,233,231,
+    232,244,232,115,128, 33, 93,231,117,  2, 86, 30, 86, 39,234,225,
+    242,225,244,105,128, 10,235,242,237,245,235,232,105,128, 10,107,
+    232, 97,  2, 86, 55, 86, 66,227,235,225,242,225,226,233, 99,128,
+      6,101,238,231,250,232,239,117,128, 48, 37,105,  2, 86, 81, 86,
+     99,228,229,239,231,242,225,240,232,233,227,240,225,242,229,110,
+    128, 50, 36,238,230,229,242,233,239,114,128, 32,133,237,239,238,
+    239,243,240,225,227,101,128,255, 21,239,236,228,243,244,249,236,
+    101,128,247, 53,112,  2, 86,138, 86,145,225,242,229,110,128, 36,
+    120,229,114,  2, 86,152, 86,158,233,239,100,128, 36,140,243,233,
+    225,110,128,  6,245,242,239,237,225,110,128, 33,116,243,245,240,
+    229,242,233,239,114,128, 32,117,244,232,225,105,128, 14, 85,108,
+    129,251,  2, 86,197,239,242,233,110,128,  1,146,109,  2, 86,210,
+     86,221,239,238,239,243,240,225,227,101,128,255, 70,243,241,245,
+    225,242,101,128, 51,153,111,  4, 86,240, 87,  6, 87, 18, 87, 25,
+    230, 97,  2, 86,247, 86,255,238,244,232,225,105,128, 14, 31,244,
+    232,225,105,128, 14, 29,238,231,237,225,238,244,232,225,105,128,
+     14, 79,242,225,236,108,128, 34,  0,245,114,142,  0, 52, 87, 58,
+     87, 67, 87, 77, 87,107, 87,114, 87,139, 87,166, 87,200, 87,212,
+     87,231, 87,242, 88, 19, 88, 27, 88, 38,225,242,225,226,233, 99,
+    128,  6,100,226,229,238,231,225,236,105,128,  9,234,227,233,242,
+    227,236,101,129, 36, 99, 87, 88,233,238,246,229,242,243,229,243,
+    225,238,243,243,229,242,233,102,128, 39,141,228,229,246, 97,128,
+      9,106,231,117,  2, 87,121, 87,130,234,225,242,225,244,105,128,
+     10,234,242,237,245,235,232,105,128, 10,106,232, 97,  2, 87,146,
+     87,157,227,235,225,242,225,226,233, 99,128,  6,100,238,231,250,
+    232,239,117,128, 48, 36,105,  2, 87,172, 87,190,228,229,239,231,
+    242,225,240,232,233,227,240,225,242,229,110,128, 50, 35,238,230,
+    229,242,233,239,114,128, 32,132,237,239,238,239,243,240,225,227,
+    101,128,255, 20,238,245,237,229,242,225,244,239,242,226,229,238,
+    231,225,236,105,128,  9,247,239,236,228,243,244,249,236,101,128,
+    247, 52,112,  2, 87,248, 87,255,225,242,229,110,128, 36,119,229,
+    114,  2, 88,  6, 88, 12,233,239,100,128, 36,139,243,233,225,110,
+    128,  6,244,242,239,237,225,110,128, 33,115,243,245,240,229,242,
+    233,239,114,128, 32,116,116,  2, 88, 44, 88, 82,229,229,110,  2,
+     88, 52, 88, 61,227,233,242,227,236,101,128, 36,109,112,  2, 88,
+     67, 88, 74,225,242,229,110,128, 36,129,229,242,233,239,100,128,
+     36,149,104,  2, 88, 88, 88, 93,225,105,128, 14, 84,244,239,238,
+    229,227,232,233,238,229,243,101,128,  2,203,240,225,242,229,110,
+    128, 36,161,242, 97,  2, 88,122, 88,130,227,244,233,239,110,128,
+     32, 68,238, 99,128, 32,163,103,144,  0,103, 88,171, 89,117, 89,
+    140, 89,201, 89,218, 90,139, 91,132, 91,217, 91,230, 92, 88, 92,
+    113, 92,141, 92,163, 93,108, 93,130, 93,232, 97,  9, 88,191, 88,
+    201, 88,208, 88,215, 89, 23, 89, 48, 89, 59, 89, 70, 89,104,226,
+    229,238,231,225,236,105,128,  9,151,227,245,244,101,128,  1,245,
+    228,229,246, 97,128,  9, 23,102,  4, 88,225, 88,234, 88,248, 89,
+      8,225,242,225,226,233, 99,128,  6,175,230,233,238,225,236,225,
+    242,225,226,233, 99,128,251,147,233,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,251,148,237,229,228,233,225,236,225,242,
+    225,226,233, 99,128,251,149,231,117,  2, 89, 30, 89, 39,234,225,
+    242,225,244,105,128, 10,151,242,237,245,235,232,105,128, 10, 23,
+    232,233,242,225,231,225,238, 97,128, 48, 76,235,225,244,225,235,
+    225,238, 97,128, 48,172,237,237, 97,130,  3,179, 89, 80, 89, 93,
+    236,225,244,233,238,243,237,225,236,108,128,  2, 99,243,245,240,
+    229,242,233,239,114,128,  2,224,238,231,233,225,227,239,240,244,
+    233, 99,128,  3,235, 98,  2, 89,123, 89,133,239,240,239,237,239,
+    230,111,128, 49, 13,242,229,246,101,128,  1, 31, 99,  4, 89,150,
+     89,157, 89,166, 89,188,225,242,239,110,128,  1,231,229,228,233,
+    236,236, 97,128,  1, 35,233,242, 99,  2, 89,174, 89,179,236,101,
+    128, 36,214,245,237,230,236,229,120,128,  1, 29,239,237,237,225,
+    225,227,227,229,238,116,128,  1, 35,228,239,116,129,  1, 33, 89,
+    209,225,227,227,229,238,116,128,  1, 33,101,  6, 89,232, 89,243,
+     89,254, 90,  9, 90, 28, 90,130,227,249,242,233,236,236,233, 99,
+    128,  4, 51,232,233,242,225,231,225,238, 97,128, 48, 82,235,225,
+    244,225,235,225,238, 97,128, 48,178,239,237,229,244,242,233,227,
+    225,236,236,249,229,241,245,225,108,128, 34, 81,114,  3, 90, 36,
+     90, 85, 90, 95,229,243,104,  3, 90, 46, 90, 61, 90, 70,225,227,
+    227,229,238,244,232,229,226,242,229,119,128,  5,156,232,229,226,
+    242,229,119,128,  5,243,237,245,241,228,225,237,232,229,226,242,
+    229,119,128,  5,157,237,225,238,228,226,236,115,128,  0,223,243,
+    232,225,249,233,109,  2, 90,106, 90,121,225,227,227,229,238,244,
+    232,229,226,242,229,119,128,  5,158,232,229,226,242,229,119,128,
+      5,244,244,225,237,225,242,107,128, 48, 19,104,  5, 90,151, 91,
+     28, 91, 91, 91,116, 91,122, 97,  4, 90,161, 90,171, 90,194, 90,
+    219,226,229,238,231,225,236,105,128,  9,152,100,  2, 90,177, 90,
+    188,225,242,237,229,238,233,225,110,128,  5,114,229,246, 97,128,
+      9, 24,231,117,  2, 90,201, 90,210,234,225,242,225,244,105,128,
+     10,152,242,237,245,235,232,105,128, 10, 24,233,110,  4, 90,230,
+     90,239, 90,253, 91, 13,225,242,225,226,233, 99,128,  6, 58,230,
+    233,238,225,236,225,242,225,226,233, 99,128,254,206,233,238,233,
+    244,233,225,236,225,242,225,226,233, 99,128,254,207,237,229,228,
+    233,225,236,225,242,225,226,233, 99,128,254,208,101,  3, 91, 36,
+     91, 57, 91, 74,237,233,228,228,236,229,232,239,239,235,227,249,
+    242,233,236,236,233, 99,128,  4,149,243,244,242,239,235,229,227,
+    249,242,233,236,236,233, 99,128,  4,147,245,240,244,245,242,238,
+    227,249,242,233,236,236,233, 99,128,  4,145,232, 97,  2, 91, 98,
+     91,105,228,229,246, 97,128,  9, 90,231,245,242,237,245,235,232,
+    105,128, 10, 90,239,239,107,128,  2, 96,250,243,241,245,225,242,
+    101,128, 51,147,105,  3, 91,140, 91,151, 91,162,232,233,242,225,
+    231,225,238, 97,128, 48, 78,235,225,244,225,235,225,238, 97,128,
+     48,174,109,  2, 91,168, 91,179,225,242,237,229,238,233,225,110,
+    128,  5, 99,229,108,130,  5,210, 91,188, 91,208,228,225,231,229,
+    243,104,129,251, 50, 91,199,232,229,226,242,229,119,128,251, 50,
+    232,229,226,242,229,119,128,  5,210,234,229,227,249,242,233,236,
+    236,233, 99,128,  4, 83,236,239,244,244,225,108,  2, 91,241, 92,
+      2,233,238,246,229,242,244,229,228,243,244,242,239,235,101,128,
+      1,190,243,244,239,112,132,  2,148, 92, 17, 92, 28, 92, 34, 92,
+     66,233,238,246,229,242,244,229,100,128,  2,150,237,239,100,128,
+      2,192,242,229,246,229,242,243,229,100,130,  2,149, 92, 49, 92,
+     55,237,239,100,128,  2,193,243,245,240,229,242,233,239,114,128,
+      2,228,243,244,242,239,235,101,129,  2,161, 92, 77,242,229,246,
+    229,242,243,229,100,128,  2,162,109,  2, 92, 94, 92,102,225,227,
+    242,239,110,128, 30, 33,239,238,239,243,240,225,227,101,128,255,
+     71,111,  2, 92,119, 92,130,232,233,242,225,231,225,238, 97,128,
+     48, 84,235,225,244,225,235,225,238, 97,128, 48,180,240, 97,  2,
+     92,148, 92,154,242,229,110,128, 36,162,243,241,245,225,242,101,
+    128, 51,172,114,  2, 92,169, 93, 10, 97,  2, 92,175, 92,183,228,
+    233,229,238,116,128, 34,  7,246,101,134,  0, 96, 92,200, 92,211,
+     92,228, 92,235, 92,244, 93,  0,226,229,236,239,247,227,237, 98,
+    128,  3, 22, 99,  2, 92,217, 92,222,237, 98,128,  3,  0,239,237,
+     98,128,  3,  0,228,229,246, 97,128,  9, 83,236,239,247,237,239,
+    100,128,  2,206,237,239,238,239,243,240,225,227,101,128,255, 64,
+    244,239,238,229,227,237, 98,128,  3, 64,229,225,244,229,114,132,
+      0, 62, 93, 26, 93, 45, 93, 57, 93,100,229,241,245,225,108,129,
+     34,101, 93, 36,239,242,236,229,243,115,128, 34,219,237,239,238,
+    239,243,240,225,227,101,128,255, 30,111,  2, 93, 63, 93, 89,114,
+      2, 93, 69, 93, 82,229,241,245,233,246,225,236,229,238,116,128,
+     34,115,236,229,243,115,128, 34,119,246,229,242,229,241,245,225,
+    108,128, 34,103,243,237,225,236,108,128,254,101,115,  2, 93,114,
+     93,122,227,242,233,240,116,128,  2, 97,244,242,239,235,101,128,
+      1,229,117,  4, 93,140, 93,151, 93,208, 93,219,232,233,242,225,
+    231,225,238, 97,128, 48, 80,233,108,  2, 93,158, 93,183,236,229,
+    237,239,116,  2, 93,168, 93,175,236,229,230,116,128,  0,171,242,
+    233,231,232,116,128,  0,187,243,233,238,231,108,  2, 93,193, 93,
+    200,236,229,230,116,128, 32, 57,242,233,231,232,116,128, 32, 58,
+    235,225,244,225,235,225,238, 97,128, 48,176,242,225,237,245,243,
+    241,245,225,242,101,128, 51, 24,249,243,241,245,225,242,101,128,
+     51,201,104,144,  0,104, 94, 22, 96,164, 96,199, 96,236, 97, 20,
+     98,164, 98,184, 99,149, 99,161, 99,173,100,241,100,249,101,  4,
+    101, 13,101, 93,101, 97, 97, 13, 94, 50, 94, 89, 94, 99, 94,129,
+     94,154, 94,232, 94,244, 95, 13, 95, 28, 95, 57, 95, 70, 95,128,
+     95,137, 97,  2, 94, 56, 94, 75,226,235,232,225,243,233,225,238,
+    227,249,242,233,236,236,233, 99,128,  4,169,236,244,239,238,229,
+    225,242,225,226,233, 99,128,  6,193,226,229,238,231,225,236,105,
+    128,  9,185,228,101,  2, 94,106, 94,124,243,227,229,238,228,229,
+    242,227,249,242,233,236,236,233, 99,128,  4,179,246, 97,128,  9,
+     57,231,117,  2, 94,136, 94,145,234,225,242,225,244,105,128, 10,
+    185,242,237,245,235,232,105,128, 10, 57,104,  4, 94,164, 94,173,
+     94,187, 94,217,225,242,225,226,233, 99,128,  6, 45,230,233,238,
+    225,236,225,242,225,226,233, 99,128,254,162,105,  2, 94,193, 94,
+    208,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,163,
+    242,225,231,225,238, 97,128, 48,111,237,229,228,233,225,236,225,
+    242,225,226,233, 99,128,254,164,233,244,245,243,241,245,225,242,
+    101,128, 51, 42,235,225,244,225,235,225,238, 97,129, 48,207, 95,
+      1,232,225,236,230,247,233,228,244,104,128,255,138,236,225,238,
+    244,231,245,242,237,245,235,232,105,128, 10, 77,237,250, 97,  2,
+     95, 36, 95, 45,225,242,225,226,233, 99,128,  6, 33,236,239,247,
+    225,242,225,226,233, 99,128,  6, 33,238,231,245,236,230,233,236,
+    236,229,114,128, 49,100,114,  2, 95, 76, 95, 92,228,243,233,231,
+    238,227,249,242,233,236,236,233, 99,128,  4, 74,240,239,239,110,
+      2, 95,101, 95,114,236,229,230,244,226,225,242,226,245,112,128,
+     33,188,242,233,231,232,244,226,225,242,226,245,112,128, 33,192,
+    243,241,245,225,242,101,128, 51,202,244,225,102,  3, 95,147, 95,
+    239, 96, 74,240,225,244,225,104,134,  5,178, 95,167, 95,172, 95,
+    186, 95,195, 95,210, 95,226,177, 54,128,  5,178, 50,  2, 95,178,
+     95,182, 51,128,  5,178,102,128,  5,178,232,229,226,242,229,119,
+    128,  5,178,238,225,242,242,239,247,232,229,226,242,229,119,128,
+      5,178,241,245,225,242,244,229,242,232,229,226,242,229,119,128,
+      5,178,247,233,228,229,232,229,226,242,229,119,128,  5,178,241,
+    225,237,225,244,115,135,  5,179, 96,  6, 96, 11, 96, 16, 96, 21,
+     96, 30, 96, 45, 96, 61,177, 98,128,  5,179,178, 56,128,  5,179,
+    179, 52,128,  5,179,232,229,226,242,229,119,128,  5,179,238,225,
+    242,242,239,247,232,229,226,242,229,119,128,  5,179,241,245,225,
+    242,244,229,242,232,229,226,242,229,119,128,  5,179,247,233,228,
+    229,232,229,226,242,229,119,128,  5,179,243,229,231,239,108,135,
+      5,177, 96, 96, 96,101, 96,106, 96,111, 96,120, 96,135, 96,151,
+    177, 55,128,  5,177,178, 52,128,  5,177,179, 48,128,  5,177,232,
+    229,226,242,229,119,128,  5,177,238,225,242,242,239,247,232,229,
+    226,242,229,119,128,  5,177,241,245,225,242,244,229,242,232,229,
+    226,242,229,119,128,  5,177,247,233,228,229,232,229,226,242,229,
+    119,128,  5,177, 98,  3, 96,172, 96,177, 96,187,225,114,128,  1,
+     39,239,240,239,237,239,230,111,128, 49, 15,242,229,246,229,226,
+    229,236,239,119,128, 30, 43, 99,  2, 96,205, 96,214,229,228,233,
+    236,236, 97,128, 30, 41,233,242, 99,  2, 96,222, 96,227,236,101,
+    128, 36,215,245,237,230,236,229,120,128,  1, 37,100,  2, 96,242,
+     96,252,233,229,242,229,243,233,115,128, 30, 39,239,116,  2, 97,
+      3, 97, 12,225,227,227,229,238,116,128, 30, 35,226,229,236,239,
+    119,128, 30, 37,101,136,  5,212, 97, 40, 97, 73, 97, 93, 98, 66,
+     98, 82, 98,127, 98,136, 98,149,225,242,116,129, 38,101, 97, 48,
+    243,245,233,116,  2, 97, 57, 97, 65,226,236,225,227,107,128, 38,
+    101,247,232,233,244,101,128, 38, 97,228,225,231,229,243,104,129,
+    251, 52, 97, 84,232,229,226,242,229,119,128,251, 52,104,  6, 97,
+    107, 97,135, 97,143, 97,193, 97,239, 98, 32, 97,  2, 97,113, 97,
+    127,236,244,239,238,229,225,242,225,226,233, 99,128,  6,193,242,
+    225,226,233, 99,128,  6, 71,229,226,242,229,119,128,  5,212,230,
+    233,238,225,236, 97,  2, 97,154, 97,185,236,116,  2, 97,161, 97,
+    173,239,238,229,225,242,225,226,233, 99,128,251,167,244,247,239,
+    225,242,225,226,233, 99,128,254,234,242,225,226,233, 99,128,254,
+    234,232,225,237,250,225,225,226,239,246,101,  2, 97,208, 97,222,
+    230,233,238,225,236,225,242,225,226,233, 99,128,251,165,233,243,
+    239,236,225,244,229,228,225,242,225,226,233, 99,128,251,164,105,
+      2, 97,245, 98, 23,238,233,244,233,225,236, 97,  2, 98,  1, 98,
+     15,236,244,239,238,229,225,242,225,226,233, 99,128,251,168,242,
+    225,226,233, 99,128,254,235,242,225,231,225,238, 97,128, 48,120,
+    237,229,228,233,225,236, 97,  2, 98, 44, 98, 58,236,244,239,238,
+    229,225,242,225,226,233, 99,128,251,169,242,225,226,233, 99,128,
+    254,236,233,243,229,233,229,242,225,243,241,245,225,242,101,128,
+     51,123,107,  2, 98, 88, 98,112,225,244,225,235,225,238, 97,129,
+     48,216, 98,100,232,225,236,230,247,233,228,244,104,128,255,141,
+    245,244,225,225,242,245,243,241,245,225,242,101,128, 51, 54,238,
+    231,232,239,239,107,128,  2,103,242,245,244,245,243,241,245,225,
+    242,101,128, 51, 57,116,129,  5,215, 98,155,232,229,226,242,229,
+    119,128,  5,215,232,239,239,107,129,  2,102, 98,173,243,245,240,
+    229,242,233,239,114,128,  2,177,105,  4, 98,194, 99, 23, 99, 34,
+     99, 59,229,245,104,  4, 98,206, 98,241, 99,  0, 99,  9, 97,  2,
+     98,212, 98,227,227,233,242,227,236,229,235,239,242,229,225,110,
+    128, 50,123,240,225,242,229,238,235,239,242,229,225,110,128, 50,
+     27,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,109,
+    235,239,242,229,225,110,128, 49, 78,240,225,242,229,238,235,239,
+    242,229,225,110,128, 50, 13,232,233,242,225,231,225,238, 97,128,
+     48,114,235,225,244,225,235,225,238, 97,129, 48,210, 99, 47,232,
+    225,236,230,247,233,228,244,104,128,255,139,242,233,113,134,  5,
+    180, 99, 77, 99, 82, 99, 96, 99,105, 99,120, 99,136,177, 52,128,
+      5,180, 50,  2, 99, 88, 99, 92, 49,128,  5,180,100,128,  5,180,
+    232,229,226,242,229,119,128,  5,180,238,225,242,242,239,247,232,
+    229,226,242,229,119,128,  5,180,241,245,225,242,244,229,242,232,
+    229,226,242,229,119,128,  5,180,247,233,228,229,232,229,226,242,
+    229,119,128,  5,180,236,233,238,229,226,229,236,239,119,128, 30,
+    150,237,239,238,239,243,240,225,227,101,128,255, 72,111,  9, 99,
+    193, 99,204, 99,228, 99,253,100, 85,100, 98,100,184,100,224,100,
+    235,225,242,237,229,238,233,225,110,128,  5,112,232,105,  2, 99,
+    211, 99,219,240,244,232,225,105,128, 14, 43,242,225,231,225,238,
+     97,128, 48,123,235,225,244,225,235,225,238, 97,129, 48,219, 99,
+    241,232,225,236,230,247,233,228,244,104,128,255,142,236,225,109,
+    135,  5,185,100, 17,100, 22,100, 27,100, 32,100, 41,100, 56,100,
+     72,177, 57,128,  5,185,178, 54,128,  5,185,179, 50,128,  5,185,
+    232,229,226,242,229,119,128,  5,185,238,225,242,242,239,247,232,
+    229,226,242,229,119,128,  5,185,241,245,225,242,244,229,242,232,
+    229,226,242,229,119,128,  5,185,247,233,228,229,232,229,226,242,
+    229,119,128,  5,185,238,239,235,232,245,235,244,232,225,105,128,
+     14, 46,111,  2,100,104,100,174,107,  4,100,114,100,126,100,132,
+    100,154,225,226,239,246,229,227,239,237, 98,128,  3,  9,227,237,
+     98,128,  3,  9,240,225,236,225,244,225,236,233,250,229,228,226,
+    229,236,239,247,227,237, 98,128,  3, 33,242,229,244,242,239,230,
+    236,229,248,226,229,236,239,247,227,237, 98,128,  3, 34,238,243,
+    241,245,225,242,101,128, 51, 66,114,  2,100,190,100,217,105,  2,
+    100,196,100,205,227,239,240,244,233, 99,128,  3,233,250,239,238,
+    244,225,236,226,225,114,128, 32, 21,238,227,237, 98,128,  3, 27,
+    244,243,240,242,233,238,231,115,128, 38,104,245,243,101,128, 35,
+      2,240,225,242,229,110,128, 36,163,243,245,240,229,242,233,239,
+    114,128,  2,176,244,245,242,238,229,100,128,  2,101,117,  4,101,
+     23,101, 34,101, 47,101, 72,232,233,242,225,231,225,238, 97,128,
+     48,117,233,233,244,239,243,241,245,225,242,101,128, 51, 51,235,
+    225,244,225,235,225,238, 97,129, 48,213,101, 60,232,225,236,230,
+    247,233,228,244,104,128,255,140,238,231,225,242,245,237,236,225,
+    245,116,129,  2,221,101, 87,227,237, 98,128,  3, 11,118,128,  1,
+    149,249,240,232,229,110,132,  0, 45,101,113,101,124,101,136,101,
+    159,233,238,230,229,242,233,239,114,128,246,229,237,239,238,239,
+    243,240,225,227,101,128,255, 13,115,  2,101,142,101,149,237,225,
+    236,108,128,254, 99,245,240,229,242,233,239,114,128,246,230,244,
+    247,111,128, 32, 16,105,149,  0,105,101,211,101,234,102, 12,102,
+     59,105,197,106, 61,106, 98,106,125,107, 31,107, 35,107, 73,107,
+     95,107,179,108, 88,108,163,108,171,108,184,109, 15,109, 72,109,
+    100,109,144,225, 99,  2,101,218,101,224,245,244,101,128,  0,237,
+    249,242,233,236,236,233, 99,128,  4, 79, 98,  3,101,242,101,251,
+    102,  5,229,238,231,225,236,105,128,  9,135,239,240,239,237,239,
+    230,111,128, 49, 39,242,229,246,101,128,  1, 45, 99,  3,102, 20,
+    102, 27,102, 49,225,242,239,110,128,  1,208,233,242, 99,  2,102,
+     35,102, 40,236,101,128, 36,216,245,237,230,236,229,120,128,  0,
+    238,249,242,233,236,236,233, 99,128,  4, 86,100,  4,102, 69,102,
+     79,105,154,105,187,226,236,231,242,225,246,101,128,  2,  9,101,
+      2,102, 85,105,149,239,231,242,225,240,104,  7,102,106,102,120,
+    102,133,105, 62,105, 93,105,106,105,118,229,225,242,244,232,227,
+    233,242,227,236,101,128, 50,143,230,233,242,229,227,233,242,227,
+    236,101,128, 50,139,233, 99, 14,102,164,102,180,103, 23,103, 77,
+    103,143,103,172,103,188,103,245,104, 38,104, 50,104, 77,104,144,
+    105, 26,105, 55,225,236,236,233,225,238,227,229,240,225,242,229,
+    110,128, 50, 63, 99,  4,102,190,102,201,102,215,102,222,225,236,
+    236,240,225,242,229,110,128, 50, 58,229,238,244,242,229,227,233,
+    242,227,236,101,128, 50,165,236,239,243,101,128, 48,  6,111,  3,
+    102,230,102,245,103,  9,237,237, 97,129, 48,  1,102,238,236,229,
+    230,116,128,255,100,238,231,242,225,244,245,236,225,244,233,239,
+    238,240,225,242,229,110,128, 50, 55,242,242,229,227,244,227,233,
+    242,227,236,101,128, 50,163,101,  3,103, 31,103, 43,103, 60,225,
+    242,244,232,240,225,242,229,110,128, 50, 47,238,244,229,242,240,
+    242,233,243,229,240,225,242,229,110,128, 50, 61,248,227,229,236,
+    236,229,238,244,227,233,242,227,236,101,128, 50,157,102,  2,103,
+     83,103, 98,229,243,244,233,246,225,236,240,225,242,229,110,128,
+     50, 64,105,  2,103,104,103,133,238,225,238,227,233,225,108,  2,
+    103,116,103,125,227,233,242,227,236,101,128, 50,150,240,225,242,
+    229,110,128, 50, 54,242,229,240,225,242,229,110,128, 50, 43,104,
+      2,103,149,103,160,225,246,229,240,225,242,229,110,128, 50, 50,
+    233,231,232,227,233,242,227,236,101,128, 50,164,233,244,229,242,
+    225,244,233,239,238,237,225,242,107,128, 48,  5,108,  3,103,196,
+    103,222,103,234,225,226,239,114,  2,103,205,103,214,227,233,242,
+    227,236,101,128, 50,152,240,225,242,229,110,128, 50, 56,229,230,
+    244,227,233,242,227,236,101,128, 50,167,239,247,227,233,242,227,
+    236,101,128, 50,166,109,  2,103,251,104, 27,101,  2,104,  1,104,
+     16,228,233,227,233,238,229,227,233,242,227,236,101,128, 50,169,
+    244,225,236,240,225,242,229,110,128, 50, 46,239,239,238,240,225,
+    242,229,110,128, 50, 42,238,225,237,229,240,225,242,229,110,128,
+     50, 52,112,  2,104, 56,104, 64,229,242,233,239,100,128, 48,  2,
+    242,233,238,244,227,233,242,227,236,101,128, 50,158,114,  2,104,
+     83,104,131,101,  3,104, 91,104,102,104,117,225,227,232,240,225,
+    242,229,110,128, 50, 67,240,242,229,243,229,238,244,240,225,242,
+    229,110,128, 50, 57,243,239,245,242,227,229,240,225,242,229,110,
+    128, 50, 62,233,231,232,244,227,233,242,227,236,101,128, 50,168,
+    115,  5,104,156,104,185,104,199,104,224,104,252,101,  2,104,162,
+    104,175,227,242,229,244,227,233,242,227,236,101,128, 50,153,236,
+    230,240,225,242,229,110,128, 50, 66,239,227,233,229,244,249,240,
+    225,242,229,110,128, 50, 51,112,  2,104,205,104,211,225,227,101,
+    128, 48,  0,229,227,233,225,236,240,225,242,229,110,128, 50, 53,
+    116,  2,104,230,104,241,239,227,235,240,225,242,229,110,128, 50,
+     49,245,228,249,240,225,242,229,110,128, 50, 59,117,  2,105,  2,
+    105, 11,238,240,225,242,229,110,128, 50, 48,240,229,242,246,233,
+    243,229,240,225,242,229,110,128, 50, 60,119,  2,105, 32,105, 44,
+    225,244,229,242,240,225,242,229,110,128, 50, 44,239,239,228,240,
+    225,242,229,110,128, 50, 45,250,229,242,111,128, 48,  7,109,  2,
+    105, 68,105, 81,229,244,225,236,227,233,242,227,236,101,128, 50,
+    142,239,239,238,227,233,242,227,236,101,128, 50,138,238,225,237,
+    229,227,233,242,227,236,101,128, 50,148,243,245,238,227,233,242,
+    227,236,101,128, 50,144,119,  2,105,124,105,137,225,244,229,242,
+    227,233,242,227,236,101,128, 50,140,239,239,228,227,233,242,227,
+    236,101,128, 50,141,246, 97,128,  9,  7,233,229,242,229,243,233,
+    115,130,  0,239,105,168,105,176,225,227,245,244,101,128, 30, 47,
+    227,249,242,233,236,236,233, 99,128,  4,229,239,244,226,229,236,
+    239,119,128, 30,203,101,  3,105,205,105,221,105,232,226,242,229,
+    246,229,227,249,242,233,236,236,233, 99,128,  4,215,227,249,242,
+    233,236,236,233, 99,128,  4, 53,245,238,103,  4,105,244,106, 23,
+    106, 38,106, 47, 97,  2,105,250,106,  9,227,233,242,227,236,229,
+    235,239,242,229,225,110,128, 50,117,240,225,242,229,238,235,239,
+    242,229,225,110,128, 50, 21,227,233,242,227,236,229,235,239,242,
+    229,225,110,128, 50,103,235,239,242,229,225,110,128, 49, 71,240,
+    225,242,229,238,235,239,242,229,225,110,128, 50,  7,103,  2,106,
+     67,106, 74,242,225,246,101,128,  0,236,117,  2,106, 80,106, 89,
+    234,225,242,225,244,105,128, 10,135,242,237,245,235,232,105,128,
+     10,  7,104,  2,106,104,106,114,233,242,225,231,225,238, 97,128,
+     48, 68,239,239,235,225,226,239,246,101,128, 30,201,105,  8,106,
+    143,106,153,106,164,106,171,106,196,106,212,106,227,106,243,226,
+    229,238,231,225,236,105,128,  9,136,227,249,242,233,236,236,233,
+     99,128,  4, 56,228,229,246, 97,128,  9,  8,231,117,  2,106,178,
+    106,187,234,225,242,225,244,105,128, 10,136,242,237,245,235,232,
+    105,128, 10,  8,237,225,244,242,225,231,245,242,237,245,235,232,
+    105,128, 10, 64,238,246,229,242,244,229,228,226,242,229,246,101,
+    128,  2, 11,243,232,239,242,244,227,249,242,233,236,236,233, 99,
+    128,  4, 57,246,239,247,229,236,243,233,231,110,  3,107,  3,107,
+     13,107, 20,226,229,238,231,225,236,105,128,  9,192,228,229,246,
+     97,128,  9, 64,231,245,234,225,242,225,244,105,128, 10,192,106,
+    128,  1, 51,107,  2,107, 41,107, 65,225,244,225,235,225,238, 97,
+    129, 48,164,107, 53,232,225,236,230,247,233,228,244,104,128,255,
+    114,239,242,229,225,110,128, 49, 99,108,  2,107, 79,107, 84,228,
+    101,128,  2,220,245,249,232,229,226,242,229,119,128,  5,172,109,
+      2,107,101,107,168, 97,  3,107,109,107,129,107,154,227,242,239,
+    110,129,  1, 43,107,118,227,249,242,233,236,236,233, 99,128,  4,
+    227,231,229,239,242,225,240,240,242,239,248,233,237,225,244,229,
+    236,249,229,241,245,225,108,128, 34, 83,244,242,225,231,245,242,
+    237,245,235,232,105,128, 10, 63,239,238,239,243,240,225,227,101,
+    128,255, 73,110,  5,107,191,107,201,107,210,107,222,108, 50,227,
+    242,229,237,229,238,116,128, 34,  6,230,233,238,233,244,121,128,
+     34, 30,233,225,242,237,229,238,233,225,110,128,  5,107,116,  2,
+    107,228,108, 40,101,  2,107,234,108, 29,231,242,225,108,131, 34,
+     43,107,247,108,  9,108, 14, 98,  2,107,253,108,  5,239,244,244,
+    239,109,128, 35, 33,116,128, 35, 33,229,120,128,248,245,116,  2,
+    108, 20,108, 25,239,112,128, 35, 32,112,128, 35, 32,242,243,229,
+    227,244,233,239,110,128, 34, 41,233,243,241,245,225,242,101,128,
+     51,  5,118,  3,108, 58,108, 67,108, 76,226,245,236,236,229,116,
+    128, 37,216,227,233,242,227,236,101,128, 37,217,243,237,233,236,
+    229,230,225,227,101,128, 38, 59,111,  3,108, 96,108,107,108,115,
+    227,249,242,233,236,236,233, 99,128,  4, 81,231,239,238,229,107,
+    128,  1, 47,244, 97,131,  3,185,108,126,108,147,108,155,228,233,
+    229,242,229,243,233,115,129,  3,202,108,139,244,239,238,239,115,
+    128,  3,144,236,225,244,233,110,128,  2,105,244,239,238,239,115,
+    128,  3,175,240,225,242,229,110,128, 36,164,242,233,231,245,242,
+    237,245,235,232,105,128, 10,114,115,  4,108,194,108,239,108,253,
+    109,  5,237,225,236,108,  2,108,203,108,214,232,233,242,225,231,
+    225,238, 97,128, 48, 67,235,225,244,225,235,225,238, 97,129, 48,
+    163,108,227,232,225,236,230,247,233,228,244,104,128,255,104,243,
+    232,225,242,226,229,238,231,225,236,105,128,  9,250,244,242,239,
+    235,101,128,  2,104,245,240,229,242,233,239,114,128,246,237,116,
+      2,109, 21,109, 55,229,242,225,244,233,239,110,  2,109, 33,109,
+     44,232,233,242,225,231,225,238, 97,128, 48,157,235,225,244,225,
+    235,225,238, 97,128, 48,253,233,236,228,101,129,  1, 41,109, 64,
+    226,229,236,239,119,128, 30, 45,117,  2,109, 78,109, 89,226,239,
+    240,239,237,239,230,111,128, 49, 41,227,249,242,233,236,236,233,
+     99,128,  4, 78,246,239,247,229,236,243,233,231,110,  3,109,116,
+    109,126,109,133,226,229,238,231,225,236,105,128,  9,191,228,229,
+    246, 97,128,  9, 63,231,245,234,225,242,225,244,105,128, 10,191,
+    250,232,233,244,243, 97,  2,109,155,109,166,227,249,242,233,236,
+    236,233, 99,128,  4,117,228,226,236,231,242,225,246,229,227,249,
+    242,233,236,236,233, 99,128,  4,119,106,138,  0,106,109,209,110,
+     16,110, 27,110, 77,110, 93,110,206,111, 19,111, 24,111, 36,111,
+     44, 97,  4,109,219,109,230,109,240,109,247,225,242,237,229,238,
+    233,225,110,128,  5,113,226,229,238,231,225,236,105,128,  9,156,
+    228,229,246, 97,128,  9, 28,231,117,  2,109,254,110,  7,234,225,
+    242,225,244,105,128, 10,156,242,237,245,235,232,105,128, 10, 28,
+    226,239,240,239,237,239,230,111,128, 49, 16, 99,  3,110, 35,110,
+     42,110, 64,225,242,239,110,128,  1,240,233,242, 99,  2,110, 50,
+    110, 55,236,101,128, 36,217,245,237,230,236,229,120,128,  1, 53,
+    242,239,243,243,229,228,244,225,233,108,128,  2,157,228,239,244,
+    236,229,243,243,243,244,242,239,235,101,128,  2, 95,101,  3,110,
+    101,110,112,110,177,227,249,242,233,236,236,233, 99,128,  4, 88,
+    229,109,  4,110,123,110,132,110,146,110,162,225,242,225,226,233,
+     99,128,  6, 44,230,233,238,225,236,225,242,225,226,233, 99,128,
+    254,158,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,
+    254,159,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,
+    160,104,  2,110,183,110,192,225,242,225,226,233, 99,128,  6,152,
+    230,233,238,225,236,225,242,225,226,233, 99,128,251,139,104,  2,
+    110,212,111,  6, 97,  3,110,220,110,230,110,237,226,229,238,231,
+    225,236,105,128,  9,157,228,229,246, 97,128,  9, 29,231,117,  2,
+    110,244,110,253,234,225,242,225,244,105,128, 10,157,242,237,245,
+    235,232,105,128, 10, 29,229,232,225,242,237,229,238,233,225,110,
+    128,  5,123,233,115,128, 48,  4,237,239,238,239,243,240,225,227,
+    101,128,255, 74,240,225,242,229,110,128, 36,165,243,245,240,229,
+    242,233,239,114,128,  2,178,107,146,  0,107,111, 95,113,184,113,
+    195,114,  1,114, 12,114,102,114,116,115,224,116,164,116,177,116,
+    203,116,252,117,134,117,156,117,169,117,192,117,234,117,244, 97,
+     12,111,121,111,153,111,175,111,205,112, 63,112, 88,112,118,112,
+    143,112,249,113,  7,113,130,113,159, 98,  2,111,127,111,144,225,
+    243,232,235,233,242,227,249,242,233,236,236,233, 99,128,  4,161,
+    229,238,231,225,236,105,128,  9,149, 99,  2,111,159,111,165,245,
+    244,101,128, 30, 49,249,242,233,236,236,233, 99,128,  4, 58,228,
+    101,  2,111,182,111,200,243,227,229,238,228,229,242,227,249,242,
+    233,236,236,233, 99,128,  4,155,246, 97,128,  9, 21,102,135,  5,
+    219,111,223,111,232,111,252,112, 10,112, 19,112, 35,112, 50,225,
+    242,225,226,233, 99,128,  6, 67,228,225,231,229,243,104,129,251,
+     59,111,243,232,229,226,242,229,119,128,251, 59,230,233,238,225,
+    236,225,242,225,226,233, 99,128,254,218,232,229,226,242,229,119,
+    128,  5,219,233,238,233,244,233,225,236,225,242,225,226,233, 99,
+    128,254,219,237,229,228,233,225,236,225,242,225,226,233, 99,128,
+    254,220,242,225,230,229,232,229,226,242,229,119,128,251, 77,231,
+    117,  2,112, 70,112, 79,234,225,242,225,244,105,128, 10,149,242,
+    237,245,235,232,105,128, 10, 21,104,  2,112, 94,112,104,233,242,
+    225,231,225,238, 97,128, 48, 75,239,239,235,227,249,242,233,236,
+    236,233, 99,128,  4,196,235,225,244,225,235,225,238, 97,129, 48,
+    171,112,131,232,225,236,230,247,233,228,244,104,128,255,118,112,
+      2,112,149,112,170,240, 97,129,  3,186,112,156,243,249,237,226,
+    239,236,231,242,229,229,107,128,  3,240,249,229,239,245,110,  3,
+    112,182,112,196,112,230,237,233,229,245,237,235,239,242,229,225,
+    110,128, 49,113,112,  2,112,202,112,217,232,233,229,245,240,232,
+    235,239,242,229,225,110,128, 49,132,233,229,245,240,235,239,242,
+    229,225,110,128, 49,120,243,243,225,238,231,240,233,229,245,240,
+    235,239,242,229,225,110,128, 49,121,242,239,242,233,233,243,241,
+    245,225,242,101,128, 51, 13,115,  5,113, 19,113, 63,113, 78,113,
+     86,113,114,232,233,228,225,225,245,244,111,  2,113, 32,113, 41,
+    225,242,225,226,233, 99,128,  6, 64,238,239,243,233,228,229,226,
+    229,225,242,233,238,231,225,242,225,226,233, 99,128,  6, 64,237,
+    225,236,236,235,225,244,225,235,225,238, 97,128, 48,245,241,245,
+    225,242,101,128, 51,132,242, 97,  2,113, 93,113,102,225,242,225,
+    226,233, 99,128,  6, 80,244,225,238,225,242,225,226,233, 99,128,
+      6, 77,244,242,239,235,229,227,249,242,233,236,236,233, 99,128,
+      4,159,244,225,232,233,242,225,240,242,239,236,239,238,231,237,
+    225,242,235,232,225,236,230,247,233,228,244,104,128,255,112,246,
+    229,242,244,233,227,225,236,243,244,242,239,235,229,227,249,242,
+    233,236,236,233, 99,128,  4,157,226,239,240,239,237,239,230,111,
+    128, 49, 14, 99,  4,113,205,113,227,113,236,113,244, 97,  2,113,
+    211,113,221,236,243,241,245,225,242,101,128, 51,137,242,239,110,
+    128,  1,233,229,228,233,236,236, 97,128,  1, 55,233,242,227,236,
+    101,128, 36,218,239,237,237,225,225,227,227,229,238,116,128,  1,
+     55,228,239,244,226,229,236,239,119,128, 30, 51,101,  4,114, 22,
+    114, 49,114, 74,114, 86,104,  2,114, 28,114, 39,225,242,237,229,
+    238,233,225,110,128,  5,132,233,242,225,231,225,238, 97,128, 48,
+     81,235,225,244,225,235,225,238, 97,129, 48,177,114, 62,232,225,
+    236,230,247,233,228,244,104,128,255,121,238,225,242,237,229,238,
+    233,225,110,128,  5,111,243,237,225,236,236,235,225,244,225,235,
+    225,238, 97,128, 48,246,231,242,229,229,238,236,225,238,228,233,
+     99,128,  1, 56,104,  6,114,130,115,  3,115, 14,115, 39,115,126,
+    115,214, 97,  5,114,142,114,152,114,163,114,170,114,195,226,229,
+    238,231,225,236,105,128,  9,150,227,249,242,233,236,236,233, 99,
+    128,  4, 69,228,229,246, 97,128,  9, 22,231,117,  2,114,177,114,
+    186,234,225,242,225,244,105,128, 10,150,242,237,245,235,232,105,
+    128, 10, 22,104,  4,114,205,114,214,114,228,114,244,225,242,225,
+    226,233, 99,128,  6, 46,230,233,238,225,236,225,242,225,226,233,
+     99,128,254,166,233,238,233,244,233,225,236,225,242,225,226,233,
+     99,128,254,167,237,229,228,233,225,236,225,242,225,226,233, 99,
+    128,254,168,229,233,227,239,240,244,233, 99,128,  3,231,232, 97,
+      2,115, 21,115, 28,228,229,246, 97,128,  9, 89,231,245,242,237,
+    245,235,232,105,128, 10, 89,233,229,245,235,104,  4,115, 53,115,
+     88,115,103,115,112, 97,  2,115, 59,115, 74,227,233,242,227,236,
+    229,235,239,242,229,225,110,128, 50,120,240,225,242,229,238,235,
+    239,242,229,225,110,128, 50, 24,227,233,242,227,236,229,235,239,
+    242,229,225,110,128, 50,106,235,239,242,229,225,110,128, 49, 75,
+    240,225,242,229,238,235,239,242,229,225,110,128, 50, 10,111,  4,
+    115,136,115,185,115,195,115,200,235,104,  4,115,147,115,156,115,
+    165,115,175,225,233,244,232,225,105,128, 14,  2,239,238,244,232,
+    225,105,128, 14,  5,245,225,244,244,232,225,105,128, 14,  3,247,
+    225,233,244,232,225,105,128, 14,  4,237,245,244,244,232,225,105,
+    128, 14, 91,239,107,128,  1,153,242,225,235,232,225,238,231,244,
+    232,225,105,128, 14,  6,250,243,241,245,225,242,101,128, 51,145,
+    105,  4,115,234,115,245,116, 14,116, 63,232,233,242,225,231,225,
+    238, 97,128, 48, 77,235,225,244,225,235,225,238, 97,129, 48,173,
+    116,  2,232,225,236,230,247,233,228,244,104,128,255,119,242,111,
+      3,116, 23,116, 38,116, 54,231,245,242,225,237,245,243,241,245,
+    225,242,101,128, 51, 21,237,229,229,244,239,242,245,243,241,245,
+    225,242,101,128, 51, 22,243,241,245,225,242,101,128, 51, 20,249,
+    229,239,107,  5,116, 78,116,113,116,128,116,137,116,151, 97,  2,
+    116, 84,116, 99,227,233,242,227,236,229,235,239,242,229,225,110,
+    128, 50,110,240,225,242,229,238,235,239,242,229,225,110,128, 50,
+     14,227,233,242,227,236,229,235,239,242,229,225,110,128, 50, 96,
+    235,239,242,229,225,110,128, 49, 49,240,225,242,229,238,235,239,
+    242,229,225,110,128, 50,  0,243,233,239,243,235,239,242,229,225,
+    110,128, 49, 51,234,229,227,249,242,233,236,236,233, 99,128,  4,
+     92,108,  2,116,183,116,194,233,238,229,226,229,236,239,119,128,
+     30, 53,243,241,245,225,242,101,128, 51,152,109,  3,116,211,116,
+    225,116,236,227,245,226,229,228,243,241,245,225,242,101,128, 51,
+    166,239,238,239,243,240,225,227,101,128,255, 75,243,241,245,225,
+    242,229,228,243,241,245,225,242,101,128, 51,162,111,  5,117,  8,
+    117, 34,117, 72,117, 84,117, 98,104,  2,117, 14,117, 24,233,242,
+    225,231,225,238, 97,128, 48, 83,237,243,241,245,225,242,101,128,
+     51,192,235, 97,  2,117, 41,117, 49,233,244,232,225,105,128, 14,
+      1,244,225,235,225,238, 97,129, 48,179,117, 60,232,225,236,230,
+    247,233,228,244,104,128,255,122,239,240,239,243,241,245,225,242,
+    101,128, 51, 30,240,240,225,227,249,242,233,236,236,233, 99,128,
+      4,129,114,  2,117,104,117,124,229,225,238,243,244,225,238,228,
+    225,242,228,243,249,237,226,239,108,128, 50,127,239,238,233,243,
+    227,237, 98,128,  3, 67,240, 97,  2,117,141,117,147,242,229,110,
+    128, 36,166,243,241,245,225,242,101,128, 51,170,243,233,227,249,
+    242,233,236,236,233, 99,128,  4,111,116,  2,117,175,117,184,243,
+    241,245,225,242,101,128, 51,207,245,242,238,229,100,128,  2,158,
+    117,  2,117,198,117,209,232,233,242,225,231,225,238, 97,128, 48,
+     79,235,225,244,225,235,225,238, 97,129, 48,175,117,222,232,225,
+    236,230,247,233,228,244,104,128,255,120,246,243,241,245,225,242,
+    101,128, 51,184,247,243,241,245,225,242,101,128, 51,190,108,146,
+      0,108,118, 38,120, 65,120, 94,120,160,120,198,121, 94,121,103,
+    121,119,121,143,121,161,122, 23,122, 64,122,199,122,207,122,240,
+    122,249,123,  1,123, 63, 97,  7,118, 54,118, 64,118, 71,118, 78,
+    118,103,118,119,120, 53,226,229,238,231,225,236,105,128,  9,178,
+    227,245,244,101,128,  1, 58,228,229,246, 97,128,  9, 50,231,117,
+      2,118, 85,118, 94,234,225,242,225,244,105,128, 10,178,242,237,
+    245,235,232,105,128, 10, 50,235,235,232,225,238,231,249,225,239,
+    244,232,225,105,128, 14, 69,109, 10,118,141,119, 80,119, 97,119,
+    135,119,149,119,168,119,184,119,204,119,224,119,247, 97,  2,118,
+    147,119, 72,236,229,102,  4,118,159,118,173,119,  9,119, 26,230,
+    233,238,225,236,225,242,225,226,233, 99,128,254,252,232,225,237,
+    250, 97,  2,118,183,118,224,225,226,239,246,101,  2,118,193,118,
+    207,230,233,238,225,236,225,242,225,226,233, 99,128,254,248,233,
+    243,239,236,225,244,229,228,225,242,225,226,233, 99,128,254,247,
+    226,229,236,239,119,  2,118,234,118,248,230,233,238,225,236,225,
+    242,225,226,233, 99,128,254,250,233,243,239,236,225,244,229,228,
+    225,242,225,226,233, 99,128,254,249,233,243,239,236,225,244,229,
+    228,225,242,225,226,233, 99,128,254,251,237,225,228,228,225,225,
+    226,239,246,101,  2,119, 41,119, 55,230,233,238,225,236,225,242,
+    225,226,233, 99,128,254,246,233,243,239,236,225,244,229,228,225,
+    242,225,226,233, 99,128,254,245,242,225,226,233, 99,128,  6, 68,
+    226,228, 97,129,  3,187,119, 88,243,244,242,239,235,101,128,  1,
+    155,229,100,130,  5,220,119,106,119,126,228,225,231,229,243,104,
+    129,251, 60,119,117,232,229,226,242,229,119,128,251, 60,232,229,
+    226,242,229,119,128,  5,220,230,233,238,225,236,225,242,225,226,
+    233, 99,128,254,222,232,225,232,233,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,252,202,233,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,254,223,234,229,229,237,233,238,233,244,
+    233,225,236,225,242,225,226,233, 99,128,252,201,235,232,225,232,
+    233,238,233,244,233,225,236,225,242,225,226,233, 99,128,252,203,
+    236,225,237,232,229,232,233,243,239,236,225,244,229,228,225,242,
+    225,226,233, 99,128,253,242,237,101,  2,119,254,120, 11,228,233,
+    225,236,225,242,225,226,233, 99,128,254,224,229,109,  2,120, 18,
+    120, 37,232,225,232,233,238,233,244,233,225,236,225,242,225,226,
+    233, 99,128,253,136,233,238,233,244,233,225,236,225,242,225,226,
+    233, 99,128,252,204,242,231,229,227,233,242,227,236,101,128, 37,
+    239, 98,  3,120, 73,120, 78,120, 84,225,114,128,  1,154,229,236,
+    116,128,  2,108,239,240,239,237,239,230,111,128, 49, 12, 99,  4,
+    120,104,120,111,120,120,120,147,225,242,239,110,128,  1, 62,229,
+    228,233,236,236, 97,128,  1, 60,233,242, 99,  2,120,128,120,133,
+    236,101,128, 36,219,245,237,230,236,229,248,226,229,236,239,119,
+    128, 30, 61,239,237,237,225,225,227,227,229,238,116,128,  1, 60,
+    228,239,116,130,  1, 64,120,170,120,179,225,227,227,229,238,116,
+    128,  1, 64,226,229,236,239,119,129, 30, 55,120,189,237,225,227,
+    242,239,110,128, 30, 57,101,  3,120,206,120,244,121, 89,230,116,
+      2,120,213,120,229,225,238,231,236,229,225,226,239,246,229,227,
+    237, 98,128,  3, 26,244,225,227,235,226,229,236,239,247,227,237,
+     98,128,  3, 24,243,115,132,  0, 60,121,  1,121, 23,121, 35,121,
+     81,229,241,245,225,108,129, 34,100,121, 11,239,242,231,242,229,
+    225,244,229,114,128, 34,218,237,239,238,239,243,240,225,227,101,
+    128,255, 28,111,  2,121, 41,121, 70,114,  2,121, 47,121, 60,229,
+    241,245,233,246,225,236,229,238,116,128, 34,114,231,242,229,225,
+    244,229,114,128, 34,118,246,229,242,229,241,245,225,108,128, 34,
+    102,243,237,225,236,108,128,254,100,250,104,128,  2,110,230,226,
+    236,239,227,107,128, 37,140,232,239,239,235,242,229,244,242,239,
+    230,236,229,120,128,  2,109,105,  2,121,125,121,130,242, 97,128,
+     32,164,247,238,225,242,237,229,238,233,225,110,128,  5,108,106,
+    129,  1,201,121,149,229,227,249,242,233,236,236,233, 99,128,  4,
+     89,108,132,246,192,121,173,121,197,121,208,121,217, 97,  2,121,
+    179,121,186,228,229,246, 97,128,  9, 51,231,245,234,225,242,225,
+    244,105,128, 10,179,233,238,229,226,229,236,239,119,128, 30, 59,
+    236,225,228,229,246, 97,128,  9, 52,246,239,227,225,236,233, 99,
+      3,121,231,121,241,121,248,226,229,238,231,225,236,105,128,  9,
+    225,228,229,246, 97,128,  9, 97,246,239,247,229,236,243,233,231,
+    110,  2,122,  6,122, 16,226,229,238,231,225,236,105,128,  9,227,
+    228,229,246, 97,128,  9, 99,109,  3,122, 31,122, 44,122, 55,233,
+    228,228,236,229,244,233,236,228,101,128,  2,107,239,238,239,243,
+    240,225,227,101,128,255, 76,243,241,245,225,242,101,128, 51,208,
+    111,  6,122, 78,122, 90,122,132,122,143,122,149,122,191,227,232,
+    245,236,225,244,232,225,105,128, 14, 44,231,233,227,225,108,  3,
+    122,102,122,108,122,127,225,238,100,128, 34, 39,238,239,116,129,
+      0,172,122,116,242,229,246,229,242,243,229,100,128, 35, 16,239,
+    114,128, 34, 40,236,233,238,231,244,232,225,105,128, 14, 37,238,
+    231,115,128,  1,127,247,236,233,238,101,  2,122,159,122,182, 99,
+      2,122,165,122,177,229,238,244,229,242,236,233,238,101,128,254,
+     78,237, 98,128,  3, 50,228,225,243,232,229,100,128,254, 77,250,
+    229,238,231,101,128, 37,202,240,225,242,229,110,128, 36,167,115,
+      3,122,215,122,222,122,230,236,225,243,104,128,  1, 66,241,245,
+    225,242,101,128, 33, 19,245,240,229,242,233,239,114,128,246,238,
+    244,243,232,225,228,101,128, 37,145,245,244,232,225,105,128, 14,
+     38,246,239,227,225,236,233, 99,  3,123, 15,123, 25,123, 32,226,
+    229,238,231,225,236,105,128,  9,140,228,229,246, 97,128,  9, 12,
+    246,239,247,229,236,243,233,231,110,  2,123, 46,123, 56,226,229,
+    238,231,225,236,105,128,  9,226,228,229,246, 97,128,  9, 98,248,
+    243,241,245,225,242,101,128, 51,211,109,144,  0,109,123,109,125,
+    218,125,243,126, 14,126, 39,127, 92,127,114,128,169,128,199,128,
+    248,129, 99,129,121,129,146,129,155,130,182,130,210, 97, 12,123,
+    135,123,145,123,209,123,216,123,241,124, 33,125,125,125,150,125,
+    155,125,169,125,181,125,186,226,229,238,231,225,236,105,128,  9,
+    174, 99,  2,123,151,123,203,242,239,110,132,  0,175,123,165,123,
+    176,123,182,123,191,226,229,236,239,247,227,237, 98,128,  3, 49,
+    227,237, 98,128,  3,  4,236,239,247,237,239,100,128,  2,205,237,
+    239,238,239,243,240,225,227,101,128,255,227,245,244,101,128, 30,
+     63,228,229,246, 97,128,  9, 46,231,117,  2,123,223,123,232,234,
+    225,242,225,244,105,128, 10,174,242,237,245,235,232,105,128, 10,
+     46,104,  2,123,247,124, 23,225,240,225,235,104,  2,124,  1,124,
+     10,232,229,226,242,229,119,128,  5,164,236,229,230,244,232,229,
+    226,242,229,119,128,  5,164,233,242,225,231,225,238, 97,128, 48,
+    126,105,  5,124, 45,124,114,124,177,124,207,125,113,227,232,225,
+    244,244,225,247, 97,  3,124, 60,124, 91,124, 98,236,239,119,  2,
+    124, 68,124, 79,236,229,230,244,244,232,225,105,128,248,149,242,
+    233,231,232,244,244,232,225,105,128,248,148,244,232,225,105,128,
+     14, 75,245,240,240,229,242,236,229,230,244,244,232,225,105,128,
+    248,147,229,107,  3,124,123,124,154,124,161,236,239,119,  2,124,
+    131,124,142,236,229,230,244,244,232,225,105,128,248,140,242,233,
+    231,232,244,244,232,225,105,128,248,139,244,232,225,105,128, 14,
+     72,245,240,240,229,242,236,229,230,244,244,232,225,105,128,248,
+    138,232,225,238,225,235,225,116,  2,124,189,124,200,236,229,230,
+    244,244,232,225,105,128,248,132,244,232,225,105,128, 14, 49,116,
+      3,124,215,124,243,125, 50,225,233,235,232,117,  2,124,225,124,
+    236,236,229,230,244,244,232,225,105,128,248,137,244,232,225,105,
+    128, 14, 71,232,111,  3,124,252,125, 27,125, 34,236,239,119,  2,
+    125,  4,125, 15,236,229,230,244,244,232,225,105,128,248,143,242,
+    233,231,232,244,244,232,225,105,128,248,142,244,232,225,105,128,
+     14, 73,245,240,240,229,242,236,229,230,244,244,232,225,105,128,
+    248,141,242,105,  3,125, 59,125, 90,125, 97,236,239,119,  2,125,
+     67,125, 78,236,229,230,244,244,232,225,105,128,248,146,242,233,
+    231,232,244,244,232,225,105,128,248,145,244,232,225,105,128, 14,
+     74,245,240,240,229,242,236,229,230,244,244,232,225,105,128,248,
+    144,249,225,237,239,235,244,232,225,105,128, 14, 70,235,225,244,
+    225,235,225,238, 97,129, 48,222,125,138,232,225,236,230,247,233,
+    228,244,104,128,255,143,236,101,128, 38, 66,238,243,249,239,238,
+    243,241,245,225,242,101,128, 51, 71,241,225,230,232,229,226,242,
+    229,119,128,  5,190,242,115,128, 38, 66,115,  2,125,192,125,210,
+    239,242,225,227,233,242,227,236,229,232,229,226,242,229,119,128,
+      5,175,241,245,225,242,101,128, 51,131, 98,  2,125,224,125,234,
+    239,240,239,237,239,230,111,128, 49,  7,243,241,245,225,242,101,
+    128, 51,212, 99,  2,125,249,126,  1,233,242,227,236,101,128, 36,
+    220,245,226,229,228,243,241,245,225,242,101,128, 51,165,228,239,
+    116,  2,126, 22,126, 31,225,227,227,229,238,116,128, 30, 65,226,
+    229,236,239,119,128, 30, 67,101,  7,126, 55,126,182,126,193,126,
+    208,126,233,127, 14,127, 26,101,  2,126, 61,126,169,109,  4,126,
+     71,126, 80,126, 94,126,110,225,242,225,226,233, 99,128,  6, 69,
+    230,233,238,225,236,225,242,225,226,233, 99,128,254,226,233,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,254,227,237,101,
+      2,126,117,126,130,228,233,225,236,225,242,225,226,233, 99,128,
+    254,228,229,237,105,  2,126,138,126,153,238,233,244,233,225,236,
+    225,242,225,226,233, 99,128,252,209,243,239,236,225,244,229,228,
+    225,242,225,226,233, 99,128,252, 72,244,239,242,245,243,241,245,
+    225,242,101,128, 51, 77,232,233,242,225,231,225,238, 97,128, 48,
+    129,233,250,233,229,242,225,243,241,245,225,242,101,128, 51,126,
+    235,225,244,225,235,225,238, 97,129, 48,225,126,221,232,225,236,
+    230,247,233,228,244,104,128,255,146,109,130,  5,222,126,241,127,
+      5,228,225,231,229,243,104,129,251, 62,126,252,232,229,226,242,
+    229,119,128,251, 62,232,229,226,242,229,119,128,  5,222,238,225,
+    242,237,229,238,233,225,110,128,  5,116,242,235,232, 97,  3,127,
+     37,127, 46,127, 79,232,229,226,242,229,119,128,  5,165,235,229,
+    230,245,236, 97,  2,127, 57,127, 66,232,229,226,242,229,119,128,
+      5,166,236,229,230,244,232,229,226,242,229,119,128,  5,166,236,
+    229,230,244,232,229,226,242,229,119,128,  5,165,104,  2,127, 98,
+    127,104,239,239,107,128,  2,113,250,243,241,245,225,242,101,128,
+     51,146,105,  6,127,128,127,165,128, 46,128, 57,128, 82,128,139,
+    228,100,  2,127,135,127,160,236,229,228,239,244,235,225,244,225,
+    235,225,238,225,232,225,236,230,247,233,228,244,104,128,255,101,
+    239,116,128,  0,183,229,245,109,  5,127,179,127,214,127,229,127,
+    238,128, 33, 97,  2,127,185,127,200,227,233,242,227,236,229,235,
+    239,242,229,225,110,128, 50,114,240,225,242,229,238,235,239,242,
+    229,225,110,128, 50, 18,227,233,242,227,236,229,235,239,242,229,
+    225,110,128, 50,100,235,239,242,229,225,110,128, 49, 65,112,  2,
+    127,244,128, 20, 97,  2,127,250,128,  8,238,243,233,239,243,235,
+    239,242,229,225,110,128, 49,112,242,229,238,235,239,242,229,225,
+    110,128, 50,  4,233,229,245,240,235,239,242,229,225,110,128, 49,
+    110,243,233,239,243,235,239,242,229,225,110,128, 49,111,232,233,
+    242,225,231,225,238, 97,128, 48,127,235,225,244,225,235,225,238,
+     97,129, 48,223,128, 70,232,225,236,230,247,233,228,244,104,128,
+    255,144,238,117,  2,128, 89,128,134,115,132, 34, 18,128,101,128,
+    112,128,121,128,127,226,229,236,239,247,227,237, 98,128,  3, 32,
+    227,233,242,227,236,101,128, 34,150,237,239,100,128,  2,215,240,
+    236,245,115,128, 34, 19,244,101,128, 32, 50,242,105,  2,128,146,
+    128,160,226,225,225,242,245,243,241,245,225,242,101,128, 51, 74,
+    243,241,245,225,242,101,128, 51, 73,108,  2,128,175,128,190,239,
+    238,231,236,229,231,244,245,242,238,229,100,128,  2,112,243,241,
+    245,225,242,101,128, 51,150,109,  3,128,207,128,221,128,232,227,
+    245,226,229,228,243,241,245,225,242,101,128, 51,163,239,238,239,
+    243,240,225,227,101,128,255, 77,243,241,245,225,242,229,228,243,
+    241,245,225,242,101,128, 51,159,111,  5,129,  4,129, 30,129, 55,
+    129, 65,129, 74,104,  2,129, 10,129, 20,233,242,225,231,225,238,
+     97,128, 48,130,237,243,241,245,225,242,101,128, 51,193,235,225,
+    244,225,235,225,238, 97,129, 48,226,129, 43,232,225,236,230,247,
+    233,228,244,104,128,255,147,236,243,241,245,225,242,101,128, 51,
+    214,237,225,244,232,225,105,128, 14, 33,246,229,242,243,243,241,
+    245,225,242,101,129, 51,167,129, 89,228,243,241,245,225,242,101,
+    128, 51,168,240, 97,  2,129,106,129,112,242,229,110,128, 36,168,
+    243,241,245,225,242,101,128, 51,171,115,  2,129,127,129,136,243,
+    241,245,225,242,101,128, 51,179,245,240,229,242,233,239,114,128,
+    246,239,244,245,242,238,229,100,128,  2,111,117,141,  0,181,129,
+    185,129,189,129,199,129,223,129,233,129,255,130, 10,130, 35,130,
+     58,130, 68,130, 98,130,162,130,172, 49,128,  0,181,225,243,241,
+    245,225,242,101,128, 51,130,227,104,  2,129,206,129,216,231,242,
+    229,225,244,229,114,128, 34,107,236,229,243,115,128, 34,106,230,
+    243,241,245,225,242,101,128, 51,140,103,  2,129,239,129,246,242,
+    229,229,107,128,  3,188,243,241,245,225,242,101,128, 51,141,232,
+    233,242,225,231,225,238, 97,128, 48,128,235,225,244,225,235,225,
+    238, 97,129, 48,224,130, 23,232,225,236,230,247,233,228,244,104,
+    128,255,145,108,  2,130, 41,130, 50,243,241,245,225,242,101,128,
+     51,149,244,233,240,236,121,128,  0,215,237,243,241,245,225,242,
+    101,128, 51,155,238,225,104,  2,130, 76,130, 85,232,229,226,242,
+    229,119,128,  5,163,236,229,230,244,232,229,226,242,229,119,128,
+      5,163,115,  2,130,104,130,153,233, 99,  3,130,113,130,130,130,
+    141,225,236,238,239,244,101,129, 38,106,130,124,228,226,108,128,
+     38,107,230,236,225,244,243,233,231,110,128, 38,109,243,232,225,
+    242,240,243,233,231,110,128, 38,111,243,241,245,225,242,101,128,
+     51,178,246,243,241,245,225,242,101,128, 51,182,247,243,241,245,
+    225,242,101,128, 51,188,118,  2,130,188,130,201,237,229,231,225,
+    243,241,245,225,242,101,128, 51,185,243,241,245,225,242,101,128,
+     51,183,119,  2,130,216,130,229,237,229,231,225,243,241,245,225,
+    242,101,128, 51,191,243,241,245,225,242,101,128, 51,189,110,150,
+      0,110,131, 30,131,164,131,188,131,254,132, 23,132, 81,132, 91,
+    132,158,132,201,134,235,134,253,135, 22,135, 53,135, 79,135,144,
+    137,126,137,134,137,159,137,167,138,135,138,145,138,155, 97,  8,
+    131, 48,131, 68,131, 75,131, 82,131,107,131,118,131,143,131,155,
+     98,  2,131, 54,131, 63,229,238,231,225,236,105,128,  9,168,236,
+     97,128, 34,  7,227,245,244,101,128,  1, 68,228,229,246, 97,128,
+      9, 40,231,117,  2,131, 89,131, 98,234,225,242,225,244,105,128,
+     10,168,242,237,245,235,232,105,128, 10, 40,232,233,242,225,231,
+    225,238, 97,128, 48,106,235,225,244,225,235,225,238, 97,129, 48,
+    202,131,131,232,225,236,230,247,233,228,244,104,128,255,133,240,
+    239,243,244,242,239,240,232,101,128,  1, 73,243,241,245,225,242,
+    101,128, 51,129, 98,  2,131,170,131,180,239,240,239,237,239,230,
+    111,128, 49, 11,243,240,225,227,101,128,  0,160, 99,  4,131,198,
+    131,205,131,214,131,241,225,242,239,110,128,  1, 72,229,228,233,
+    236,236, 97,128,  1, 70,233,242, 99,  2,131,222,131,227,236,101,
+    128, 36,221,245,237,230,236,229,248,226,229,236,239,119,128, 30,
+     75,239,237,237,225,225,227,227,229,238,116,128,  1, 70,228,239,
+    116,  2,132,  6,132, 15,225,227,227,229,238,116,128, 30, 69,226,
+    229,236,239,119,128, 30, 71,101,  3,132, 31,132, 42,132, 67,232,
+    233,242,225,231,225,238, 97,128, 48,109,235,225,244,225,235,225,
+    238, 97,129, 48,205,132, 55,232,225,236,230,247,233,228,244,104,
+    128,255,136,247,243,232,229,241,229,236,243,233,231,110,128, 32,
+    170,230,243,241,245,225,242,101,128, 51,139,103,  2,132, 97,132,
+    147, 97,  3,132,105,132,115,132,122,226,229,238,231,225,236,105,
+    128,  9,153,228,229,246, 97,128,  9, 25,231,117,  2,132,129,132,
+    138,234,225,242,225,244,105,128, 10,153,242,237,245,235,232,105,
+    128, 10, 25,239,238,231,245,244,232,225,105,128, 14,  7,104,  2,
+    132,164,132,174,233,242,225,231,225,238, 97,128, 48,147,239,239,
+    107,  2,132,182,132,189,236,229,230,116,128,  2,114,242,229,244,
+    242,239,230,236,229,120,128,  2,115,105,  4,132,211,133,124,133,
+    135,133,193,229,245,110,  7,132,229,133,  8,133, 40,133, 54,133,
+     63,133, 96,133,109, 97,  2,132,235,132,250,227,233,242,227,236,
+    229,235,239,242,229,225,110,128, 50,111,240,225,242,229,238,235,
+    239,242,229,225,110,128, 50, 15,227,105,  2,133, 15,133, 27,229,
+    245,227,235,239,242,229,225,110,128, 49, 53,242,227,236,229,235,
+    239,242,229,225,110,128, 50, 97,232,233,229,245,232,235,239,242,
+    229,225,110,128, 49, 54,235,239,242,229,225,110,128, 49, 52,240,
+     97,  2,133, 70,133, 84,238,243,233,239,243,235,239,242,229,225,
+    110,128, 49,104,242,229,238,235,239,242,229,225,110,128, 50,  1,
+    243,233,239,243,235,239,242,229,225,110,128, 49,103,244,233,235,
+    229,245,244,235,239,242,229,225,110,128, 49,102,232,233,242,225,
+    231,225,238, 97,128, 48,107,107,  2,133,141,133,165,225,244,225,
+    235,225,238, 97,129, 48,203,133,153,232,225,236,230,247,233,228,
+    244,104,128,255,134,232,225,232,233,116,  2,133,175,133,186,236,
+    229,230,244,244,232,225,105,128,248,153,244,232,225,105,128, 14,
+     77,238,101,141,  0, 57,133,224,133,233,133,243,134, 17,134, 24,
+    134, 49,134, 76,134,110,134,122,134,133,134,166,134,174,134,185,
+    225,242,225,226,233, 99,128,  6,105,226,229,238,231,225,236,105,
+    128,  9,239,227,233,242,227,236,101,129, 36,104,133,254,233,238,
+    246,229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39,
+    146,228,229,246, 97,128,  9,111,231,117,  2,134, 31,134, 40,234,
+    225,242,225,244,105,128, 10,239,242,237,245,235,232,105,128, 10,
+    111,232, 97,  2,134, 56,134, 67,227,235,225,242,225,226,233, 99,
+    128,  6,105,238,231,250,232,239,117,128, 48, 41,105,  2,134, 82,
+    134,100,228,229,239,231,242,225,240,232,233,227,240,225,242,229,
+    110,128, 50, 40,238,230,229,242,233,239,114,128, 32,137,237,239,
+    238,239,243,240,225,227,101,128,255, 25,239,236,228,243,244,249,
+    236,101,128,247, 57,112,  2,134,139,134,146,225,242,229,110,128,
+     36,124,229,114,  2,134,153,134,159,233,239,100,128, 36,144,243,
+    233,225,110,128,  6,249,242,239,237,225,110,128, 33,120,243,245,
+    240,229,242,233,239,114,128, 32,121,116,  2,134,191,134,229,229,
+    229,110,  2,134,199,134,208,227,233,242,227,236,101,128, 36,114,
+    112,  2,134,214,134,221,225,242,229,110,128, 36,134,229,242,233,
+    239,100,128, 36,154,232,225,105,128, 14, 89,106,129,  1,204,134,
+    241,229,227,249,242,233,236,236,233, 99,128,  4, 90,235,225,244,
+    225,235,225,238, 97,129, 48,243,135, 10,232,225,236,230,247,233,
+    228,244,104,128,255,157,108,  2,135, 28,135, 42,229,231,242,233,
+    231,232,244,236,239,238,103,128,  1,158,233,238,229,226,229,236,
+    239,119,128, 30, 73,109,  2,135, 59,135, 70,239,238,239,243,240,
+    225,227,101,128,255, 78,243,241,245,225,242,101,128, 51,154,110,
+      2,135, 85,135,135, 97,  3,135, 93,135,103,135,110,226,229,238,
+    231,225,236,105,128,  9,163,228,229,246, 97,128,  9, 35,231,117,
+      2,135,117,135,126,234,225,242,225,244,105,128, 10,163,242,237,
+    245,235,232,105,128, 10, 35,238,225,228,229,246, 97,128,  9, 41,
+    111,  6,135,158,135,169,135,194,135,235,136,187,137,114,232,233,
+    242,225,231,225,238, 97,128, 48,110,235,225,244,225,235,225,238,
+     97,129, 48,206,135,182,232,225,236,230,247,233,228,244,104,128,
+    255,137,110,  3,135,202,135,218,135,227,226,242,229,225,235,233,
+    238,231,243,240,225,227,101,128,  0,160,229,238,244,232,225,105,
+    128, 14, 19,245,244,232,225,105,128, 14, 25,239,110,  7,135,252,
+    136,  5,136, 19,136, 53,136, 69,136,110,136,169,225,242,225,226,
+    233, 99,128,  6, 70,230,233,238,225,236,225,242,225,226,233, 99,
+    128,254,230,231,232,245,238,238, 97,  2,136, 30,136, 39,225,242,
+    225,226,233, 99,128,  6,186,230,233,238,225,236,225,242,225,226,
+    233, 99,128,251,159,233,238,233,244,233,225,236,225,242,225,226,
+    233, 99,128,254,231,234,229,229,237,105,  2,136, 79,136, 94,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,252,210,243,239,
+    236,225,244,229,228,225,242,225,226,233, 99,128,252, 75,237,101,
+      2,136,117,136,130,228,233,225,236,225,242,225,226,233, 99,128,
+    254,232,229,237,105,  2,136,138,136,153,238,233,244,233,225,236,
+    225,242,225,226,233, 99,128,252,213,243,239,236,225,244,229,228,
+    225,242,225,226,233, 99,128,252, 78,238,239,239,238,230,233,238,
+    225,236,225,242,225,226,233, 99,128,252,141,116,  7,136,203,136,
+    214,136,243,137, 22,137, 34,137, 54,137, 80,227,239,238,244,225,
+    233,238,115,128, 34, 12,101,  2,136,220,136,236,236,229,237,229,
+    238,116,129, 34,  9,136,231,239,102,128, 34,  9,241,245,225,108,
+    128, 34, 96,231,242,229,225,244,229,114,129, 34,111,136,255,238,
+    239,114,  2,137,  7,137, 15,229,241,245,225,108,128, 34,113,236,
+    229,243,115,128, 34,121,233,228,229,238,244,233,227,225,108,128,
+     34, 98,236,229,243,115,129, 34,110,137, 43,238,239,242,229,241,
+    245,225,108,128, 34,112,112,  2,137, 60,137, 70,225,242,225,236,
+    236,229,108,128, 34, 38,242,229,227,229,228,229,115,128, 34,128,
+    243,117,  3,137, 89,137, 96,137,105,226,243,229,116,128, 34,132,
+    227,227,229,229,228,115,128, 34,129,240,229,242,243,229,116,128,
+     34,133,247,225,242,237,229,238,233,225,110,128,  5,118,240,225,
+    242,229,110,128, 36,169,115,  2,137,140,137,149,243,241,245,225,
+    242,101,128, 51,177,245,240,229,242,233,239,114,128, 32,127,244,
+    233,236,228,101,128,  0,241,117,132,  3,189,137,179,137,190,138,
+     15,138, 98,232,233,242,225,231,225,238, 97,128, 48,108,107,  2,
+    137,196,137,220,225,244,225,235,225,238, 97,129, 48,204,137,208,
+    232,225,236,230,247,233,228,244,104,128,255,135,244, 97,  3,137,
+    229,137,239,137,246,226,229,238,231,225,236,105,128,  9,188,228,
+    229,246, 97,128,  9, 60,231,117,  2,137,253,138,  6,234,225,242,
+    225,244,105,128, 10,188,242,237,245,235,232,105,128, 10, 60,109,
+      2,138, 21,138, 55,226,229,242,243,233,231,110,130,  0, 35,138,
+     35,138, 47,237,239,238,239,243,240,225,227,101,128,255,  3,243,
+    237,225,236,108,128,254, 95,229,114,  2,138, 62,138, 94,225,236,
+    243,233,231,110,  2,138, 73,138, 81,231,242,229,229,107,128,  3,
+    116,236,239,247,229,242,231,242,229,229,107,128,  3,117,111,128,
+     33, 22,110,130,  5,224,138,106,138,126,228,225,231,229,243,104,
+    129,251, 64,138,117,232,229,226,242,229,119,128,251, 64,232,229,
+    226,242,229,119,128,  5,224,246,243,241,245,225,242,101,128, 51,
+    181,247,243,241,245,225,242,101,128, 51,187,249, 97,  3,138,164,
+    138,174,138,181,226,229,238,231,225,236,105,128,  9,158,228,229,
+    246, 97,128,  9, 30,231,117,  2,138,188,138,197,234,225,242,225,
+    244,105,128, 10,158,242,237,245,235,232,105,128, 10, 30,111,147,
+      0,111,138,248,139, 14,139, 92,140,  6,140, 78,140, 93,140,133,
+    141,  0,141, 21,141, 59,141, 70,141,248,143, 82,143,146,143,179,
+    143,225,144, 98,144,145,144,157, 97,  2,138,254,139,  5,227,245,
+    244,101,128,  0,243,238,231,244,232,225,105,128, 14, 45, 98,  4,
+    139, 24,139, 66,139, 75,139, 85,225,242,242,229,100,130,  2,117,
+    139, 36,139, 47,227,249,242,233,236,236,233, 99,128,  4,233,228,
+    233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128,
+      4,235,229,238,231,225,236,105,128,  9,147,239,240,239,237,239,
+    230,111,128, 49, 27,242,229,246,101,128,  1, 79, 99,  3,139,100,
+    139,173,139,252, 97,  2,139,106,139,167,238,228,242, 97,  3,139,
+    117,139,124,139,135,228,229,246, 97,128,  9, 17,231,245,234,225,
+    242,225,244,105,128, 10,145,246,239,247,229,236,243,233,231,110,
+      2,139,149,139,156,228,229,246, 97,128,  9, 73,231,245,234,225,
+    242,225,244,105,128, 10,201,242,239,110,128,  1,210,233,242, 99,
+      2,139,181,139,186,236,101,128, 36,222,245,237,230,236,229,120,
+    133,  0,244,139,205,139,213,139,224,139,232,139,244,225,227,245,
+    244,101,128, 30,209,228,239,244,226,229,236,239,119,128, 30,217,
+    231,242,225,246,101,128, 30,211,232,239,239,235,225,226,239,246,
+    101,128, 30,213,244,233,236,228,101,128, 30,215,249,242,233,236,
+    236,233, 99,128,  4, 62,100,  4,140, 16,140, 39,140, 45,140, 68,
+    226,108,  2,140, 23,140, 31,225,227,245,244,101,128,  1, 81,231,
+    242,225,246,101,128,  2, 13,229,246, 97,128,  9, 19,233,229,242,
+    229,243,233,115,129,  0,246,140, 57,227,249,242,233,236,236,233,
+     99,128,  4,231,239,244,226,229,236,239,119,128, 30,205,101,129,
+      1, 83,140, 84,235,239,242,229,225,110,128, 49, 90,103,  3,140,
+    101,140,116,140,123,239,238,229,107,129,  2,219,140,110,227,237,
+     98,128,  3, 40,242,225,246,101,128,  0,242,245,234,225,242,225,
+    244,105,128, 10,147,104,  4,140,143,140,154,140,164,140,242,225,
+    242,237,229,238,233,225,110,128,  5,133,233,242,225,231,225,238,
+     97,128, 48, 74,111,  2,140,170,140,180,239,235,225,226,239,246,
+    101,128, 30,207,242,110,133,  1,161,140,195,140,203,140,214,140,
+    222,140,234,225,227,245,244,101,128, 30,219,228,239,244,226,229,
+    236,239,119,128, 30,227,231,242,225,246,101,128, 30,221,232,239,
+    239,235,225,226,239,246,101,128, 30,223,244,233,236,228,101,128,
+     30,225,245,238,231,225,242,245,237,236,225,245,116,128,  1, 81,
+    105,129,  1,163,141,  6,238,246,229,242,244,229,228,226,242,229,
+    246,101,128,  2, 15,107,  2,141, 27,141, 51,225,244,225,235,225,
+    238, 97,129, 48,170,141, 39,232,225,236,230,247,233,228,244,104,
+    128,255,117,239,242,229,225,110,128, 49, 87,236,229,232,229,226,
+    242,229,119,128,  5,171,109,  6,141, 84,141,112,141,119,141,208,
+    141,219,141,237,225,227,242,239,110,130,  1, 77,141, 96,141,104,
+    225,227,245,244,101,128, 30, 83,231,242,225,246,101,128, 30, 81,
+    228,229,246, 97,128,  9, 80,229,231, 97,133,  3,201,141,135,141,
+    139,141,150,141,164,141,180, 49,128,  3,214,227,249,242,233,236,
+    236,233, 99,128,  4, 97,236,225,244,233,238,227,236,239,243,229,
+    100,128,  2,119,242,239,245,238,228,227,249,242,233,236,236,233,
+     99,128,  4,123,116,  2,141,186,141,201,233,244,236,239,227,249,
+    242,233,236,236,233, 99,128,  4,125,239,238,239,115,128,  3,206,
+    231,245,234,225,242,225,244,105,128, 10,208,233,227,242,239,110,
+    129,  3,191,141,229,244,239,238,239,115,128,  3,204,239,238,239,
+    243,240,225,227,101,128,255, 79,238,101,145,  0, 49,142, 31,142,
+     40,142, 50,142, 80,142,105,142,114,142,123,142,148,142,182,142,
+    216,142,228,142,247,143,  2,143, 35,143, 45,143, 53,143, 64,225,
+    242,225,226,233, 99,128,  6, 97,226,229,238,231,225,236,105,128,
+      9,231,227,233,242,227,236,101,129, 36, 96,142, 61,233,238,246,
+    229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39,138,
+    100,  2,142, 86,142, 92,229,246, 97,128,  9,103,239,244,229,238,
+    236,229,225,228,229,114,128, 32, 36,229,233,231,232,244,104,128,
+     33, 91,230,233,244,244,229,100,128,246,220,231,117,  2,142,130,
+    142,139,234,225,242,225,244,105,128, 10,231,242,237,245,235,232,
+    105,128, 10,103,232, 97,  3,142,157,142,168,142,173,227,235,225,
+    242,225,226,233, 99,128,  6, 97,236,102,128,  0,189,238,231,250,
+    232,239,117,128, 48, 33,105,  2,142,188,142,206,228,229,239,231,
+    242,225,240,232,233,227,240,225,242,229,110,128, 50, 32,238,230,
+    229,242,233,239,114,128, 32,129,237,239,238,239,243,240,225,227,
+    101,128,255, 17,238,245,237,229,242,225,244,239,242,226,229,238,
+    231,225,236,105,128,  9,244,239,236,228,243,244,249,236,101,128,
+    247, 49,112,  2,143,  8,143, 15,225,242,229,110,128, 36,116,229,
+    114,  2,143, 22,143, 28,233,239,100,128, 36,136,243,233,225,110,
+    128,  6,241,241,245,225,242,244,229,114,128,  0,188,242,239,237,
+    225,110,128, 33,112,243,245,240,229,242,233,239,114,128,  0,185,
+    244,104,  2,143, 71,143, 76,225,105,128, 14, 81,233,242,100,128,
+     33, 83,111,  3,143, 90,143,124,143,140,103,  2,143, 96,143,114,
+    239,238,229,107,129,  1,235,143,105,237,225,227,242,239,110,128,
+      1,237,245,242,237,245,235,232,105,128, 10, 19,237,225,244,242,
+    225,231,245,242,237,245,235,232,105,128, 10, 75,240,229,110,128,
+      2, 84,112,  3,143,154,143,161,143,172,225,242,229,110,128, 36,
+    170,229,238,226,245,236,236,229,116,128, 37,230,244,233,239,110,
+    128, 35, 37,114,  2,143,185,143,214,100,  2,143,191,143,202,230,
+    229,237,233,238,233,238,101,128,  0,170,237,225,243,227,245,236,
+    233,238,101,128,  0,186,244,232,239,231,239,238,225,108,128, 34,
+     31,115,  5,143,237,144, 13,144, 30,144, 75,144, 88,232,239,242,
+    116,  2,143,246,143,253,228,229,246, 97,128,  9, 18,246,239,247,
+    229,236,243,233,231,238,228,229,246, 97,128,  9, 74,236,225,243,
+    104,129,  0,248,144, 22,225,227,245,244,101,128,  1,255,237,225,
+    236,108,  2,144, 39,144, 50,232,233,242,225,231,225,238, 97,128,
+     48, 73,235,225,244,225,235,225,238, 97,129, 48,169,144, 63,232,
+    225,236,230,247,233,228,244,104,128,255,107,244,242,239,235,229,
+    225,227,245,244,101,128,  1,255,245,240,229,242,233,239,114,128,
+    246,240,116,  2,144,104,144,115,227,249,242,233,236,236,233, 99,
+    128,  4,127,233,236,228,101,130,  0,245,144,126,144,134,225,227,
+    245,244,101,128, 30, 77,228,233,229,242,229,243,233,115,128, 30,
+     79,245,226,239,240,239,237,239,230,111,128, 49, 33,118,  2,144,
+    163,144,244,229,114,  2,144,170,144,236,236,233,238,101,131, 32,
+     62,144,183,144,206,144,229, 99,  2,144,189,144,201,229,238,244,
+    229,242,236,233,238,101,128,254, 74,237, 98,128,  3,  5,100,  2,
+    144,212,144,220,225,243,232,229,100,128,254, 73,226,236,247,225,
+    246,121,128,254, 76,247,225,246,121,128,254, 75,243,227,239,242,
+    101,128,  0,175,239,247,229,236,243,233,231,110,  3,145,  3,145,
+     13,145, 20,226,229,238,231,225,236,105,128,  9,203,228,229,246,
+     97,128,  9, 75,231,245,234,225,242,225,244,105,128, 10,203,112,
+    145,  0,112,145, 69,147,197,147,208,147,217,147,229,149,154,149,
+    164,150,156,151,175,152,  9,152, 35,152,166,152,174,153, 76,153,
+    134,153,162,153,172, 97, 14,145, 99,145,131,145,141,145,148,145,
+    155,145,203,145,214,145,228,145,239,146, 30,146, 44,147, 56,147,
+     95,147,185, 97,  2,145,105,145,117,237,240,243,243,241,245,225,
+    242,101,128, 51,128,243,229,238,244,239,243,241,245,225,242,101,
+    128, 51, 43,226,229,238,231,225,236,105,128,  9,170,227,245,244,
+    101,128, 30, 85,228,229,246, 97,128,  9, 42,103,  2,145,161,145,
+    179,101,  2,145,167,145,174,228,239,247,110,128, 33,223,245,112,
+    128, 33,222,117,  2,145,185,145,194,234,225,242,225,244,105,128,
+     10,170,242,237,245,235,232,105,128, 10, 42,232,233,242,225,231,
+    225,238, 97,128, 48,113,233,249,225,238,238,239,233,244,232,225,
+    105,128, 14, 47,235,225,244,225,235,225,238, 97,128, 48,209,108,
+      2,145,245,146, 14,225,244,225,236,233,250,225,244,233,239,238,
+    227,249,242,233,236,236,233,227,227,237, 98,128,  4,132,239,227,
+    232,235,225,227,249,242,233,236,236,233, 99,128,  4,192,238,243,
+    233,239,243,235,239,242,229,225,110,128, 49,127,114,  3,146, 52,
+    146, 73,147, 45, 97,  2,146, 58,146, 66,231,242,225,240,104,128,
+      0,182,236,236,229,108,128, 34, 37,229,110,  2,146, 80,146,190,
+    236,229,230,116,136,  0, 40,146,103,146,118,146,123,146,128,146,
+    139,146,151,146,174,146,179,225,236,244,239,238,229,225,242,225,
+    226,233, 99,128,253, 62,226,116,128,248,237,229,120,128,248,236,
+    233,238,230,229,242,233,239,114,128, 32,141,237,239,238,239,243,
+    240,225,227,101,128,255,  8,115,  2,146,157,146,164,237,225,236,
+    108,128,254, 89,245,240,229,242,233,239,114,128, 32,125,244,112,
+    128,248,235,246,229,242,244,233,227,225,108,128,254, 53,242,233,
+    231,232,116,136,  0, 41,146,214,146,229,146,234,146,239,146,250,
+    147,  6,147, 29,147, 34,225,236,244,239,238,229,225,242,225,226,
+    233, 99,128,253, 63,226,116,128,248,248,229,120,128,248,247,233,
+    238,230,229,242,233,239,114,128, 32,142,237,239,238,239,243,240,
+    225,227,101,128,255,  9,115,  2,147, 12,147, 19,237,225,236,108,
+    128,254, 90,245,240,229,242,233,239,114,128, 32,126,244,112,128,
+    248,246,246,229,242,244,233,227,225,108,128,254, 54,244,233,225,
+    236,228,233,230,102,128, 34,  2,115,  3,147, 64,147, 75,147, 87,
+    229,241,232,229,226,242,229,119,128,  5,192,232,244,225,232,229,
+    226,242,229,119,128,  5,153,241,245,225,242,101,128, 51,169,244,
+    225,104,134,  5,183,147,113,147,127,147,132,147,141,147,156,147,
+    172, 49,  2,147,119,147,123, 49,128,  5,183,100,128,  5,183,178,
+     97,128,  5,183,232,229,226,242,229,119,128,  5,183,238,225,242,
+    242,239,247,232,229,226,242,229,119,128,  5,183,241,245,225,242,
+    244,229,242,232,229,226,242,229,119,128,  5,183,247,233,228,229,
+    232,229,226,242,229,119,128,  5,183,250,229,242,232,229,226,242,
+    229,119,128,  5,161,226,239,240,239,237,239,230,111,128, 49,  6,
+    227,233,242,227,236,101,128, 36,223,228,239,244,225,227,227,229,
+    238,116,128, 30, 87,101,137,  5,228,147,251,148,  6,148, 26,148,
+     38,148, 58,148,160,148,171,148,192,149,147,227,249,242,233,236,
+    236,233, 99,128,  4, 63,228,225,231,229,243,104,129,251, 68,148,
+     17,232,229,226,242,229,119,128,251, 68,229,250,233,243,241,245,
+    225,242,101,128, 51, 59,230,233,238,225,236,228,225,231,229,243,
+    232,232,229,226,242,229,119,128,251, 67,104,  5,148, 70,148, 93,
+    148,101,148,115,148,145,225,114,  2,148, 77,148, 84,225,226,233,
+     99,128,  6,126,237,229,238,233,225,110,128,  5,122,229,226,242,
+    229,119,128,  5,228,230,233,238,225,236,225,242,225,226,233, 99,
+    128,251, 87,105,  2,148,121,148,136,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,251, 88,242,225,231,225,238, 97,128, 48,
+    122,237,229,228,233,225,236,225,242,225,226,233, 99,128,251, 89,
+    235,225,244,225,235,225,238, 97,128, 48,218,237,233,228,228,236,
+    229,232,239,239,235,227,249,242,233,236,236,233, 99,128,  4,167,
+    114,  5,148,204,148,216,149,  2,149,123,149,136,225,230,229,232,
+    229,226,242,229,119,128,251, 78,227,229,238,116,131,  0, 37,148,
+    229,148,238,148,250,225,242,225,226,233, 99,128,  6,106,237,239,
+    238,239,243,240,225,227,101,128,255,  5,243,237,225,236,108,128,
+    254,106,105,  2,149,  8,149,105,239,100,134,  0, 46,149, 25,149,
+     36,149, 47,149, 59,149, 70,149, 82,225,242,237,229,238,233,225,
+    110,128,  5,137,227,229,238,244,229,242,229,100,128,  0,183,232,
+    225,236,230,247,233,228,244,104,128,255, 97,233,238,230,229,242,
+    233,239,114,128,246,231,237,239,238,239,243,240,225,227,101,128,
+    255, 14,115,  2,149, 88,149, 95,237,225,236,108,128,254, 82,245,
+    240,229,242,233,239,114,128,246,232,243,240,239,237,229,238,233,
+    231,242,229,229,235,227,237, 98,128,  3, 66,240,229,238,228,233,
+    227,245,236,225,114,128, 34,165,244,232,239,245,243,225,238,100,
+    128, 32, 48,243,229,244, 97,128, 32,167,230,243,241,245,225,242,
+    101,128, 51,138,104,  3,149,172,149,222,150,103, 97,  3,149,180,
+    149,190,149,197,226,229,238,231,225,236,105,128,  9,171,228,229,
+    246, 97,128,  9, 43,231,117,  2,149,204,149,213,234,225,242,225,
+    244,105,128, 10,171,242,237,245,235,232,105,128, 10, 43,105,133,
+      3,198,149,236,149,240,150, 70,150, 78,150, 89, 49,128,  3,213,
+    229,245,240,104,  4,149,253,150, 32,150, 47,150, 56, 97,  2,150,
+      3,150, 18,227,233,242,227,236,229,235,239,242,229,225,110,128,
+     50,122,240,225,242,229,238,235,239,242,229,225,110,128, 50, 26,
+    227,233,242,227,236,229,235,239,242,229,225,110,128, 50,108,235,
+    239,242,229,225,110,128, 49, 77,240,225,242,229,238,235,239,242,
+    229,225,110,128, 50, 12,236,225,244,233,110,128,  2,120,238,244,
+    232,245,244,232,225,105,128, 14, 58,243,249,237,226,239,236,231,
+    242,229,229,107,128,  3,213,111,  3,150,111,150,116,150,142,239,
+    107,128,  1,165,240,104,  2,150,123,150,132,225,238,244,232,225,
+    105,128, 14, 30,245,238,231,244,232,225,105,128, 14, 28,243,225,
+    237,240,232,225,239,244,232,225,105,128, 14, 32,105,133,  3,192,
+    150,170,151,126,151,137,151,148,151,162,229,245,112,  6,150,186,
+    150,221,150,253,151, 25,151, 39,151, 91, 97,  2,150,192,150,207,
+    227,233,242,227,236,229,235,239,242,229,225,110,128, 50,115,240,
+    225,242,229,238,235,239,242,229,225,110,128, 50, 19,227,105,  2,
+    150,228,150,240,229,245,227,235,239,242,229,225,110,128, 49,118,
+    242,227,236,229,235,239,242,229,225,110,128, 50,101,107,  2,151,
+      3,151, 17,233,249,229,239,235,235,239,242,229,225,110,128, 49,
+    114,239,242,229,225,110,128, 49, 66,240,225,242,229,238,235,239,
+    242,229,225,110,128, 50,  5,243,233,239,115,  2,151, 48,151, 76,
+    107,  2,151, 54,151, 68,233,249,229,239,235,235,239,242,229,225,
+    110,128, 49,116,239,242,229,225,110,128, 49, 68,244,233,235,229,
+    245,244,235,239,242,229,225,110,128, 49,117,116,  2,151, 97,151,
+    112,232,233,229,245,244,232,235,239,242,229,225,110,128, 49,119,
+    233,235,229,245,244,235,239,242,229,225,110,128, 49,115,232,233,
+    242,225,231,225,238, 97,128, 48,116,235,225,244,225,235,225,238,
+     97,128, 48,212,243,249,237,226,239,236,231,242,229,229,107,128,
+      3,214,247,242,225,242,237,229,238,233,225,110,128,  5,131,236,
+    245,115,132,  0, 43,151,189,151,200,151,209,151,242,226,229,236,
+    239,247,227,237, 98,128,  3, 31,227,233,242,227,236,101,128, 34,
+    149,109,  2,151,215,151,222,233,238,245,115,128,  0,177,111,  2,
+    151,228,151,232,100,128,  2,214,238,239,243,240,225,227,101,128,
+    255, 11,115,  2,151,248,151,255,237,225,236,108,128,254, 98,245,
+    240,229,242,233,239,114,128, 32,122,109,  2,152, 15,152, 26,239,
+    238,239,243,240,225,227,101,128,255, 80,243,241,245,225,242,101,
+    128, 51,216,111,  5,152, 47,152, 58,152,125,152,136,152,146,232,
+    233,242,225,231,225,238, 97,128, 48,125,233,238,244,233,238,231,
+    233,238,228,229,120,  4,152, 78,152, 90,152,102,152,115,228,239,
+    247,238,247,232,233,244,101,128, 38, 31,236,229,230,244,247,232,
+    233,244,101,128, 38, 28,242,233,231,232,244,247,232,233,244,101,
+    128, 38, 30,245,240,247,232,233,244,101,128, 38, 29,235,225,244,
+    225,235,225,238, 97,128, 48,221,240,236,225,244,232,225,105,128,
+     14, 27,243,244,225,236,237,225,242,107,129, 48, 18,152,159,230,
+    225,227,101,128, 48, 32,240,225,242,229,110,128, 36,171,114,  3,
+    152,182,152,208,152,233,101,  2,152,188,152,196,227,229,228,229,
+    115,128, 34,122,243,227,242,233,240,244,233,239,110,128, 33, 30,
+    233,237,101,  2,152,216,152,222,237,239,100,128,  2,185,242,229,
+    246,229,242,243,229,100,128, 32, 53,111,  4,152,243,152,250,153,
+      4,153, 17,228,245,227,116,128, 34, 15,234,229,227,244,233,246,
+    101,128, 35,  5,236,239,238,231,229,228,235,225,238, 97,128, 48,
+    252,112,  2,153, 23,153, 60,101,  2,153, 29,153, 36,236,236,239,
+    114,128, 35, 24,242,243,117,  2,153, 44,153, 51,226,243,229,116,
+    128, 34,130,240,229,242,243,229,116,128, 34,131,239,242,244,233,
+    239,110,129, 34, 55,153, 71,225,108,128, 34, 29,115,  2,153, 82,
+    153,125,105,130,  3,200,153, 90,153,101,227,249,242,233,236,236,
+    233, 99,128,  4,113,236,233,240,238,229,245,237,225,244,225,227,
+    249,242,233,236,236,233,227,227,237, 98,128,  4,134,243,241,245,
+    225,242,101,128, 51,176,117,  2,153,140,153,151,232,233,242,225,
+    231,225,238, 97,128, 48,119,235,225,244,225,235,225,238, 97,128,
+     48,215,246,243,241,245,225,242,101,128, 51,180,247,243,241,245,
+    225,242,101,128, 51,186,113,136,  0,113,153,202,154,251,155,  6,
+    155, 15,155, 22,155, 34,155, 72,155, 80, 97,  4,153,212,153,235,
+    154, 43,154,234,100,  2,153,218,153,224,229,246, 97,128,  9, 88,
+    237,225,232,229,226,242,229,119,128,  5,168,102,  4,153,245,153,
+    254,154, 12,154, 28,225,242,225,226,233, 99,128,  6, 66,230,233,
+    238,225,236,225,242,225,226,233, 99,128,254,214,233,238,233,244,
+    233,225,236,225,242,225,226,233, 99,128,254,215,237,229,228,233,
+    225,236,225,242,225,226,233, 99,128,254,216,237,225,244,115,136,
+      5,184,154, 66,154, 86,154,100,154,105,154,110,154,119,154,134,
+    154,221, 49,  3,154, 74,154, 78,154, 82, 48,128,  5,184, 97,128,
+      5,184, 99,128,  5,184, 50,  2,154, 92,154, 96, 55,128,  5,184,
+     57,128,  5,184,179, 51,128,  5,184,228,101,128,  5,184,232,229,
+    226,242,229,119,128,  5,184,238,225,242,242,239,247,232,229,226,
+    242,229,119,128,  5,184,113,  2,154,140,154,206,225,244,225,110,
+      4,154,153,154,162,154,177,154,193,232,229,226,242,229,119,128,
+      5,184,238,225,242,242,239,247,232,229,226,242,229,119,128,  5,
+    184,241,245,225,242,244,229,242,232,229,226,242,229,119,128,  5,
+    184,247,233,228,229,232,229,226,242,229,119,128,  5,184,245,225,
+    242,244,229,242,232,229,226,242,229,119,128,  5,184,247,233,228,
+    229,232,229,226,242,229,119,128,  5,184,242,238,229,249,240,225,
+    242,225,232,229,226,242,229,119,128,  5,159,226,239,240,239,237,
+    239,230,111,128, 49, 17,227,233,242,227,236,101,128, 36,224,232,
+    239,239,107,128,  2,160,237,239,238,239,243,240,225,227,101,128,
+    255, 81,239,102,130,  5,231,155, 43,155, 63,228,225,231,229,243,
+    104,129,251, 71,155, 54,232,229,226,242,229,119,128,251, 71,232,
+    229,226,242,229,119,128,  5,231,240,225,242,229,110,128, 36,172,
+    117,  4,155, 90,155,102,155,191,156, 22,225,242,244,229,242,238,
+    239,244,101,128, 38,105,226,245,244,115,135,  5,187,155,123,155,
+    128,155,133,155,138,155,147,155,162,155,178,177, 56,128,  5,187,
+    178, 53,128,  5,187,179, 49,128,  5,187,232,229,226,242,229,119,
+    128,  5,187,238,225,242,242,239,247,232,229,226,242,229,119,128,
+      5,187,241,245,225,242,244,229,242,232,229,226,242,229,119,128,
+      5,187,247,233,228,229,232,229,226,242,229,119,128,  5,187,229,
+    243,244,233,239,110,133,  0, 63,155,210,155,233,155,250,156,  2,
+    156, 14,225,114,  2,155,217,155,224,225,226,233, 99,128,  6, 31,
+    237,229,238,233,225,110,128,  5, 94,228,239,247,110,129,  0,191,
+    155,242,243,237,225,236,108,128,247,191,231,242,229,229,107,128,
+      3,126,237,239,238,239,243,240,225,227,101,128,255, 31,243,237,
+    225,236,108,128,247, 63,239,244,101,  4,156, 34,156,105,156,125,
+    156,154,228,226,108,133,  0, 34,156, 50,156, 57,156, 64,156, 76,
+    156, 97,226,225,243,101,128, 32, 30,236,229,230,116,128, 32, 28,
+    237,239,238,239,243,240,225,227,101,128,255,  2,240,242,233,237,
+    101,129, 48, 30,156, 86,242,229,246,229,242,243,229,100,128, 48,
+     29,242,233,231,232,116,128, 32, 29,236,229,230,116,129, 32, 24,
+    156,114,242,229,246,229,242,243,229,100,128, 32, 27,114,  2,156,
+    131,156,141,229,246,229,242,243,229,100,128, 32, 27,233,231,232,
+    116,129, 32, 25,156,150,110,128,  1, 73,243,233,238,231,108,  2,
+    156,164,156,171,226,225,243,101,128, 32, 26,101,129,  0, 39,156,
+    177,237,239,238,239,243,240,225,227,101,128,255,  7,114,145,  0,
+    114,156,227,157,231,157,242,158, 33,158, 84,159,101,159,125,159,
+    220,161,254,162, 35,162, 47,162,101,162,109,163, 15,163, 26,163,
+     61,163,161, 97, 11,156,251,157,  6,157, 16,157, 23,157, 88,157,
+    104,157,129,157,140,157,165,157,188,157,225,225,242,237,229,238,
+    233,225,110,128,  5,124,226,229,238,231,225,236,105,128,  9,176,
+    227,245,244,101,128,  1, 85,100,  4,157, 33,157, 39,157, 53,157,
+     79,229,246, 97,128,  9, 48,233,227,225,108,129, 34, 26,157, 48,
+    229,120,128,248,229,239,246,229,242,243,243,241,245,225,242,101,
+    129, 51,174,157, 69,228,243,241,245,225,242,101,128, 51,175,243,
+    241,245,225,242,101,128, 51,173,230,101,129,  5,191,157, 95,232,
+    229,226,242,229,119,128,  5,191,231,117,  2,157,111,157,120,234,
+    225,242,225,244,105,128, 10,176,242,237,245,235,232,105,128, 10,
+     48,232,233,242,225,231,225,238, 97,128, 48,137,235,225,244,225,
+    235,225,238, 97,129, 48,233,157,153,232,225,236,230,247,233,228,
+    244,104,128,255,151,236,239,247,229,242,228,233,225,231,239,238,
+    225,236,226,229,238,231,225,236,105,128,  9,241,109,  2,157,194,
+    157,217,233,228,228,236,229,228,233,225,231,239,238,225,236,226,
+    229,238,231,225,236,105,128,  9,240,243,232,239,242,110,128,  2,
+    100,244,233,111,128, 34, 54,226,239,240,239,237,239,230,111,128,
+     49, 22, 99,  4,157,252,158,  3,158, 12,158, 20,225,242,239,110,
+    128,  1, 89,229,228,233,236,236, 97,128,  1, 87,233,242,227,236,
+    101,128, 36,225,239,237,237,225,225,227,227,229,238,116,128,  1,
+     87,100,  2,158, 39,158, 49,226,236,231,242,225,246,101,128,  2,
+     17,239,116,  2,158, 56,158, 65,225,227,227,229,238,116,128, 30,
+     89,226,229,236,239,119,129, 30, 91,158, 75,237,225,227,242,239,
+    110,128, 30, 93,101,  6,158, 98,158,143,158,178,158,233,159,  2,
+    159, 35,102,  2,158,104,158,117,229,242,229,238,227,229,237,225,
+    242,107,128, 32, 59,236,229,248,243,117,  2,158,127,158,134,226,
+    243,229,116,128, 34,134,240,229,242,243,229,116,128, 34,135,231,
+    233,243,244,229,114,  2,158,154,158,159,229,100,128,  0,174,115,
+      2,158,165,158,171,225,238,115,128,248,232,229,242,233,102,128,
+    246,218,104,  3,158,186,158,209,158,223,225,114,  2,158,193,158,
+    200,225,226,233, 99,128,  6, 49,237,229,238,233,225,110,128,  5,
+    128,230,233,238,225,236,225,242,225,226,233, 99,128,254,174,233,
+    242,225,231,225,238, 97,128, 48,140,235,225,244,225,235,225,238,
+     97,129, 48,236,158,246,232,225,236,230,247,233,228,244,104,128,
+    255,154,243,104,130,  5,232,159, 11,159, 26,228,225,231,229,243,
+    232,232,229,226,242,229,119,128,251, 72,232,229,226,242,229,119,
+    128,  5,232,118,  3,159, 43,159, 56,159, 88,229,242,243,229,228,
+    244,233,236,228,101,128, 34, 61,233, 97,  2,159, 63,159, 72,232,
+    229,226,242,229,119,128,  5,151,237,245,231,242,225,243,232,232,
+    229,226,242,229,119,128,  5,151,236,239,231,233,227,225,236,238,
+    239,116,128, 35, 16,230,233,243,232,232,239,239,107,129,  2,126,
+    159,114,242,229,246,229,242,243,229,100,128,  2,127,104,  2,159,
+    131,159,154, 97,  2,159,137,159,147,226,229,238,231,225,236,105,
+    128,  9,221,228,229,246, 97,128,  9, 93,111,131,  3,193,159,164,
+    159,193,159,207,239,107,129,  2,125,159,171,244,245,242,238,229,
+    100,129,  2,123,159,182,243,245,240,229,242,233,239,114,128,  2,
+    181,243,249,237,226,239,236,231,242,229,229,107,128,  3,241,244,
+    233,227,232,239,239,235,237,239,100,128,  2,222,105,  6,159,234,
+    161, 22,161, 68,161, 79,161,104,161,240,229,245,108,  9,160,  0,
+    160, 35,160, 50,160, 64,160,110,160,124,160,210,160,223,161,  2,
+     97,  2,160,  6,160, 21,227,233,242,227,236,229,235,239,242,229,
+    225,110,128, 50,113,240,225,242,229,238,235,239,242,229,225,110,
+    128, 50, 17,227,233,242,227,236,229,235,239,242,229,225,110,128,
+     50, 99,232,233,229,245,232,235,239,242,229,225,110,128, 49, 64,
+    107,  2,160, 70,160,102,233,249,229,239,107,  2,160, 80,160, 89,
+    235,239,242,229,225,110,128, 49, 58,243,233,239,243,235,239,242,
+    229,225,110,128, 49,105,239,242,229,225,110,128, 49, 57,237,233,
+    229,245,237,235,239,242,229,225,110,128, 49, 59,112,  3,160,132,
+    160,164,160,179, 97,  2,160,138,160,152,238,243,233,239,243,235,
+    239,242,229,225,110,128, 49,108,242,229,238,235,239,242,229,225,
+    110,128, 50,  3,232,233,229,245,240,232,235,239,242,229,225,110,
+    128, 49, 63,233,229,245,112,  2,160,188,160,197,235,239,242,229,
+    225,110,128, 49, 60,243,233,239,243,235,239,242,229,225,110,128,
+     49,107,243,233,239,243,235,239,242,229,225,110,128, 49, 61,116,
+      2,160,229,160,244,232,233,229,245,244,232,235,239,242,229,225,
+    110,128, 49, 62,233,235,229,245,244,235,239,242,229,225,110,128,
+     49,106,249,229,239,242,233,238,232,233,229,245,232,235,239,242,
+    229,225,110,128, 49,109,231,232,116,  2,161, 30,161, 38,225,238,
+    231,236,101,128, 34, 31,116,  2,161, 44,161, 58,225,227,235,226,
+    229,236,239,247,227,237, 98,128,  3, 25,242,233,225,238,231,236,
+    101,128, 34,191,232,233,242,225,231,225,238, 97,128, 48,138,235,
+    225,244,225,235,225,238, 97,129, 48,234,161, 92,232,225,236,230,
+    247,233,228,244,104,128,255,152,110,  2,161,110,161,226,103,131,
+      2,218,161,120,161,131,161,137,226,229,236,239,247,227,237, 98,
+    128,  3, 37,227,237, 98,128,  3, 10,232,225,236,102,  2,161,146,
+    161,192,236,229,230,116,131,  2,191,161,159,161,170,161,181,225,
+    242,237,229,238,233,225,110,128,  5, 89,226,229,236,239,247,227,
+    237, 98,128,  3, 28,227,229,238,244,229,242,229,100,128,  2,211,
+    242,233,231,232,116,130,  2,190,161,204,161,215,226,229,236,239,
+    247,227,237, 98,128,  3, 57,227,229,238,244,229,242,229,100,128,
+      2,210,246,229,242,244,229,228,226,242,229,246,101,128,  2, 19,
+    244,244,239,242,245,243,241,245,225,242,101,128, 51, 81,108,  2,
+    162,  4,162, 15,233,238,229,226,229,236,239,119,128, 30, 95,239,
+    238,231,236,229,103,129,  2,124,162, 26,244,245,242,238,229,100,
+    128,  2,122,237,239,238,239,243,240,225,227,101,128,255, 82,111,
+      3,162, 55,162, 66,162, 91,232,233,242,225,231,225,238, 97,128,
+     48,141,235,225,244,225,235,225,238, 97,129, 48,237,162, 79,232,
+    225,236,230,247,233,228,244,104,128,255,155,242,245,225,244,232,
+    225,105,128, 14, 35,240,225,242,229,110,128, 36,173,114,  3,162,
+    117,162,153,162,183, 97,  3,162,125,162,135,162,142,226,229,238,
+    231,225,236,105,128,  9,220,228,229,246, 97,128,  9, 49,231,245,
+    242,237,245,235,232,105,128, 10, 92,229,104,  2,162,160,162,169,
+    225,242,225,226,233, 99,128,  6,145,230,233,238,225,236,225,242,
+    225,226,233, 99,128,251,141,246,239,227,225,236,233, 99,  4,162,
+    199,162,209,162,216,162,227,226,229,238,231,225,236,105,128,  9,
+    224,228,229,246, 97,128,  9, 96,231,245,234,225,242,225,244,105,
+    128, 10,224,246,239,247,229,236,243,233,231,110,  3,162,243,162,
+    253,163,  4,226,229,238,231,225,236,105,128,  9,196,228,229,246,
+     97,128,  9, 68,231,245,234,225,242,225,244,105,128, 10,196,243,
+    245,240,229,242,233,239,114,128,246,241,116,  2,163, 32,163, 40,
+    226,236,239,227,107,128, 37,144,245,242,238,229,100,129,  2,121,
+    163, 50,243,245,240,229,242,233,239,114,128,  2,180,117,  4,163,
+     71,163, 82,163,107,163,154,232,233,242,225,231,225,238, 97,128,
+     48,139,235,225,244,225,235,225,238, 97,129, 48,235,163, 95,232,
+    225,236,230,247,233,228,244,104,128,255,153,112,  2,163,113,163,
+    148,229,101,  2,163,120,163,134,237,225,242,235,226,229,238,231,
+    225,236,105,128,  9,242,243,233,231,238,226,229,238,231,225,236,
+    105,128,  9,243,233,225,104,128,246,221,244,232,225,105,128, 14,
+     36,246,239,227,225,236,233, 99,  4,163,177,163,187,163,194,163,
+    205,226,229,238,231,225,236,105,128,  9,139,228,229,246, 97,128,
+      9, 11,231,245,234,225,242,225,244,105,128, 10,139,246,239,247,
+    229,236,243,233,231,110,  3,163,221,163,231,163,238,226,229,238,
+    231,225,236,105,128,  9,195,228,229,246, 97,128,  9, 67,231,245,
+    234,225,242,225,244,105,128, 10,195,115,147,  0,115,164, 35,166,
+      5,166, 16,166,142,166,181,169,123,169,134,172, 21,174,159,174,
+    205,174,232,175,167,175,234,177, 11,177, 21,177,207,178, 24,178,
+    194,178,204, 97,  9,164, 55,164, 65,164, 86,164,158,164,183,164,
+    194,164,219,164,251,165, 35,226,229,238,231,225,236,105,128,  9,
+    184,227,245,244,101,129,  1, 91,164, 74,228,239,244,225,227,227,
+    229,238,116,128, 30,101,100,  5,164, 98,164,107,164,113,164,127,
+    164,143,225,242,225,226,233, 99,128,  6, 53,229,246, 97,128,  9,
+     56,230,233,238,225,236,225,242,225,226,233, 99,128,254,186,233,
+    238,233,244,233,225,236,225,242,225,226,233, 99,128,254,187,237,
+    229,228,233,225,236,225,242,225,226,233, 99,128,254,188,231,117,
+      2,164,165,164,174,234,225,242,225,244,105,128, 10,184,242,237,
+    245,235,232,105,128, 10, 56,232,233,242,225,231,225,238, 97,128,
+     48, 85,235,225,244,225,235,225,238, 97,129, 48,181,164,207,232,
+    225,236,230,247,233,228,244,104,128,255,123,236,236,225,236,236,
+    225,232,239,245,225,236,225,249,232,229,247,225,243,225,236,236,
+    225,237,225,242,225,226,233, 99,128,253,250,237,229,235,104,130,
+      5,225,165,  6,165, 26,228,225,231,229,243,104,129,251, 65,165,
+     17,232,229,226,242,229,119,128,251, 65,232,229,226,242,229,119,
+    128,  5,225,242, 97,  5,165, 48,165,122,165,130,165,180,165,188,
+     97,  5,165, 60,165, 68,165, 76,165,107,165,115,225,244,232,225,
+    105,128, 14, 50,229,244,232,225,105,128, 14, 65,233,237,225,233,
+    109,  2,165, 86,165, 97,225,236,225,233,244,232,225,105,128, 14,
+     68,245,225,238,244,232,225,105,128, 14, 67,237,244,232,225,105,
+    128, 14, 51,244,232,225,105,128, 14, 48,229,244,232,225,105,128,
+     14, 64,105,  3,165,138,165,162,165,173,105,  2,165,144,165,155,
+    236,229,230,244,244,232,225,105,128,248,134,244,232,225,105,128,
+     14, 53,236,229,230,244,244,232,225,105,128,248,133,244,232,225,
+    105,128, 14, 52,239,244,232,225,105,128, 14, 66,117,  3,165,196,
+    165,246,165,253,101,  3,165,204,165,228,165,239,101,  2,165,210,
+    165,221,236,229,230,244,244,232,225,105,128,248,136,244,232,225,
+    105,128, 14, 55,236,229,230,244,244,232,225,105,128,248,135,244,
+    232,225,105,128, 14, 54,244,232,225,105,128, 14, 56,245,244,232,
+    225,105,128, 14, 57,226,239,240,239,237,239,230,111,128, 49, 25,
+     99,  5,166, 28,166, 49,166, 58,166,107,166,129,225,242,239,110,
+    129,  1, 97,166, 37,228,239,244,225,227,227,229,238,116,128, 30,
+    103,229,228,233,236,236, 97,128,  1, 95,232,247, 97,131,  2, 89,
+    166, 70,166, 81,166,100,227,249,242,233,236,236,233, 99,128,  4,
+    217,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233,
+     99,128,  4,219,232,239,239,107,128,  2, 90,233,242, 99,  2,166,
+    115,166,120,236,101,128, 36,226,245,237,230,236,229,120,128,  1,
+     93,239,237,237,225,225,227,227,229,238,116,128,  2, 25,228,239,
+    116,  2,166,150,166,159,225,227,227,229,238,116,128, 30, 97,226,
+    229,236,239,119,129, 30, 99,166,169,228,239,244,225,227,227,229,
+    238,116,128, 30,105,101,  9,166,201,166,217,166,252,167, 61,167,
+    164,167,191,167,216,168, 41,168, 68,225,231,245,236,236,226,229,
+    236,239,247,227,237, 98,128,  3, 60, 99,  2,166,223,166,245,239,
+    238,100,129, 32, 51,166,231,244,239,238,229,227,232,233,238,229,
+    243,101,128,  2,202,244,233,239,110,128,  0,167,229,110,  4,167,
+      7,167, 16,167, 30,167, 46,225,242,225,226,233, 99,128,  6, 51,
+    230,233,238,225,236,225,242,225,226,233, 99,128,254,178,233,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,254,179,237,229,
+    228,233,225,236,225,242,225,226,233, 99,128,254,180,231,239,108,
+    135,  5,182,167, 81,167, 95,167,100,167,109,167,124,167,140,167,
+    151, 49,  2,167, 87,167, 91, 51,128,  5,182,102,128,  5,182,178,
+     99,128,  5,182,232,229,226,242,229,119,128,  5,182,238,225,242,
+    242,239,247,232,229,226,242,229,119,128,  5,182,241,245,225,242,
+    244,229,242,232,229,226,242,229,119,128,  5,182,244,225,232,229,
+    226,242,229,119,128,  5,146,247,233,228,229,232,229,226,242,229,
+    119,128,  5,182,104,  2,167,170,167,181,225,242,237,229,238,233,
+    225,110,128,  5,125,233,242,225,231,225,238, 97,128, 48, 91,235,
+    225,244,225,235,225,238, 97,129, 48,187,167,204,232,225,236,230,
+    247,233,228,244,104,128,255,126,237,105,  2,167,223,168, 10,227,
+    239,236,239,110,131,  0, 59,167,237,167,246,168,  2,225,242,225,
+    226,233, 99,128,  6, 27,237,239,238,239,243,240,225,227,101,128,
+    255, 27,243,237,225,236,108,128,254, 84,246,239,233,227,229,228,
+    237,225,242,235,235,225,238, 97,129, 48,156,168, 29,232,225,236,
+    230,247,233,228,244,104,128,255,159,238,116,  2,168, 48,168, 58,
+    233,243,241,245,225,242,101,128, 51, 34,239,243,241,245,225,242,
+    101,128, 51, 35,246,229,110,142,  0, 55,168,102,168,111,168,121,
+    168,151,168,158,168,168,168,193,168,220,168,254,169, 10,169, 21,
+    169, 54,169, 62,169, 73,225,242,225,226,233, 99,128,  6,103,226,
+    229,238,231,225,236,105,128,  9,237,227,233,242,227,236,101,129,
+     36,102,168,132,233,238,246,229,242,243,229,243,225,238,243,243,
+    229,242,233,102,128, 39,144,228,229,246, 97,128,  9,109,229,233,
+    231,232,244,232,115,128, 33, 94,231,117,  2,168,175,168,184,234,
+    225,242,225,244,105,128, 10,237,242,237,245,235,232,105,128, 10,
+    109,232, 97,  2,168,200,168,211,227,235,225,242,225,226,233, 99,
+    128,  6,103,238,231,250,232,239,117,128, 48, 39,105,  2,168,226,
+    168,244,228,229,239,231,242,225,240,232,233,227,240,225,242,229,
+    110,128, 50, 38,238,230,229,242,233,239,114,128, 32,135,237,239,
+    238,239,243,240,225,227,101,128,255, 23,239,236,228,243,244,249,
+    236,101,128,247, 55,112,  2,169, 27,169, 34,225,242,229,110,128,
+     36,122,229,114,  2,169, 41,169, 47,233,239,100,128, 36,142,243,
+    233,225,110,128,  6,247,242,239,237,225,110,128, 33,118,243,245,
+    240,229,242,233,239,114,128, 32,119,116,  2,169, 79,169,117,229,
+    229,110,  2,169, 87,169, 96,227,233,242,227,236,101,128, 36,112,
+    112,  2,169,102,169,109,225,242,229,110,128, 36,132,229,242,233,
+    239,100,128, 36,152,232,225,105,128, 14, 87,230,244,232,249,240,
+    232,229,110,128,  0,173,104,  7,169,150,170,124,170,135,170,149,
+    171, 94,171,107,172, 15, 97,  6,169,164,169,175,169,185,169,196,
+    170, 83,170,108,225,242,237,229,238,233,225,110,128,  5,119,226,
+    229,238,231,225,236,105,128,  9,182,227,249,242,233,236,236,233,
+     99,128,  4, 72,100,  2,169,202,170, 42,228, 97,  4,169,213,169,
+    222,169,253,170, 11,225,242,225,226,233, 99,128,  6, 81,228,225,
+    237,237, 97,  2,169,232,169,241,225,242,225,226,233, 99,128,252,
+     97,244,225,238,225,242,225,226,233, 99,128,252, 94,230,225,244,
+    232,225,225,242,225,226,233, 99,128,252, 96,235,225,243,242, 97,
+      2,170, 21,170, 30,225,242,225,226,233, 99,128,252, 98,244,225,
+    238,225,242,225,226,233, 99,128,252, 95,101,132, 37,146,170, 54,
+    170, 61,170, 69,170, 78,228,225,242,107,128, 37,147,236,233,231,
+    232,116,128, 37,145,237,229,228,233,245,109,128, 37,146,246, 97,
+    128,  9, 54,231,117,  2,170, 90,170, 99,234,225,242,225,244,105,
+    128, 10,182,242,237,245,235,232,105,128, 10, 54,236,243,232,229,
+    236,229,244,232,229,226,242,229,119,128,  5,147,226,239,240,239,
+    237,239,230,111,128, 49, 21,227,232,225,227,249,242,233,236,236,
+    233, 99,128,  4, 73,101,  4,170,159,170,224,170,234,170,251,229,
+    110,  4,170,170,170,179,170,193,170,209,225,242,225,226,233, 99,
+    128,  6, 52,230,233,238,225,236,225,242,225,226,233, 99,128,254,
+    182,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,
+    183,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,184,
+    233,227,239,240,244,233, 99,128,  3,227,241,229,108,129, 32,170,
+    170,242,232,229,226,242,229,119,128, 32,170,246, 97,134,  5,176,
+    171, 12,171, 27,171, 41,171, 50,171, 65,171, 81, 49,  2,171, 18,
+    171, 23,177, 53,128,  5,176, 53,128,  5,176, 50,  2,171, 33,171,
+     37, 50,128,  5,176,101,128,  5,176,232,229,226,242,229,119,128,
+      5,176,238,225,242,242,239,247,232,229,226,242,229,119,128,  5,
+    176,241,245,225,242,244,229,242,232,229,226,242,229,119,128,  5,
+    176,247,233,228,229,232,229,226,242,229,119,128,  5,176,232,225,
+    227,249,242,233,236,236,233, 99,128,  4,187,105,  2,171,113,171,
+    124,237,225,227,239,240,244,233, 99,128,  3,237,110,131,  5,233,
+    171,134,171,217,171,226,100,  2,171,140,171,206,225,231,229,243,
+    104,130,251, 73,171,152,171,161,232,229,226,242,229,119,128,251,
+     73,115,  2,171,167,171,187,232,233,238,228,239,116,129,251, 44,
+    171,178,232,229,226,242,229,119,128,251, 44,233,238,228,239,116,
+    129,251, 45,171,197,232,229,226,242,229,119,128,251, 45,239,244,
+    232,229,226,242,229,119,128,  5,193,232,229,226,242,229,119,128,
+      5,233,115,  2,171,232,171,252,232,233,238,228,239,116,129,251,
+     42,171,243,232,229,226,242,229,119,128,251, 42,233,238,228,239,
+    116,129,251, 43,172,  6,232,229,226,242,229,119,128,251, 43,239,
+    239,107,128,  2,130,105,  8,172, 39,172, 83,172, 94,172,119,172,
+    149,172,157,172,170,173, 85,231,237, 97,131,  3,195,172, 51,172,
+     55,172, 63, 49,128,  3,194,230,233,238,225,108,128,  3,194,236,
+    245,238,225,244,229,243,249,237,226,239,236,231,242,229,229,107,
+    128,  3,242,232,233,242,225,231,225,238, 97,128, 48, 87,235,225,
+    244,225,235,225,238, 97,129, 48,183,172,107,232,225,236,230,247,
+    233,228,244,104,128,255,124,236,245,113,  2,172,127,172,136,232,
+    229,226,242,229,119,128,  5,189,236,229,230,244,232,229,226,242,
+    229,119,128,  5,189,237,233,236,225,114,128, 34, 60,238,228,239,
+    244,232,229,226,242,229,119,128,  5,194,239,115,  6,172,185,172,
+    220,172,252,173, 24,173, 38,173, 70, 97,  2,172,191,172,206,227,
+    233,242,227,236,229,235,239,242,229,225,110,128, 50,116,240,225,
+    242,229,238,235,239,242,229,225,110,128, 50, 20,227,105,  2,172,
+    227,172,239,229,245,227,235,239,242,229,225,110,128, 49,126,242,
+    227,236,229,235,239,242,229,225,110,128, 50,102,107,  2,173,  2,
+    173, 16,233,249,229,239,235,235,239,242,229,225,110,128, 49,122,
+    239,242,229,225,110,128, 49, 69,238,233,229,245,238,235,239,242,
+    229,225,110,128, 49,123,112,  2,173, 44,173, 57,225,242,229,238,
+    235,239,242,229,225,110,128, 50,  6,233,229,245,240,235,239,242,
+    229,225,110,128, 49,125,244,233,235,229,245,244,235,239,242,229,
+    225,110,128, 49,124,120,141,  0, 54,173,115,173,124,173,134,173,
+    164,173,171,173,196,173,223,174,  1,174, 13,174, 24,174, 57,174,
+     65,174, 76,225,242,225,226,233, 99,128,  6,102,226,229,238,231,
+    225,236,105,128,  9,236,227,233,242,227,236,101,129, 36,101,173,
+    145,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,
+    102,128, 39,143,228,229,246, 97,128,  9,108,231,117,  2,173,178,
+    173,187,234,225,242,225,244,105,128, 10,236,242,237,245,235,232,
+    105,128, 10,108,232, 97,  2,173,203,173,214,227,235,225,242,225,
+    226,233, 99,128,  6,102,238,231,250,232,239,117,128, 48, 38,105,
+      2,173,229,173,247,228,229,239,231,242,225,240,232,233,227,240,
+    225,242,229,110,128, 50, 37,238,230,229,242,233,239,114,128, 32,
+    134,237,239,238,239,243,240,225,227,101,128,255, 22,239,236,228,
+    243,244,249,236,101,128,247, 54,112,  2,174, 30,174, 37,225,242,
+    229,110,128, 36,121,229,114,  2,174, 44,174, 50,233,239,100,128,
+     36,141,243,233,225,110,128,  6,246,242,239,237,225,110,128, 33,
+    117,243,245,240,229,242,233,239,114,128, 32,118,116,  2,174, 82,
+    174,153,229,229,110,  2,174, 90,174,132, 99,  2,174, 96,174,104,
+    233,242,227,236,101,128, 36,111,245,242,242,229,238,227,249,228,
+    229,238,239,237,233,238,225,244,239,242,226,229,238,231,225,236,
+    105,128,  9,249,112,  2,174,138,174,145,225,242,229,110,128, 36,
+    131,229,242,233,239,100,128, 36,151,232,225,105,128, 14, 86,108,
+      2,174,165,174,185,225,243,104,129,  0, 47,174,173,237,239,238,
+    239,243,240,225,227,101,128,255, 15,239,238,103,129,  1,127,174,
+    193,228,239,244,225,227,227,229,238,116,128, 30,155,109,  2,174,
+    211,174,221,233,236,229,230,225,227,101,128, 38, 58,239,238,239,
+    243,240,225,227,101,128,255, 83,111,  6,174,246,175, 40,175, 51,
+    175, 76,175,121,175,132,102,  2,174,252,175, 10,240,225,243,245,
+    241,232,229,226,242,229,119,128,  5,195,116,  2,175, 16,175, 25,
+    232,249,240,232,229,110,128,  0,173,243,233,231,238,227,249,242,
+    233,236,236,233, 99,128,  4, 76,232,233,242,225,231,225,238, 97,
+    128, 48, 93,235,225,244,225,235,225,238, 97,129, 48,189,175, 64,
+    232,225,236,230,247,233,228,244,104,128,255,127,236,233,228,245,
+    115,  2,175, 86,175,103,236,239,238,231,239,246,229,242,236,225,
+    249,227,237, 98,128,  3, 56,243,232,239,242,244,239,246,229,242,
+    236,225,249,227,237, 98,128,  3, 55,242,245,243,233,244,232,225,
+    105,128, 14, 41,115,  3,175,140,175,150,175,158,225,236,225,244,
+    232,225,105,128, 14, 40,239,244,232,225,105,128, 14, 11,245,225,
+    244,232,225,105,128, 14, 42,240, 97,  3,175,176,175,196,175,228,
+    227,101,129,  0, 32,175,183,232,225,227,235,225,242,225,226,233,
+     99,128,  0, 32,228,101,129, 38, 96,175,203,243,245,233,116,  2,
+    175,212,175,220,226,236,225,227,107,128, 38, 96,247,232,233,244,
+    101,128, 38,100,242,229,110,128, 36,174,241,245,225,242,101, 11,
+    176,  6,176, 17,176, 31,176, 56,176, 73,176, 99,176,114,176,147,
+    176,174,176,230,176,245,226,229,236,239,247,227,237, 98,128,  3,
+     59, 99,  2,176, 23,176, 27, 99,128, 51,196,109,128, 51,157,228,
+    233,225,231,239,238,225,236,227,242,239,243,243,232,225,244,227,
+    232,230,233,236,108,128, 37,169,232,239,242,233,250,239,238,244,
+    225,236,230,233,236,108,128, 37,164,107,  2,176, 79,176, 83,103,
+    128, 51,143,109,129, 51,158,176, 89,227,225,240,233,244,225,108,
+    128, 51,206,108,  2,176,105,176,109,110,128, 51,209,239,103,128,
+     51,210,109,  4,176,124,176,128,176,133,176,137,103,128, 51,142,
+    233,108,128, 51,213,109,128, 51,156,243,241,245,225,242,229,100,
+    128, 51,161,239,242,244,232,239,231,239,238,225,236,227,242,239,
+    243,243,232,225,244,227,232,230,233,236,108,128, 37,166,245,240,
+    240,229,114,  2,176,184,176,207,236,229,230,244,244,239,236,239,
+    247,229,242,242,233,231,232,244,230,233,236,108,128, 37,167,242,
+    233,231,232,244,244,239,236,239,247,229,242,236,229,230,244,230,
+    233,236,108,128, 37,168,246,229,242,244,233,227,225,236,230,233,
+    236,108,128, 37,165,247,232,233,244,229,247,233,244,232,243,237,
+    225,236,236,226,236,225,227,107,128, 37,163,242,243,241,245,225,
+    242,101,128, 51,219,115,  2,177, 27,177,197, 97,  4,177, 37,177,
+     47,177, 54,177, 65,226,229,238,231,225,236,105,128,  9,183,228,
+    229,246, 97,128,  9, 55,231,245,234,225,242,225,244,105,128, 10,
+    183,238,103,  8,177, 84,177, 98,177,112,177,126,177,141,177,155,
+    177,169,177,182,227,233,229,245,227,235,239,242,229,225,110,128,
+     49, 73,232,233,229,245,232,235,239,242,229,225,110,128, 49,133,
+    233,229,245,238,231,235,239,242,229,225,110,128, 49,128,235,233,
+    249,229,239,235,235,239,242,229,225,110,128, 49, 50,238,233,229,
+    245,238,235,239,242,229,225,110,128, 49,101,240,233,229,245,240,
+    235,239,242,229,225,110,128, 49, 67,243,233,239,243,235,239,242,
+    229,225,110,128, 49, 70,244,233,235,229,245,244,235,239,242,229,
+    225,110,128, 49, 56,245,240,229,242,233,239,114,128,246,242,116,
+      2,177,213,177,236,229,242,236,233,238,103,129,  0,163,177,224,
+    237,239,238,239,243,240,225,227,101,128,255,225,242,239,235,101,
+      2,177,245,178,  6,236,239,238,231,239,246,229,242,236,225,249,
+    227,237, 98,128,  3, 54,243,232,239,242,244,239,246,229,242,236,
+    225,249,227,237, 98,128,  3, 53,117,  7,178, 40,178, 72,178, 94,
+    178,105,178,146,178,156,178,160,226,243,229,116,130, 34,130,178,
+     51,178, 62,238,239,244,229,241,245,225,108,128, 34,138,239,242,
+    229,241,245,225,108,128, 34,134, 99,  2,178, 78,178, 86,227,229,
+    229,228,115,128, 34,123,232,244,232,225,116,128, 34, 11,232,233,
+    242,225,231,225,238, 97,128, 48, 89,107,  2,178,111,178,135,225,
+    244,225,235,225,238, 97,129, 48,185,178,123,232,225,236,230,247,
+    233,228,244,104,128,255,125,245,238,225,242,225,226,233, 99,128,
+      6, 82,237,237,225,244,233,239,110,128, 34, 17,110,128, 38, 60,
+    240,229,242,243,229,116,130, 34,131,178,173,178,184,238,239,244,
+    229,241,245,225,108,128, 34,139,239,242,229,241,245,225,108,128,
+     34,135,246,243,241,245,225,242,101,128, 51,220,249,239,245,247,
+    225,229,242,225,243,241,245,225,242,101,128, 51,124,116,144,  0,
+    116,179,  1,180, 10,180, 31,180,174,180,214,183,  6,186,144,187,
+    219,187,231,187,243,189, 20,189, 45,189,131,190, 55,190,239,191,
+     73, 97, 10,179, 23,179, 33,179, 54,179, 61,179, 86,179,164,179,
+    181,179,206,179,220,179,224,226,229,238,231,225,236,105,128,  9,
+    164,227,107,  2,179, 40,179, 47,228,239,247,110,128, 34,164,236,
+    229,230,116,128, 34,163,228,229,246, 97,128,  9, 36,231,117,  2,
+    179, 68,179, 77,234,225,242,225,244,105,128, 10,164,242,237,245,
+    235,232,105,128, 10, 36,104,  4,179, 96,179,105,179,119,179,149,
+    225,242,225,226,233, 99,128,  6, 55,230,233,238,225,236,225,242,
+    225,226,233, 99,128,254,194,105,  2,179,125,179,140,238,233,244,
+    233,225,236,225,242,225,226,233, 99,128,254,195,242,225,231,225,
+    238, 97,128, 48, 95,237,229,228,233,225,236,225,242,225,226,233,
+     99,128,254,196,233,243,249,239,245,229,242,225,243,241,245,225,
+    242,101,128, 51,125,235,225,244,225,235,225,238, 97,129, 48,191,
+    179,194,232,225,236,230,247,233,228,244,104,128,255,128,244,247,
+    229,229,236,225,242,225,226,233, 99,128,  6, 64,117,128,  3,196,
+    118,130,  5,234,179,232,180,  1,228,225,231,229,115,129,251, 74,
+    179,242,104,129,251, 74,179,248,232,229,226,242,229,119,128,251,
+     74,232,229,226,242,229,119,128,  5,234, 98,  2,180, 16,180, 21,
+    225,114,128,  1,103,239,240,239,237,239,230,111,128, 49, 10, 99,
+      6,180, 45,180, 52,180, 59,180, 68,180,134,180,161,225,242,239,
+    110,128,  1,101,227,245,242,108,128,  2,168,229,228,233,236,236,
+     97,128,  1, 99,232,229,104,  4,180, 80,180, 89,180,103,180,119,
+    225,242,225,226,233, 99,128,  6,134,230,233,238,225,236,225,242,
+    225,226,233, 99,128,251,123,233,238,233,244,233,225,236,225,242,
+    225,226,233, 99,128,251,124,237,229,228,233,225,236,225,242,225,
+    226,233, 99,128,251,125,233,242, 99,  2,180,142,180,147,236,101,
+    128, 36,227,245,237,230,236,229,248,226,229,236,239,119,128, 30,
+    113,239,237,237,225,225,227,227,229,238,116,128,  1, 99,100,  2,
+    180,180,180,190,233,229,242,229,243,233,115,128, 30,151,239,116,
+      2,180,197,180,206,225,227,227,229,238,116,128, 30,107,226,229,
+    236,239,119,128, 30,109,101,  9,180,234,180,245,181,  9,182, 19,
+    182, 44,182,108,182,175,182,180,182,232,227,249,242,233,236,236,
+    233, 99,128,  4, 66,228,229,243,227,229,238,228,229,242,227,249,
+    242,233,236,236,233, 99,128,  4,173,104,  7,181, 25,181, 34,181,
+     48,181, 88,181,118,181,159,182,  1,225,242,225,226,233, 99,128,
+      6, 42,230,233,238,225,236,225,242,225,226,233, 99,128,254,150,
+    232,225,232,105,  2,181, 57,181, 72,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,252,162,243,239,236,225,244,229,228,225,
+    242,225,226,233, 99,128,252, 12,105,  2,181, 94,181,109,238,233,
+    244,233,225,236,225,242,225,226,233, 99,128,254,151,242,225,231,
+    225,238, 97,128, 48,102,234,229,229,237,105,  2,181,128,181,143,
+    238,233,244,233,225,236,225,242,225,226,233, 99,128,252,161,243,
+    239,236,225,244,229,228,225,242,225,226,233, 99,128,252, 11,109,
+      2,181,165,181,199,225,242,226,245,244, 97,  2,181,176,181,185,
+    225,242,225,226,233, 99,128,  6, 41,230,233,238,225,236,225,242,
+    225,226,233, 99,128,254,148,101,  2,181,205,181,218,228,233,225,
+    236,225,242,225,226,233, 99,128,254,152,229,237,105,  2,181,226,
+    181,241,238,233,244,233,225,236,225,242,225,226,233, 99,128,252,
+    164,243,239,236,225,244,229,228,225,242,225,226,233, 99,128,252,
+     14,238,239,239,238,230,233,238,225,236,225,242,225,226,233, 99,
+    128,252,115,235,225,244,225,235,225,238, 97,129, 48,198,182, 32,
+    232,225,236,230,247,233,228,244,104,128,255,131,108,  2,182, 50,
+    182, 69,229,240,232,239,238,101,129, 33, 33,182, 61,226,236,225,
+    227,107,128, 38, 14,233,243,232, 97,  2,182, 78,182, 93,231,229,
+    228,239,236,225,232,229,226,242,229,119,128,  5,160,241,229,244,
+    225,238,225,232,229,226,242,229,119,128,  5,169,110,  4,182,118,
+    182,127,182,146,182,167,227,233,242,227,236,101,128, 36,105,233,
+    228,229,239,231,242,225,240,232,233,227,240,225,242,229,110,128,
+     50, 41,112,  2,182,152,182,159,225,242,229,110,128, 36,125,229,
+    242,233,239,100,128, 36,145,242,239,237,225,110,128, 33,121,243,
+    104,128,  2,167,116,131,  5,216,182,190,182,210,182,219,228,225,
+    231,229,243,104,129,251, 56,182,201,232,229,226,242,229,119,128,
+    251, 56,232,229,226,242,229,119,128,  5,216,243,229,227,249,242,
+    233,236,236,233, 99,128,  4,181,246,233,114,  2,182,240,182,249,
+    232,229,226,242,229,119,128,  5,155,236,229,230,244,232,229,226,
+    242,229,119,128,  5,155,104,  6,183, 20,183,172,184, 38,184,170,
+    185, 77,186,134, 97,  5,183, 32,183, 42,183, 49,183, 74,183,103,
+    226,229,238,231,225,236,105,128,  9,165,228,229,246, 97,128,  9,
+     37,231,117,  2,183, 56,183, 65,234,225,242,225,244,105,128, 10,
+    165,242,237,245,235,232,105,128, 10, 37,108,  2,183, 80,183, 89,
+    225,242,225,226,233, 99,128,  6, 48,230,233,238,225,236,225,242,
+    225,226,233, 99,128,254,172,238,244,232,225,235,232,225,116,  3,
+    183,118,183,149,183,156,236,239,119,  2,183,126,183,137,236,229,
+    230,244,244,232,225,105,128,248,152,242,233,231,232,244,244,232,
+    225,105,128,248,151,244,232,225,105,128, 14, 76,245,240,240,229,
+    242,236,229,230,244,244,232,225,105,128,248,150,101,  3,183,180,
+    183,244,184, 11,104,  4,183,190,183,199,183,213,183,229,225,242,
+    225,226,233, 99,128,  6, 43,230,233,238,225,236,225,242,225,226,
+    233, 99,128,254,154,233,238,233,244,233,225,236,225,242,225,226,
+    233, 99,128,254,155,237,229,228,233,225,236,225,242,225,226,233,
+     99,128,254,156,242,101,  2,183,251,184,  4,229,248,233,243,244,
+    115,128, 34,  3,230,239,242,101,128, 34, 52,244, 97,130,  3,184,
+    184, 20,184, 24, 49,128,  3,209,243,249,237,226,239,236,231,242,
+    229,229,107,128,  3,209,105,  2,184, 44,184,130,229,245,244,104,
+      4,184, 57,184, 92,184,107,184,116, 97,  2,184, 63,184, 78,227,
+    233,242,227,236,229,235,239,242,229,225,110,128, 50,121,240,225,
+    242,229,238,235,239,242,229,225,110,128, 50, 25,227,233,242,227,
+    236,229,235,239,242,229,225,110,128, 50,107,235,239,242,229,225,
+    110,128, 49, 76,240,225,242,229,238,235,239,242,229,225,110,128,
+     50, 11,242,244,229,229,110,  2,184,140,184,149,227,233,242,227,
+    236,101,128, 36,108,112,  2,184,155,184,162,225,242,229,110,128,
+     36,128,229,242,233,239,100,128, 36,148,111,  6,184,184,184,201,
+    184,206,184,220,184,225,185, 22,238,225,238,231,237,239,238,244,
+    232,239,244,232,225,105,128, 14, 17,239,107,128,  1,173,240,232,
+    245,244,232,225,239,244,232,225,105,128, 14, 18,242,110,128,  0,
+    254,244,104,  3,184,234,185,  2,185, 12, 97,  2,184,240,184,250,
+    232,225,238,244,232,225,105,128, 14, 23,238,244,232,225,105,128,
+     14, 16,239,238,231,244,232,225,105,128, 14, 24,245,238,231,244,
+    232,225,105,128, 14, 22,245,243,225,238,100,  2,185, 32,185, 43,
+    227,249,242,233,236,236,233, 99,128,  4,130,243,243,229,240,225,
+    242,225,244,239,114,  2,185, 58,185, 67,225,242,225,226,233, 99,
+    128,  6,108,240,229,242,243,233,225,110,128,  6,108,242,229,101,
+    144,  0, 51,185,115,185,124,185,134,185,164,185,171,185,181,185,
+    206,185,233,186, 11,186, 23,186, 42,186, 53,186, 86,186,108,186,
+    116,186,127,225,242,225,226,233, 99,128,  6, 99,226,229,238,231,
+    225,236,105,128,  9,233,227,233,242,227,236,101,129, 36, 98,185,
+    145,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,
+    102,128, 39,140,228,229,246, 97,128,  9,105,229,233,231,232,244,
+    232,115,128, 33, 92,231,117,  2,185,188,185,197,234,225,242,225,
+    244,105,128, 10,233,242,237,245,235,232,105,128, 10,105,232, 97,
+      2,185,213,185,224,227,235,225,242,225,226,233, 99,128,  6, 99,
+    238,231,250,232,239,117,128, 48, 35,105,  2,185,239,186,  1,228,
+    229,239,231,242,225,240,232,233,227,240,225,242,229,110,128, 50,
+     34,238,230,229,242,233,239,114,128, 32,131,237,239,238,239,243,
+    240,225,227,101,128,255, 19,238,245,237,229,242,225,244,239,242,
+    226,229,238,231,225,236,105,128,  9,246,239,236,228,243,244,249,
+    236,101,128,247, 51,112,  2,186, 59,186, 66,225,242,229,110,128,
+     36,118,229,114,  2,186, 73,186, 79,233,239,100,128, 36,138,243,
+    233,225,110,128,  6,243,241,245,225,242,244,229,242,115,129,  0,
+    190,186, 99,229,237,228,225,243,104,128,246,222,242,239,237,225,
+    110,128, 33,114,243,245,240,229,242,233,239,114,128,  0,179,244,
+    232,225,105,128, 14, 83,250,243,241,245,225,242,101,128, 51,148,
+    105,  7,186,160,186,171,187, 30,187,128,187,140,187,189,187,206,
+    232,233,242,225,231,225,238, 97,128, 48, 97,107,  2,186,177,186,
+    201,225,244,225,235,225,238, 97,129, 48,193,186,189,232,225,236,
+    230,247,233,228,244,104,128,255,129,229,245,116,  4,186,213,186,
+    248,187,  7,187, 16, 97,  2,186,219,186,234,227,233,242,227,236,
+    229,235,239,242,229,225,110,128, 50,112,240,225,242,229,238,235,
+    239,242,229,225,110,128, 50, 16,227,233,242,227,236,229,235,239,
+    242,229,225,110,128, 50, 98,235,239,242,229,225,110,128, 49, 55,
+    240,225,242,229,238,235,239,242,229,225,110,128, 50,  2,236,228,
+    101,133,  2,220,187, 46,187, 57,187, 74,187, 86,187,114,226,229,
+    236,239,247,227,237, 98,128,  3, 48, 99,  2,187, 63,187, 68,237,
+     98,128,  3,  3,239,237, 98,128,  3,  3,228,239,245,226,236,229,
+    227,237, 98,128,  3, 96,111,  2,187, 92,187,102,240,229,242,225,
+    244,239,114,128, 34, 60,246,229,242,236,225,249,227,237, 98,128,
+      3, 52,246,229,242,244,233,227,225,236,227,237, 98,128,  3, 62,
+    237,229,243,227,233,242,227,236,101,128, 34,151,112,  2,187,146,
+    187,176,229,232, 97,  2,187,154,187,163,232,229,226,242,229,119,
+    128,  5,150,236,229,230,244,232,229,226,242,229,119,128,  5,150,
+    240,233,231,245,242,237,245,235,232,105,128, 10,112,244,236,239,
+    227,249,242,233,236,236,233,227,227,237, 98,128,  4,131,247,238,
+    225,242,237,229,238,233,225,110,128,  5,127,236,233,238,229,226,
+    229,236,239,119,128, 30,111,237,239,238,239,243,240,225,227,101,
+    128,255, 84,111,  7,188,  3,188, 14,188, 25,188, 50,188,170,188,
+    182,189, 10,225,242,237,229,238,233,225,110,128,  5,105,232,233,
+    242,225,231,225,238, 97,128, 48,104,235,225,244,225,235,225,238,
+     97,129, 48,200,188, 38,232,225,236,230,247,233,228,244,104,128,
+    255,132,110,  3,188, 58,188,156,188,161,101,  4,188, 68,188,137,
+    188,144,188,150,226,225,114,  4,188, 80,188,109,188,119,188,128,
+    229,248,244,242, 97,  2,188, 90,188,100,232,233,231,232,237,239,
+    100,128,  2,229,236,239,247,237,239,100,128,  2,233,232,233,231,
+    232,237,239,100,128,  2,230,236,239,247,237,239,100,128,  2,232,
+    237,233,228,237,239,100,128,  2,231,230,233,246,101,128,  1,189,
+    243,233,120,128,  1,133,244,247,111,128,  1,168,239,115,128,  3,
+    132,243,241,245,225,242,101,128, 51, 39,240,225,244,225,235,244,
+    232,225,105,128, 14, 15,242,244,239,233,243,229,243,232,229,236,
+    236,226,242,225,227,235,229,116,  2,188,205,188,235,236,229,230,
+    116,130, 48, 20,188,216,188,224,243,237,225,236,108,128,254, 93,
+    246,229,242,244,233,227,225,108,128,254, 57,242,233,231,232,116,
+    130, 48, 21,188,247,188,255,243,237,225,236,108,128,254, 94,246,
+    229,242,244,233,227,225,108,128,254, 58,244,225,239,244,232,225,
+    105,128, 14, 21,240, 97,  2,189, 27,189, 39,236,225,244,225,236,
+    232,239,239,107,128,  1,171,242,229,110,128, 36,175,114,  3,189,
+     53,189, 84,189, 99,225,228,229,237,225,242,107,129, 33, 34,189,
+     65,115,  2,189, 71,189, 77,225,238,115,128,248,234,229,242,233,
+    102,128,246,219,229,244,242,239,230,236,229,248,232,239,239,107,
+    128,  2,136,233,225,103,  4,189,111,189,116,189,121,189,126,228,
+    110,128, 37,188,236,102,128, 37,196,242,116,128, 37,186,245,112,
+    128, 37,178,115,132,  2,166,189,143,189,182,190, 32,190, 45,225,
+    228,105,130,  5,230,189,153,189,173,228,225,231,229,243,104,129,
+    251, 70,189,164,232,229,226,242,229,119,128,251, 70,232,229,226,
+    242,229,119,128,  5,230,101,  2,189,188,189,199,227,249,242,233,
+    236,236,233, 99,128,  4, 70,242,101,134,  5,181,189,216,189,230,
+    189,235,189,244,190,  3,190, 19, 49,  2,189,222,189,226, 50,128,
+      5,181,101,128,  5,181,178, 98,128,  5,181,232,229,226,242,229,
+    119,128,  5,181,238,225,242,242,239,247,232,229,226,242,229,119,
+    128,  5,181,241,245,225,242,244,229,242,232,229,226,242,229,119,
+    128,  5,181,247,233,228,229,232,229,226,242,229,119,128,  5,181,
+    232,229,227,249,242,233,236,236,233, 99,128,  4, 91,245,240,229,
+    242,233,239,114,128,246,243,116,  4,190, 65,190,115,190,180,190,
+    231, 97,  3,190, 73,190, 83,190, 90,226,229,238,231,225,236,105,
+    128,  9,159,228,229,246, 97,128,  9, 31,231,117,  2,190, 97,190,
+    106,234,225,242,225,244,105,128, 10,159,242,237,245,235,232,105,
+    128, 10, 31,229,104,  4,190,126,190,135,190,149,190,165,225,242,
+    225,226,233, 99,128,  6,121,230,233,238,225,236,225,242,225,226,
+    233, 99,128,251,103,233,238,233,244,233,225,236,225,242,225,226,
+    233, 99,128,251,104,237,229,228,233,225,236,225,242,225,226,233,
+     99,128,251,105,232, 97,  3,190,189,190,199,190,206,226,229,238,
+    231,225,236,105,128,  9,160,228,229,246, 97,128,  9, 32,231,117,
+      2,190,213,190,222,234,225,242,225,244,105,128, 10,160,242,237,
+    245,235,232,105,128, 10, 32,245,242,238,229,100,128,  2,135,117,
+      3,190,247,191,  2,191, 27,232,233,242,225,231,225,238, 97,128,
+     48,100,235,225,244,225,235,225,238, 97,129, 48,196,191, 15,232,
+    225,236,230,247,233,228,244,104,128,255,130,243,237,225,236,108,
+      2,191, 37,191, 48,232,233,242,225,231,225,238, 97,128, 48, 99,
+    235,225,244,225,235,225,238, 97,129, 48,195,191, 61,232,225,236,
+    230,247,233,228,244,104,128,255,111,119,  2,191, 79,191,184,101,
+      2,191, 85,191,133,236,246,101,  3,191, 95,191,104,191,125,227,
+    233,242,227,236,101,128, 36,107,112,  2,191,110,191,117,225,242,
+    229,110,128, 36,127,229,242,233,239,100,128, 36,147,242,239,237,
+    225,110,128, 33,123,238,244,121,  3,191,143,191,152,191,163,227,
+    233,242,227,236,101,128, 36,115,232,225,238,231,250,232,239,117,
+    128, 83, 68,112,  2,191,169,191,176,225,242,229,110,128, 36,135,
+    229,242,233,239,100,128, 36,155,111,142,  0, 50,191,216,191,225,
+    191,235,192,  9,192, 61,192, 86,192,113,192,147,192,159,192,178,
+    192,189,192,222,192,230,192,254,225,242,225,226,233, 99,128,  6,
+     98,226,229,238,231,225,236,105,128,  9,232,227,233,242,227,236,
+    101,129, 36, 97,191,246,233,238,246,229,242,243,229,243,225,238,
+    243,243,229,242,233,102,128, 39,139,100,  2,192, 15,192, 21,229,
+    246, 97,128,  9,104,239,116,  2,192, 28,192, 39,229,238,236,229,
+    225,228,229,114,128, 32, 37,236,229,225,228,229,114,129, 32, 37,
+    192, 50,246,229,242,244,233,227,225,108,128,254, 48,231,117,  2,
+    192, 68,192, 77,234,225,242,225,244,105,128, 10,232,242,237,245,
+    235,232,105,128, 10,104,232, 97,  2,192, 93,192,104,227,235,225,
+    242,225,226,233, 99,128,  6, 98,238,231,250,232,239,117,128, 48,
+     34,105,  2,192,119,192,137,228,229,239,231,242,225,240,232,233,
+    227,240,225,242,229,110,128, 50, 33,238,230,229,242,233,239,114,
+    128, 32,130,237,239,238,239,243,240,225,227,101,128,255, 18,238,
+    245,237,229,242,225,244,239,242,226,229,238,231,225,236,105,128,
+      9,245,239,236,228,243,244,249,236,101,128,247, 50,112,  2,192,
+    195,192,202,225,242,229,110,128, 36,117,229,114,  2,192,209,192,
+    215,233,239,100,128, 36,137,243,233,225,110,128,  6,242,242,239,
+    237,225,110,128, 33,113,115,  2,192,236,192,244,244,242,239,235,
+    101,128,  1,187,245,240,229,242,233,239,114,128,  0,178,244,104,
+      2,193,  5,193, 10,225,105,128, 14, 82,233,242,228,115,128, 33,
+     84,117,145,  0,117,193, 55,193, 63,193,104,193,161,194, 43,194,
+     80,194,203,194,219,195, 14,195, 84,195,165,195,174,196, 37,196,
+     61,196,169,196,197,197, 55,225,227,245,244,101,128,  0,250, 98,
+      4,193, 73,193, 78,193, 87,193, 97,225,114,128,  2,137,229,238,
+    231,225,236,105,128,  9,137,239,240,239,237,239,230,111,128, 49,
+     40,242,229,246,101,128,  1,109, 99,  3,193,112,193,119,193,151,
+    225,242,239,110,128,  1,212,233,242, 99,  2,193,127,193,132,236,
+    101,128, 36,228,245,237,230,236,229,120,129,  0,251,193,143,226,
+    229,236,239,119,128, 30,119,249,242,233,236,236,233, 99,128,  4,
+     67,100,  5,193,173,193,184,193,207,193,213,194, 33,225,244,244,
+    225,228,229,246, 97,128,  9, 81,226,108,  2,193,191,193,199,225,
+    227,245,244,101,128,  1,113,231,242,225,246,101,128,  2, 21,229,
+    246, 97,128,  9,  9,233,229,242,229,243,233,115,133,  0,252,193,
+    233,193,241,193,249,194, 16,194, 24,225,227,245,244,101,128,  1,
+    216,226,229,236,239,119,128, 30,115, 99,  2,193,255,194,  6,225,
+    242,239,110,128,  1,218,249,242,233,236,236,233, 99,128,  4,241,
+    231,242,225,246,101,128,  1,220,237,225,227,242,239,110,128,  1,
+    214,239,244,226,229,236,239,119,128, 30,229,103,  2,194, 49,194,
+     56,242,225,246,101,128,  0,249,117,  2,194, 62,194, 71,234,225,
+    242,225,244,105,128, 10,137,242,237,245,235,232,105,128, 10,  9,
+    104,  3,194, 88,194, 98,194,176,233,242,225,231,225,238, 97,128,
+     48, 70,111,  2,194,104,194,114,239,235,225,226,239,246,101,128,
+     30,231,242,110,133,  1,176,194,129,194,137,194,148,194,156,194,
+    168,225,227,245,244,101,128, 30,233,228,239,244,226,229,236,239,
+    119,128, 30,241,231,242,225,246,101,128, 30,235,232,239,239,235,
+    225,226,239,246,101,128, 30,237,244,233,236,228,101,128, 30,239,
+    245,238,231,225,242,245,237,236,225,245,116,129,  1,113,194,192,
+    227,249,242,233,236,236,233, 99,128,  4,243,233,238,246,229,242,
+    244,229,228,226,242,229,246,101,128,  2, 23,107,  3,194,227,194,
+    251,195,  6,225,244,225,235,225,238, 97,129, 48,166,194,239,232,
+    225,236,230,247,233,228,244,104,128,255,115,227,249,242,233,236,
+    236,233, 99,128,  4,121,239,242,229,225,110,128, 49, 92,109,  2,
+    195, 20,195, 73, 97,  2,195, 26,195, 59,227,242,239,110,130,  1,
+    107,195, 37,195, 48,227,249,242,233,236,236,233, 99,128,  4,239,
+    228,233,229,242,229,243,233,115,128, 30,123,244,242,225,231,245,
+    242,237,245,235,232,105,128, 10, 65,239,238,239,243,240,225,227,
+    101,128,255, 85,110,  2,195, 90,195,145,228,229,242,243,227,239,
+    242,101,132,  0, 95,195,109,195,115,195,127,195,138,228,226,108,
+    128, 32, 23,237,239,238,239,243,240,225,227,101,128,255, 63,246,
+    229,242,244,233,227,225,108,128,254, 51,247,225,246,121,128,254,
+     79,105,  2,195,151,195,156,239,110,128, 34, 42,246,229,242,243,
+    225,108,128, 34,  0,239,231,239,238,229,107,128,  1,115,112,  5,
+    195,186,195,193,195,201,195,216,196, 11,225,242,229,110,128, 36,
+    176,226,236,239,227,107,128, 37,128,240,229,242,228,239,244,232,
+    229,226,242,229,119,128,  5,196,243,233,236,239,110,131,  3,197,
+    195,230,195,251,196,  3,228,233,229,242,229,243,233,115,129,  3,
+    203,195,243,244,239,238,239,115,128,  3,176,236,225,244,233,110,
+    128,  2,138,244,239,238,239,115,128,  3,205,244,225,227,107,  2,
+    196, 20,196, 31,226,229,236,239,247,227,237, 98,128,  3, 29,237,
+    239,100,128,  2,212,114,  2,196, 43,196, 55,225,231,245,242,237,
+    245,235,232,105,128, 10,115,233,238,103,128,  1,111,115,  3,196,
+     69,196, 84,196,129,232,239,242,244,227,249,242,233,236,236,233,
+     99,128,  4, 94,237,225,236,108,  2,196, 93,196,104,232,233,242,
+    225,231,225,238, 97,128, 48, 69,235,225,244,225,235,225,238, 97,
+    129, 48,165,196,117,232,225,236,230,247,233,228,244,104,128,255,
+    105,244,242,225,233,231,232,116,  2,196,141,196,152,227,249,242,
+    233,236,236,233, 99,128,  4,175,243,244,242,239,235,229,227,249,
+    242,233,236,236,233, 99,128,  4,177,244,233,236,228,101,130,  1,
+    105,196,181,196,189,225,227,245,244,101,128, 30,121,226,229,236,
+    239,119,128, 30,117,117,  5,196,209,196,219,196,226,196,251,197,
+     11,226,229,238,231,225,236,105,128,  9,138,228,229,246, 97,128,
+      9, 10,231,117,  2,196,233,196,242,234,225,242,225,244,105,128,
+     10,138,242,237,245,235,232,105,128, 10, 10,237,225,244,242,225,
+    231,245,242,237,245,235,232,105,128, 10, 66,246,239,247,229,236,
+    243,233,231,110,  3,197, 27,197, 37,197, 44,226,229,238,231,225,
+    236,105,128,  9,194,228,229,246, 97,128,  9, 66,231,245,234,225,
+    242,225,244,105,128, 10,194,246,239,247,229,236,243,233,231,110,
+      3,197, 71,197, 81,197, 88,226,229,238,231,225,236,105,128,  9,
+    193,228,229,246, 97,128,  9, 65,231,245,234,225,242,225,244,105,
+    128, 10,193,118,139,  0,118,197,125,198, 17,198, 26,198, 37,198,
+    222,198,229,199, 71,199, 83,199,183,199,191,199,212, 97,  4,197,
+    135,197,142,197,167,197,178,228,229,246, 97,128,  9, 53,231,117,
+      2,197,149,197,158,234,225,242,225,244,105,128, 10,181,242,237,
+    245,235,232,105,128, 10, 53,235,225,244,225,235,225,238, 97,128,
+     48,247,118,132,  5,213,197,190,197,217,197,249,198,  5,228,225,
+    231,229,243,104,130,251, 53,197,203,197,208,182, 53,128,251, 53,
+    232,229,226,242,229,119,128,251, 53,104,  2,197,223,197,231,229,
+    226,242,229,119,128,  5,213,239,236,225,109,129,251, 75,197,240,
+    232,229,226,242,229,119,128,251, 75,246,225,246,232,229,226,242,
+    229,119,128,  5,240,249,239,228,232,229,226,242,229,119,128,  5,
+    241,227,233,242,227,236,101,128, 36,229,228,239,244,226,229,236,
+    239,119,128, 30,127,101,  6,198, 51,198, 62,198,126,198,137,198,
+    143,198,210,227,249,242,233,236,236,233, 99,128,  4, 50,104,  4,
+    198, 72,198, 81,198, 95,198,111,225,242,225,226,233, 99,128,  6,
+    164,230,233,238,225,236,225,242,225,226,233, 99,128,251,107,233,
+    238,233,244,233,225,236,225,242,225,226,233, 99,128,251,108,237,
+    229,228,233,225,236,225,242,225,226,233, 99,128,251,109,235,225,
+    244,225,235,225,238, 97,128, 48,249,238,245,115,128, 38, 64,242,
+    244,233,227,225,108,  2,198,154,198,160,226,225,114,128,  0,124,
+    236,233,238,101,  4,198,173,198,184,198,195,198,204,225,226,239,
+    246,229,227,237, 98,128,  3, 13,226,229,236,239,247,227,237, 98,
+    128,  3, 41,236,239,247,237,239,100,128,  2,204,237,239,100,128,
+      2,200,247,225,242,237,229,238,233,225,110,128,  5,126,232,239,
+    239,107,128,  2,139,105,  3,198,237,198,248,199, 31,235,225,244,
+    225,235,225,238, 97,128, 48,248,242,225,237, 97,  3,199,  3,199,
+     13,199, 20,226,229,238,231,225,236,105,128,  9,205,228,229,246,
+     97,128,  9, 77,231,245,234,225,242,225,244,105,128, 10,205,243,
+    225,242,231, 97,  3,199, 43,199, 53,199, 60,226,229,238,231,225,
+    236,105,128,  9,131,228,229,246, 97,128,  9,  3,231,245,234,225,
+    242,225,244,105,128, 10,131,237,239,238,239,243,240,225,227,101,
+    128,255, 86,111,  3,199, 91,199,102,199,172,225,242,237,229,238,
+    233,225,110,128,  5,120,233,227,229,100,  2,199,111,199,147,233,
+    244,229,242,225,244,233,239,110,  2,199,125,199,136,232,233,242,
+    225,231,225,238, 97,128, 48,158,235,225,244,225,235,225,238, 97,
+    128, 48,254,237,225,242,235,235,225,238, 97,129, 48,155,199,160,
+    232,225,236,230,247,233,228,244,104,128,255,158,235,225,244,225,
+    235,225,238, 97,128, 48,250,240,225,242,229,110,128, 36,177,116,
+      2,199,197,199,204,233,236,228,101,128, 30,125,245,242,238,229,
+    100,128,  2,140,117,  2,199,218,199,229,232,233,242,225,231,225,
+    238, 97,128, 48,148,235,225,244,225,235,225,238, 97,128, 48,244,
+    119,143,  0,119,200, 18,200,251,201,  5,201, 28,201, 68,201,135,
+    201,143,203,114,203,155,203,167,203,242,203,250,204,  1,204, 12,
+    204, 21, 97,  8,200, 36,200, 43,200, 53,200, 64,200,102,200,134,
+    200,146,200,182,227,245,244,101,128, 30,131,229,235,239,242,229,
+    225,110,128, 49, 89,232,233,242,225,231,225,238, 97,128, 48,143,
+    107,  2,200, 70,200, 94,225,244,225,235,225,238, 97,129, 48,239,
+    200, 82,232,225,236,230,247,233,228,244,104,128,255,156,239,242,
+    229,225,110,128, 49, 88,243,237,225,236,108,  2,200,112,200,123,
+    232,233,242,225,231,225,238, 97,128, 48,142,235,225,244,225,235,
+    225,238, 97,128, 48,238,244,244,239,243,241,245,225,242,101,128,
+     51, 87,118,  2,200,152,200,160,229,228,225,243,104,128, 48, 28,
+    249,245,238,228,229,242,243,227,239,242,229,246,229,242,244,233,
+    227,225,108,128,254, 52,119,  3,200,190,200,199,200,213,225,242,
+    225,226,233, 99,128,  6, 72,230,233,238,225,236,225,242,225,226,
+    233, 99,128,254,238,232,225,237,250,225,225,226,239,246,101,  2,
+    200,228,200,237,225,242,225,226,233, 99,128,  6, 36,230,233,238,
+    225,236,225,242,225,226,233, 99,128,254,134,226,243,241,245,225,
+    242,101,128, 51,221,227,233,242, 99,  2,201, 14,201, 19,236,101,
+    128, 36,230,245,237,230,236,229,120,128,  1,117,100,  2,201, 34,
+    201, 44,233,229,242,229,243,233,115,128, 30,133,239,116,  2,201,
+     51,201, 60,225,227,227,229,238,116,128, 30,135,226,229,236,239,
+    119,128, 30,137,101,  4,201, 78,201, 89,201,101,201,125,232,233,
+    242,225,231,225,238, 97,128, 48,145,233,229,242,243,244,242,225,
+    243,115,128, 33, 24,107,  2,201,107,201,117,225,244,225,235,225,
+    238, 97,128, 48,241,239,242,229,225,110,128, 49, 94,239,235,239,
+    242,229,225,110,128, 49, 93,231,242,225,246,101,128, 30,129,232,
+    233,244,101,  8,201,164,201,173,202,  1,202, 91,202,175,202,220,
+    203, 16,203, 72,226,245,236,236,229,116,128, 37,230, 99,  2,201,
+    179,201,199,233,242,227,236,101,129, 37,203,201,189,233,238,246,
+    229,242,243,101,128, 37,217,239,242,238,229,242,226,242,225,227,
+    235,229,116,  2,201,216,201,236,236,229,230,116,129, 48, 14,201,
+    225,246,229,242,244,233,227,225,108,128,254, 67,242,233,231,232,
+    116,129, 48, 15,201,246,246,229,242,244,233,227,225,108,128,254,
+     68,100,  2,202,  7,202, 48,233,225,237,239,238,100,129, 37,199,
+    202, 18,227,239,238,244,225,233,238,233,238,231,226,236,225,227,
+    235,243,237,225,236,236,228,233,225,237,239,238,100,128, 37,200,
+    239,247,238,240,239,233,238,244,233,238,103,  2,202, 64,202, 80,
+    243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,191,
+    244,242,233,225,238,231,236,101,128, 37,189,236,101,  2,202, 98,
+    202,140,230,244,240,239,233,238,244,233,238,103,  2,202,113,202,
+    129,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,
+    195,244,242,233,225,238,231,236,101,128, 37,193,238,244,233,227,
+    245,236,225,242,226,242,225,227,235,229,116,  2,202,160,202,167,
+    236,229,230,116,128, 48, 22,242,233,231,232,116,128, 48, 23,242,
+    233,231,232,244,240,239,233,238,244,233,238,103,  2,202,193,202,
+    209,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,
+    185,244,242,233,225,238,231,236,101,128, 37,183,115,  3,202,228,
+    203,  2,203, 10,109,  2,202,234,202,246,225,236,236,243,241,245,
+    225,242,101,128, 37,171,233,236,233,238,231,230,225,227,101,128,
+     38, 58,241,245,225,242,101,128, 37,161,244,225,114,128, 38,  6,
+    116,  2,203, 22,203, 33,229,236,229,240,232,239,238,101,128, 38,
+     15,239,242,244,239,233,243,229,243,232,229,236,236,226,242,225,
+    227,235,229,116,  2,203, 57,203, 64,236,229,230,116,128, 48, 24,
+    242,233,231,232,116,128, 48, 25,245,240,240,239,233,238,244,233,
+    238,103,  2,203, 87,203,103,243,237,225,236,236,244,242,233,225,
+    238,231,236,101,128, 37,181,244,242,233,225,238,231,236,101,128,
+     37,179,105,  2,203,120,203,131,232,233,242,225,231,225,238, 97,
+    128, 48,144,107,  2,203,137,203,147,225,244,225,235,225,238, 97,
+    128, 48,240,239,242,229,225,110,128, 49, 95,237,239,238,239,243,
+    240,225,227,101,128,255, 87,111,  4,203,177,203,188,203,213,203,
+    231,232,233,242,225,231,225,238, 97,128, 48,146,235,225,244,225,
+    235,225,238, 97,129, 48,242,203,201,232,225,236,230,247,233,228,
+    244,104,128,255,102,110,129, 32,169,203,219,237,239,238,239,243,
+    240,225,227,101,128,255,230,247,225,229,238,244,232,225,105,128,
+     14, 39,240,225,242,229,110,128, 36,178,242,233,238,103,128, 30,
+    152,243,245,240,229,242,233,239,114,128,  2,183,244,245,242,238,
+    229,100,128,  2,141,249,238,110,128,  1,191,120,137,  0,120,204,
+     49,204, 60,204, 71,204, 80,204,107,204,120,204,124,204,136,204,
+    144,225,226,239,246,229,227,237, 98,128,  3, 61,226,239,240,239,
+    237,239,230,111,128, 49, 18,227,233,242,227,236,101,128, 36,231,
+    100,  2,204, 86,204, 96,233,229,242,229,243,233,115,128, 30,141,
+    239,244,225,227,227,229,238,116,128, 30,139,229,232,225,242,237,
+    229,238,233,225,110,128,  5,109,105,128,  3,190,237,239,238,239,
+    243,240,225,227,101,128,255, 88,240,225,242,229,110,128, 36,179,
+    243,245,240,229,242,233,239,114,128,  2,227,121,143,  0,121,204,
+    189,205,148,205,171,205,211,207,177,207,185,207,202,208, 10,208,
+     22,209, 19,209, 59,209, 71,209, 82,209,103,210, 76, 97, 11,204,
+    213,204,225,204,235,204,242,204,249,205,  3,205, 28,205, 39,205,
+     77,205, 90,205,136,225,228,239,243,241,245,225,242,101,128, 51,
+     78,226,229,238,231,225,236,105,128,  9,175,227,245,244,101,128,
+      0,253,228,229,246, 97,128,  9, 47,229,235,239,242,229,225,110,
+    128, 49, 82,231,117,  2,205, 10,205, 19,234,225,242,225,244,105,
+    128, 10,175,242,237,245,235,232,105,128, 10, 47,232,233,242,225,
+    231,225,238, 97,128, 48,132,107,  2,205, 45,205, 69,225,244,225,
+    235,225,238, 97,129, 48,228,205, 57,232,225,236,230,247,233,228,
+    244,104,128,255,148,239,242,229,225,110,128, 49, 81,237,225,235,
+    235,225,238,244,232,225,105,128, 14, 78,243,237,225,236,108,  2,
+    205,100,205,111,232,233,242,225,231,225,238, 97,128, 48,131,235,
+    225,244,225,235,225,238, 97,129, 48,227,205,124,232,225,236,230,
+    247,233,228,244,104,128,255,108,244,227,249,242,233,236,236,233,
+     99,128,  4, 99,227,233,242, 99,  2,205,157,205,162,236,101,128,
+     36,232,245,237,230,236,229,120,128,  1,119,100,  2,205,177,205,
+    187,233,229,242,229,243,233,115,128,  0,255,239,116,  2,205,194,
+    205,203,225,227,227,229,238,116,128, 30,143,226,229,236,239,119,
+    128, 30,245,101,  7,205,227,206,235,206,244,207,  6,207, 38,207,
+    114,207,165,104,  8,205,245,205,254,206, 32,206, 46,206,119,206,
+    135,206,194,206,212,225,242,225,226,233, 99,128,  6, 74,226,225,
+    242,242,229,101,  2,206,  9,206, 18,225,242,225,226,233, 99,128,
+      6,210,230,233,238,225,236,225,242,225,226,233, 99,128,251,175,
+    230,233,238,225,236,225,242,225,226,233, 99,128,254,242,232,225,
+    237,250,225,225,226,239,246,101,  4,206, 65,206, 74,206, 88,206,
+    104,225,242,225,226,233, 99,128,  6, 38,230,233,238,225,236,225,
+    242,225,226,233, 99,128,254,138,233,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,254,139,237,229,228,233,225,236,225,242,
+    225,226,233, 99,128,254,140,233,238,233,244,233,225,236,225,242,
+    225,226,233, 99,128,254,243,237,101,  2,206,142,206,155,228,233,
+    225,236,225,242,225,226,233, 99,128,254,244,229,237,105,  2,206,
+    163,206,178,238,233,244,233,225,236,225,242,225,226,233, 99,128,
+    252,221,243,239,236,225,244,229,228,225,242,225,226,233, 99,128,
+    252, 88,238,239,239,238,230,233,238,225,236,225,242,225,226,233,
+     99,128,252,148,244,232,242,229,229,228,239,244,243,226,229,236,
+    239,247,225,242,225,226,233, 99,128,  6,209,235,239,242,229,225,
+    110,128, 49, 86,110,129,  0,165,206,250,237,239,238,239,243,240,
+    225,227,101,128,255,229,111,  2,207, 12,207, 21,235,239,242,229,
+    225,110,128, 49, 85,242,233,238,232,233,229,245,232,235,239,242,
+    229,225,110,128, 49,134,114,  3,207, 46,207, 82,207, 94,225,232,
+    226,229,238,249,239,237,111,  2,207, 60,207, 69,232,229,226,242,
+    229,119,128,  5,170,236,229,230,244,232,229,226,242,229,119,128,
+      5,170,233,227,249,242,233,236,236,233, 99,128,  4, 75,245,228,
+    233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128,
+      4,249,243,233,229,245,238,103,  3,207,127,207,136,207,152,235,
+    239,242,229,225,110,128, 49,129,240,225,238,243,233,239,243,235,
+    239,242,229,225,110,128, 49,131,243,233,239,243,235,239,242,229,
+    225,110,128, 49,130,244,233,246,232,229,226,242,229,119,128,  5,
+    154,231,242,225,246,101,128, 30,243,232,239,239,107,129,  1,180,
+    207,194,225,226,239,246,101,128, 30,247,105,  5,207,214,207,225,
+    207,236,207,245,207,253,225,242,237,229,238,233,225,110,128,  5,
+    117,227,249,242,233,236,236,233, 99,128,  4, 87,235,239,242,229,
+    225,110,128, 49, 98,238,249,225,238,103,128, 38, 47,247,238,225,
+    242,237,229,238,233,225,110,128,  5,130,237,239,238,239,243,240,
+    225,227,101,128,255, 89,111,  7,208, 38,208,108,208,119,208,129,
+    208,167,208,213,208,222,100,131,  5,217,208, 48,208, 68,208, 77,
+    228,225,231,229,243,104,129,251, 57,208, 59,232,229,226,242,229,
+    119,128,251, 57,232,229,226,242,229,119,128,  5,217,249,239,100,
+      2,208, 85,208, 94,232,229,226,242,229,119,128,  5,242,240,225,
+    244,225,232,232,229,226,242,229,119,128,251, 31,232,233,242,225,
+    231,225,238, 97,128, 48,136,233,235,239,242,229,225,110,128, 49,
+    137,107,  2,208,135,208,159,225,244,225,235,225,238, 97,129, 48,
+    232,208,147,232,225,236,230,247,233,228,244,104,128,255,150,239,
+    242,229,225,110,128, 49, 91,243,237,225,236,108,  2,208,177,208,
+    188,232,233,242,225,231,225,238, 97,128, 48,135,235,225,244,225,
+    235,225,238, 97,129, 48,231,208,201,232,225,236,230,247,233,228,
+    244,104,128,255,110,244,231,242,229,229,107,128,  3,243,121,  2,
+    208,228,209,  9, 97,  2,208,234,208,244,229,235,239,242,229,225,
+    110,128, 49,136,107,  2,208,250,209,  2,239,242,229,225,110,128,
+     49,135,244,232,225,105,128, 14, 34,233,238,231,244,232,225,105,
+    128, 14, 13,112,  2,209, 25,209, 32,225,242,229,110,128, 36,180,
+    239,231,229,231,242,225,237,237,229,238,105,129,  3,122,209, 48,
+    231,242,229,229,235,227,237, 98,128,  3, 69,114,129,  1,166,209,
+     65,233,238,103,128, 30,153,243,245,240,229,242,233,239,114,128,
+      2,184,116,  2,209, 88,209, 95,233,236,228,101,128, 30,249,245,
+    242,238,229,100,128,  2,142,117,  5,209,115,209,126,209,136,209,
+    174,210, 50,232,233,242,225,231,225,238, 97,128, 48,134,233,235,
+    239,242,229,225,110,128, 49,140,107,  2,209,142,209,166,225,244,
+    225,235,225,238, 97,129, 48,230,209,154,232,225,236,230,247,233,
+    228,244,104,128,255,149,239,242,229,225,110,128, 49, 96,115,  3,
+    209,182,209,220,210,  5,226,233,103,  2,209,190,209,201,227,249,
+    242,233,236,236,233, 99,128,  4,107,233,239,244,233,230,233,229,
+    228,227,249,242,233,236,236,233, 99,128,  4,109,236,233,244,244,
+    236,101,  2,209,231,209,242,227,249,242,233,236,236,233, 99,128,
+      4,103,233,239,244,233,230,233,229,228,227,249,242,233,236,236,
+    233, 99,128,  4,105,237,225,236,108,  2,210, 14,210, 25,232,233,
+    242,225,231,225,238, 97,128, 48,133,235,225,244,225,235,225,238,
+     97,129, 48,229,210, 38,232,225,236,230,247,233,228,244,104,128,
+    255,109,249,101,  2,210, 57,210, 66,235,239,242,229,225,110,128,
+     49,139,239,235,239,242,229,225,110,128, 49,138,249, 97,  2,210,
+     83,210, 93,226,229,238,231,225,236,105,128,  9,223,228,229,246,
+     97,128,  9, 95,122,142,  0,122,210,132,211,140,211,151,211,194,
+    211,221,213,  0,213,108,213,150,213,162,213,174,213,202,213,210,
+    213,226,213,235, 97, 10,210,154,210,165,210,172,210,179,210,190,
+    211, 12,211, 42,211, 53,211, 89,211,101,225,242,237,229,238,233,
+    225,110,128,  5,102,227,245,244,101,128,  1,122,228,229,246, 97,
+    128,  9, 91,231,245,242,237,245,235,232,105,128, 10, 91,104,  4,
+    210,200,210,209,210,223,210,253,225,242,225,226,233, 99,128,  6,
+     56,230,233,238,225,236,225,242,225,226,233, 99,128,254,198,105,
+      2,210,229,210,244,238,233,244,233,225,236,225,242,225,226,233,
+     99,128,254,199,242,225,231,225,238, 97,128, 48, 86,237,229,228,
+    233,225,236,225,242,225,226,233, 99,128,254,200,233,110,  2,211,
+     19,211, 28,225,242,225,226,233, 99,128,  6, 50,230,233,238,225,
+    236,225,242,225,226,233, 99,128,254,176,235,225,244,225,235,225,
+    238, 97,128, 48,182,241,229,102,  2,211, 61,211, 75,231,225,228,
+    239,236,232,229,226,242,229,119,128,  5,149,241,225,244,225,238,
+    232,229,226,242,229,119,128,  5,148,242,241,225,232,229,226,242,
+    229,119,128,  5,152,249,233,110,130,  5,214,211,111,211,131,228,
+    225,231,229,243,104,129,251, 54,211,122,232,229,226,242,229,119,
+    128,251, 54,232,229,226,242,229,119,128,  5,214,226,239,240,239,
+    237,239,230,111,128, 49, 23, 99,  3,211,159,211,166,211,188,225,
+    242,239,110,128,  1,126,233,242, 99,  2,211,174,211,179,236,101,
+    128, 36,233,245,237,230,236,229,120,128, 30,145,245,242,108,128,
+      2,145,228,239,116,130,  1,124,211,204,211,213,225,227,227,229,
+    238,116,128,  1,124,226,229,236,239,119,128, 30,147,101,  6,211,
+    235,211,246,212, 33,212, 44,212, 55,212,251,227,249,242,233,236,
+    236,233, 99,128,  4, 55,100,  2,211,252,212, 15,229,243,227,229,
+    238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,153,233,
+    229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128,  4,
+    223,232,233,242,225,231,225,238, 97,128, 48, 92,235,225,244,225,
+    235,225,238, 97,128, 48,188,242,111,140,  0, 48,212, 84,212, 93,
+    212,103,212,110,212,135,212,148,212,159,212,171,212,182,212,192,
+    212,203,212,210,225,242,225,226,233, 99,128,  6, 96,226,229,238,
+    231,225,236,105,128,  9,230,228,229,246, 97,128,  9,102,231,117,
+      2,212,117,212,126,234,225,242,225,244,105,128, 10,230,242,237,
+    245,235,232,105,128, 10,102,232,225,227,235,225,242,225,226,233,
+     99,128,  6, 96,233,238,230,229,242,233,239,114,128, 32,128,237,
+    239,238,239,243,240,225,227,101,128,255, 16,239,236,228,243,244,
+    249,236,101,128,247, 48,240,229,242,243,233,225,110,128,  6,240,
+    243,245,240,229,242,233,239,114,128, 32,112,244,232,225,105,128,
+     14, 80,247,233,228,244,104,  3,212,222,212,231,212,243,234,239,
+    233,238,229,114,128,254,255,238,239,238,234,239,233,238,229,114,
+    128, 32, 12,243,240,225,227,101,128, 32, 11,244, 97,128,  3,182,
+    104,  2,213,  6,213, 17,226,239,240,239,237,239,230,111,128, 49,
+     19,101,  4,213, 27,213, 38,213, 54,213, 65,225,242,237,229,238,
+    233,225,110,128,  5,106,226,242,229,246,229,227,249,242,233,236,
+    236,233, 99,128,  4,194,227,249,242,233,236,236,233, 99,128,  4,
+     54,100,  2,213, 71,213, 90,229,243,227,229,238,228,229,242,227,
+    249,242,233,236,236,233, 99,128,  4,151,233,229,242,229,243,233,
+    243,227,249,242,233,236,236,233, 99,128,  4,221,105,  3,213,116,
+    213,127,213,138,232,233,242,225,231,225,238, 97,128, 48, 88,235,
+    225,244,225,235,225,238, 97,128, 48,184,238,239,242,232,229,226,
+    242,229,119,128,  5,174,236,233,238,229,226,229,236,239,119,128,
+     30,149,237,239,238,239,243,240,225,227,101,128,255, 90,111,  2,
+    213,180,213,191,232,233,242,225,231,225,238, 97,128, 48, 94,235,
+    225,244,225,235,225,238, 97,128, 48,190,240,225,242,229,110,128,
+     36,181,242,229,244,242,239,230,236,229,248,232,239,239,107,128,
+      2,144,243,244,242,239,235,101,128,  1,182,117,  2,213,241,213,
+    252,232,233,242,225,231,225,238, 97,128, 48, 90,235,225,244,225,
+    235,225,238, 97,128, 48,186
+  };
+
 
-  static const unsigned short  ps_names_to_unicode[4295] =
+  /*
+   *  This function searches the compressed table efficiently.
+   */
+  static unsigned long
+  ft_get_adobe_glyph_index( const char*  name,
+                            const char*  limit )
   {
-    0,
-    0x0020U,
-    0x0021U,
-    0x0022U,
-    0x0023U,
-    0x0024U,
-    0x0025U,
-    0x0026U,
-    0x2019U,
-    0x0028U,
-    0x0029U,
-    0x002AU,
-    0x002BU,
-    0x002CU,
-    0x002DU,
-    0x002EU,
-    0x002FU,
-    0x0030U,
-    0x0031U,
-    0x0032U,
-    0x0033U,
-    0x0034U,
-    0x0035U,
-    0x0036U,
-    0x0037U,
-    0x0038U,
-    0x0039U,
-    0x003AU,
-    0x003BU,
-    0x003CU,
-    0x003DU,
-    0x003EU,
-    0x003FU,
-    0x0040U,
-    0x0041U,
-    0x0042U,
-    0x0043U,
-    0x0044U,
-    0x0045U,
-    0x0046U,
-    0x0047U,
-    0x0048U,
-    0x0049U,
-    0x004AU,
-    0x004BU,
-    0x004CU,
-    0x004DU,
-    0x004EU,
-    0x004FU,
-    0x0050U,
-    0x0051U,
-    0x0052U,
-    0x0053U,
-    0x0054U,
-    0x0055U,
-    0x0056U,
-    0x0057U,
-    0x0058U,
-    0x0059U,
-    0x005AU,
-    0x005BU,
-    0x005CU,
-    0x005DU,
-    0x005EU,
-    0x005FU,
-    0x2018U,
-    0x0061U,
-    0x0062U,
-    0x0063U,
-    0x0064U,
-    0x0065U,
-    0x0066U,
-    0x0067U,
-    0x0068U,
-    0x0069U,
-    0x006AU,
-    0x006BU,
-    0x006CU,
-    0x006DU,
-    0x006EU,
-    0x006FU,
-    0x0070U,
-    0x0071U,
-    0x0072U,
-    0x0073U,
-    0x0074U,
-    0x0075U,
-    0x0076U,
-    0x0077U,
-    0x0078U,
-    0x0079U,
-    0x007AU,
-    0x007BU,
-    0x007CU,
-    0x007DU,
-    0x007EU,
-    0x00A1U,
-    0x00A2U,
-    0x00A3U,
-    0x2044U,
-    0x00A5U,
-    0x0192U,
-    0x00A7U,
-    0x00A4U,
-    0x0027U,
-    0x201CU,
-    0x00ABU,
-    0x2039U,
-    0x203AU,
-    0xFB01U,
-    0xFB02U,
-    0x2013U,
-    0x2020U,
-    0x2021U,
-    0x00B7U,
-    0x00B6U,
-    0x2022U,
-    0x201AU,
-    0x201EU,
-    0x201DU,
-    0x00BBU,
-    0x2026U,
-    0x2030U,
-    0x00BFU,
-    0x0060U,
-    0x00B4U,
-    0x02C6U,
-    0x02DCU,
-    0x00AFU,
-    0x02D8U,
-    0x02D9U,
-    0x00A8U,
-    0x02DAU,
-    0x00B8U,
-    0x02DDU,
-    0x02DBU,
-    0x02C7U,
-    0x2014U,
-    0x00C6U,
-    0x00AAU,
-    0x0141U,
-    0x00D8U,
-    0x0152U,
-    0x00BAU,
-    0x00E6U,
-    0x0131U,
-    0x0142U,
-    0x00F8U,
-    0x0153U,
-    0x00DFU,
-    0x00B9U,
-    0x00ACU,
-    0x00B5U,
-    0x2122U,
-    0x00D0U,
-    0x00BDU,
-    0x00B1U,
-    0x00DEU,
-    0x00BCU,
-    0x00F7U,
-    0x00A6U,
-    0x00B0U,
-    0x00FEU,
-    0x00BEU,
-    0x00B2U,
-    0x00AEU,
-    0x2212U,
-    0x00F0U,
-    0x00D7U,
-    0x00B3U,
-    0x00A9U,
-    0x00C1U,
-    0x00C2U,
-    0x00C4U,
-    0x00C0U,
-    0x00C5U,
-    0x00C3U,
-    0x00C7U,
-    0x00C9U,
-    0x00CAU,
-    0x00CBU,
-    0x00C8U,
-    0x00CDU,
-    0x00CEU,
-    0x00CFU,
-    0x00CCU,
-    0x00D1U,
-    0x00D3U,
-    0x00D4U,
-    0x00D6U,
-    0x00D2U,
-    0x00D5U,
-    0x0160U,
-    0x00DAU,
-    0x00DBU,
-    0x00DCU,
-    0x00D9U,
-    0x00DDU,
-    0x0178U,
-    0x017DU,
-    0x00E1U,
-    0x00E2U,
-    0x00E4U,
-    0x00E0U,
-    0x00E5U,
-    0x00E3U,
-    0x00E7U,
-    0x00E9U,
-    0x00EAU,
-    0x00EBU,
-    0x00E8U,
-    0x00EDU,
-    0x00EEU,
-    0x00EFU,
-    0x00ECU,
-    0x00F1U,
-    0x00F3U,
-    0x00F4U,
-    0x00F6U,
-    0x00F2U,
-    0x00F5U,
-    0x0161U,
-    0x00FAU,
-    0x00FBU,
-    0x00FCU,
-    0x00F9U,
-    0x00FDU,
-    0x00FFU,
-    0x017EU,
-    0xF721U,
-    0xF6F8U,
-    0xF724U,
-    0xF6E4U,
-    0xF726U,
-    0xF7B4U,
-    0x207DU,
-    0x207EU,
-    0x2025U,
-    0x2024U,
-    0xF730U,
-    0xF731U,
-    0xF732U,
-    0xF733U,
-    0xF734U,
-    0xF735U,
-    0xF736U,
-    0xF737U,
-    0xF738U,
-    0xF739U,
-    0xF6E2U,
-    0xF6DEU,
-    0xF6E8U,
-    0xF73FU,
-    0xF6E9U,
-    0xF6EAU,
-    0xF6E0U,
-    0xF6EBU,
-    0xF6ECU,
-    0xF6EDU,
-    0xF6EEU,
-    0xF6EFU,
-    0x207FU,
-    0xF6F0U,
-    0xF6F1U,
-    0xF6F2U,
-    0xF6F3U,
-    0xFB00U,
-    0xFB03U,
-    0xFB04U,
-    0x208DU,
-    0x208EU,
-    0xF6F6U,
-    0xF6E6U,
-    0xF760U,
-    0xF761U,
-    0xF762U,
-    0xF763U,
-    0xF764U,
-    0xF765U,
-    0xF766U,
-    0xF767U,
-    0xF768U,
-    0xF769U,
-    0xF76AU,
-    0xF76BU,
-    0xF76CU,
-    0xF76DU,
-    0xF76EU,
-    0xF76FU,
-    0xF770U,
-    0xF771U,
-    0xF772U,
-    0xF773U,
-    0xF774U,
-    0xF775U,
-    0xF776U,
-    0xF777U,
-    0xF778U,
-    0xF779U,
-    0xF77AU,
-    0x20A1U,
-    0xF6DCU,
-    0xF6DDU,
-    0xF6FEU,
-    0xF7A1U,
-    0xF7A2U,
-    0xF6F9U,
-    0xF6FDU,
-    0xF6FFU,
-    0xF7A8U,
-    0xF6F4U,
-    0xF6F5U,
-    0xF6F7U,
-    0xF7AFU,
-    0x2012U,
-    0xF6E5U,
-    0xF6FBU,
-    0xF6FCU,
-    0xF7B8U,
-    0xF7BFU,
-    0x215BU,
-    0x215CU,
-    0x215DU,
-    0x215EU,
-    0x2153U,
-    0x2154U,
-    0x2070U,
-    0x2074U,
-    0x2075U,
-    0x2076U,
-    0x2077U,
-    0x2078U,
-    0x2079U,
-    0x2080U,
-    0x2081U,
-    0x2082U,
-    0x2083U,
-    0x2084U,
-    0x2085U,
-    0x2086U,
-    0x2087U,
-    0x2088U,
-    0x2089U,
-    0xF6DFU,
-    0xF6E3U,
-    0xF6E7U,
-    0xF6E1U,
-    0xF7E0U,
-    0xF7E1U,
-    0xF7E2U,
-    0xF7E3U,
-    0xF7E4U,
-    0xF7E5U,
-    0xF7E6U,
-    0xF7E7U,
-    0xF7E8U,
-    0xF7E9U,
-    0xF7EAU,
-    0xF7EBU,
-    0xF7ECU,
-    0xF7EDU,
-    0xF7EEU,
-    0xF7EFU,
-    0xF7F0U,
-    0xF7F1U,
-    0xF7F2U,
-    0xF7F3U,
-    0xF7F4U,
-    0xF7F5U,
-    0xF7F6U,
-    0xF6FAU,
-    0xF7F8U,
-    0xF7F9U,
-    0xF7FAU,
-    0xF7FBU,
-    0xF7FCU,
-    0xF7FDU,
-    0xF7FEU,
-    0xF7FFU,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
+    int                   c = 0;
+    int                   count, min, max;
+    const unsigned char*  p = ft_adobe_glyph_list;
 
-#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
 
-    0x01FCU,
-    0x01E2U,
-    0x0102U,
-    0x1EAEU,
-    0x04D0U,
-    0x1EB6U,
-    0x1EB0U,
-    0x1EB2U,
-    0x1EB4U,
-    0x01CDU,
-    0x24B6U,
-    0x1EA4U,
-    0x1EACU,
-    0x1EA6U,
-    0x1EA8U,
-    0x1EAAU,
-    0xF6C9U,
-    0x0410U,
-    0x0200U,
-    0x04D2U,
-    0x01DEU,
-    0x1EA0U,
-    0x01E0U,
-    0x1EA2U,
-    0x04D4U,
-    0x0202U,
-    0x0391U,
-    0x0386U,
-    0x0100U,
-    0xFF21U,
-    0x0104U,
-    0x01FAU,
-    0x1E00U,
-    0x0531U,
-    0x24B7U,
-    0x1E02U,
-    0x1E04U,
-    0x0411U,
-    0x0532U,
-    0x0392U,
-    0x0181U,
-    0x1E06U,
-    0xFF22U,
-    0x0182U,
-    0x053EU,
-    0x0106U,
-    0xF6CAU,
-    0x010CU,
-    0x1E08U,
-    0x24B8U,
-    0x0108U,
-    0x010AU,
-    0x010AU,
-    0x0549U,
-    0x04BCU,
-    0x0427U,
-    0x04BEU,
-    0x04B6U,
-    0x04F4U,
-    0x0543U,
-    0x04CBU,
-    0x04B8U,
-    0x03A7U,
-    0x0187U,
-    0xFF23U,
-    0x0551U,
-    0x01F1U,
-    0x01C4U,
-    0x0534U,
-    0x0189U,
-    0x010EU,
-    0x1E10U,
-    0x24B9U,
-    0x1E12U,
-    0x0110U,
-    0x1E0AU,
-    0x1E0CU,
-    0x0414U,
-    0x03EEU,
-    0x2206U,
-    0x0394U,
-    0x018AU,
-    0xF6CBU,
-    0xF6CCU,
-    0xF6CDU,
-    0x03DCU,
-    0x0402U,
-    0x1E0EU,
-    0xFF24U,
-    0x0110U,
-    0x018BU,
-    0x01F2U,
-    0x01C5U,
-    0x04E0U,
-    0x0405U,
-    0x040FU,
-    0x0114U,
-    0x011AU,
-    0x1E1CU,
-    0x0535U,
-    0x24BAU,
-    0x1EBEU,
-    0x1E18U,
-    0x1EC6U,
-    0x1EC0U,
-    0x1EC2U,
-    0x1EC4U,
-    0x0404U,
-    0x0204U,
-    0x0116U,
-    0x0116U,
-    0x1EB8U,
-    0x0424U,
-    0x0537U,
-    0x1EBAU,
-    0x2167U,
-    0x0206U,
-    0x0464U,
-    0x041BU,
-    0x216AU,
-    0x0112U,
-    0x1E16U,
-    0x1E14U,
-    0x041CU,
-    0xFF25U,
-    0x041DU,
-    0x04A2U,
-    0x014AU,
-    0x04A4U,
-    0x04C7U,
-    0x0118U,
-    0x0190U,
-    0x0395U,
-    0x0388U,
-    0x0420U,
-    0x018EU,
-    0x042DU,
-    0x0421U,
-    0x04AAU,
-    0x01A9U,
-    0x0397U,
-    0x0538U,
-    0x0389U,
-    0x1EBCU,
-    0x1E1AU,
-    0x20ACU,
-    0x01B7U,
-    0x01EEU,
-    0x01B8U,
-    0x24BBU,
-    0x1E1EU,
-    0x0556U,
-    0x03E4U,
-    0x0191U,
-    0x0472U,
-    0x2164U,
-    0xFF26U,
-    0x2163U,
-    0x3387U,
-    0x01F4U,
-    0x0393U,
-    0x0194U,
-    0x03EAU,
-    0x011EU,
-    0x01E6U,
-    0x0122U,
-    0x24BCU,
-    0x011CU,
-    0x0122U,
-    0x0120U,
-    0x0120U,
-    0x0413U,
-    0x0542U,
-    0x0494U,
-    0x0492U,
-    0x0490U,
-    0x0193U,
-    0x0533U,
-    0x0403U,
-    0x1E20U,
-    0xFF27U,
-    0xF6CEU,
-    0x029BU,
-    0x01E4U,
-    0x25CFU,
-    0x25AAU,
-    0x25ABU,
-    0x25A1U,
-    0x33CBU,
-    0x04A8U,
-    0x04B2U,
-    0x042AU,
-    0x0126U,
-    0x1E2AU,
-    0x1E28U,
-    0x24BDU,
-    0x0124U,
-    0x1E26U,
-    0x1E22U,
-    0x1E24U,
-    0xFF28U,
-    0x0540U,
-    0x03E8U,
-    0xF6CFU,
-    0x3390U,
-    0x042FU,
-    0x0132U,
-    0x042EU,
-    0x012CU,
-    0x01CFU,
-    0x24BEU,
-    0x0406U,
-    0x0208U,
-    0x1E2EU,
-    0x04E4U,
-    0x0130U,
-    0x0130U,
-    0x1ECAU,
-    0x04D6U,
-    0x0415U,
-    0x2111U,
-    0x1EC8U,
-    0x0418U,
-    0x020AU,
-    0x0419U,
-    0x012AU,
-    0x04E2U,
-    0xFF29U,
-    0x053BU,
-    0x0401U,
-    0x012EU,
-    0x0399U,
-    0x0196U,
-    0x03AAU,
-    0x038AU,
-    0x0197U,
-    0x0128U,
-    0x1E2CU,
-    0x0474U,
-    0x0476U,
-    0x0541U,
-    0x24BFU,
-    0x0134U,
-    0x0408U,
-    0x054BU,
-    0xFF2AU,
-    0x3385U,
-    0x33CDU,
-    0x04A0U,
-    0x1E30U,
-    0x041AU,
-    0x049AU,
-    0x04C3U,
-    0x039AU,
-    0x049EU,
-    0x049CU,
-    0x01E8U,
-    0x0136U,
-    0x24C0U,
-    0x0136U,
-    0x1E32U,
-    0x0554U,
-    0x053FU,
-    0x0425U,
-    0x03E6U,
-    0x0198U,
-    0x040CU,
-    0x1E34U,
-    0xFF2BU,
-    0x0480U,
-    0x03DEU,
-    0x046EU,
-    0x01C7U,
-    0xF6BFU,
-    0x0139U,
-    0x039BU,
-    0x013DU,
-    0x013BU,
-    0x24C1U,
-    0x1E3CU,
-    0x013BU,
-    0x013FU,
-    0x013FU,
-    0x1E36U,
-    0x1E38U,
-    0x053CU,
-    0x01C8U,
-    0x0409U,
-    0x1E3AU,
-    0xFF2CU,
-    0x3386U,
-    0xF6D0U,
-    0x1E3EU,
-    0x24C2U,
-    0x1E40U,
-    0x1E42U,
-    0x0544U,
-    0xFF2DU,
-    0x019CU,
-    0x039CU,
-    0x01CAU,
-    0x0143U,
-    0x0147U,
-    0x0145U,
-    0x24C3U,
-    0x1E4AU,
-    0x0145U,
-    0x1E44U,
-    0x1E46U,
-    0x019DU,
-    0x2168U,
-    0x01CBU,
-    0x040AU,
-    0x1E48U,
-    0xFF2EU,
-    0x0546U,
-    0x039DU,
-    0x04E8U,
-    0x04EAU,
-    0x014EU,
-    0x01D1U,
-    0x019FU,
-    0x24C4U,
-    0x1ED0U,
-    0x1ED8U,
-    0x1ED2U,
-    0x1ED4U,
-    0x1ED6U,
-    0x041EU,
-    0x0150U,
-    0x020CU,
-    0x04E6U,
-    0x1ECCU,
-    0x0555U,
-    0x2126U,
-    0x1ECEU,
-    0x01A0U,
-    0x1EDAU,
-    0x1EE2U,
-    0x1EDCU,
-    0x1EDEU,
-    0x1EE0U,
-    0x0150U,
-    0x01A2U,
-    0x020EU,
-    0x014CU,
-    0x1E52U,
-    0x1E50U,
-    0x2126U,
-    0x0460U,
-    0x03A9U,
-    0x047AU,
-    0x047CU,
-    0x038FU,
-    0x039FU,
-    0x038CU,
-    0xFF2FU,
-    0x2160U,
-    0x01EAU,
-    0x01ECU,
-    0x0186U,
-    0x01FEU,
-    0x01FEU,
-    0x047EU,
-    0x1E4CU,
-    0x1E4EU,
-    0x1E54U,
-    0x24C5U,
-    0x1E56U,
-    0x041FU,
-    0x054AU,
-    0x04A6U,
-    0x03A6U,
-    0x01A4U,
-    0x03A0U,
-    0x0553U,
-    0xFF30U,
-    0x03A8U,
-    0x0470U,
-    0x24C6U,
-    0xFF31U,
-    0x054CU,
-    0x0154U,
-    0x0158U,
-    0x0156U,
-    0x24C7U,
-    0x0156U,
-    0x0210U,
-    0x1E58U,
-    0x1E5AU,
-    0x1E5CU,
-    0x0550U,
-    0x211CU,
-    0x03A1U,
-    0x0212U,
-    0x1E5EU,
-    0xFF32U,
-    0x0281U,
-    0x02B6U,
-    0x250CU,
-    0x2514U,
-    0x2510U,
-    0x2518U,
-    0x253CU,
-    0x252CU,
-    0x2534U,
-    0x251CU,
-    0x2524U,
-    0x2500U,
-    0x2502U,
-    0x2561U,
-    0x2562U,
-    0x2556U,
-    0x2555U,
-    0x2563U,
-    0x2551U,
-    0x2557U,
-    0x255DU,
-    0x255CU,
-    0x255BU,
-    0x255EU,
-    0x255FU,
-    0x255AU,
-    0x2554U,
-    0x2569U,
-    0x2566U,
-    0x2560U,
-    0x2550U,
-    0x256CU,
-    0x2567U,
-    0x2568U,
-    0x2564U,
-    0x2565U,
-    0x2559U,
-    0x2558U,
-    0x2552U,
-    0x2553U,
-    0x256BU,
-    0x256AU,
-    0x015AU,
-    0x1E64U,
-    0x03E0U,
-    0x1E66U,
-    0x015EU,
-    0x018FU,
-    0x04D8U,
-    0x04DAU,
-    0x24C8U,
-    0x015CU,
-    0x0218U,
-    0x1E60U,
-    0x1E62U,
-    0x1E68U,
-    0x054DU,
-    0x2166U,
-    0x0547U,
-    0x0428U,
-    0x0429U,
-    0x03E2U,
-    0x04BAU,
-    0x03ECU,
-    0x03A3U,
-    0x2165U,
-    0xFF33U,
-    0x042CU,
-    0x03DAU,
-    0x03A4U,
-    0x0166U,
-    0x0164U,
-    0x0162U,
-    0x24C9U,
-    0x1E70U,
-    0x0162U,
-    0x1E6AU,
-    0x1E6CU,
-    0x0422U,
-    0x04ACU,
-    0x2169U,
-    0x04B4U,
-    0x0398U,
-    0x01ACU,
-    0x2162U,
-    0x054FU,
-    0x1E6EU,
-    0xFF34U,
-    0x0539U,
-    0x01BCU,
-    0x0184U,
-    0x01A7U,
-    0x01AEU,
-    0x0426U,
-    0x040BU,
-    0x216BU,
-    0x2161U,
-    0x016CU,
-    0x01D3U,
-    0x24CAU,
-    0x1E76U,
-    0x0423U,
-    0x0170U,
-    0x0214U,
-    0x01D7U,
-    0x1E72U,
-    0x01D9U,
-    0x04F0U,
-    0x01DBU,
-    0x01D5U,
-    0x1EE4U,
-    0x1EE6U,
-    0x01AFU,
-    0x1EE8U,
-    0x1EF0U,
-    0x1EEAU,
-    0x1EECU,
-    0x1EEEU,
-    0x0170U,
-    0x04F2U,
-    0x0216U,
-    0x0478U,
-    0x016AU,
-    0x04EEU,
-    0x1E7AU,
-    0xFF35U,
-    0x0172U,
-    0x03A5U,
-    0x03D2U,
-    0x03D3U,
-    0x01B1U,
-    0x03ABU,
-    0x03D4U,
-    0x03D2U,
-    0x038EU,
-    0x016EU,
-    0x040EU,
-    0x04AEU,
-    0x04B0U,
-    0x0168U,
-    0x1E78U,
-    0x1E74U,
-    0x24CBU,
-    0x1E7EU,
-    0x0412U,
-    0x054EU,
-    0x01B2U,
-    0xFF36U,
-    0x0548U,
-    0x1E7CU,
-    0x1E82U,
-    0x24CCU,
-    0x0174U,
-    0x1E84U,
-    0x1E86U,
-    0x1E88U,
-    0x1E80U,
-    0xFF37U,
-    0x24CDU,
-    0x1E8CU,
-    0x1E8AU,
-    0x053DU,
-    0x039EU,
-    0xFF38U,
-    0x0462U,
-    0x24CEU,
-    0x0176U,
-    0x1E8EU,
-    0x1EF4U,
-    0x042BU,
-    0x04F8U,
-    0x1EF2U,
-    0x01B3U,
-    0x1EF6U,
-    0x0545U,
-    0x0407U,
-    0x0552U,
-    0xFF39U,
-    0x1EF8U,
-    0x046AU,
-    0x046CU,
-    0x0466U,
-    0x0468U,
-    0x0536U,
-    0x0179U,
-    0x24CFU,
-    0x1E90U,
-    0x017BU,
-    0x017BU,
-    0x1E92U,
-    0x0417U,
-    0x0498U,
-    0x04DEU,
-    0x0396U,
-    0x053AU,
-    0x04C1U,
-    0x0416U,
-    0x0496U,
-    0x04DCU,
-    0x1E94U,
-    0xFF3AU,
-    0x01B5U,
-    0x0986U,
-    0x0906U,
-    0x0A86U,
-    0x0A06U,
-    0x0A3EU,
-    0x3303U,
-    0x09BEU,
-    0x093EU,
-    0x0ABEU,
-    0x055FU,
-    0x0970U,
-    0x0985U,
-    0x311AU,
-    0x0103U,
-    0x1EAFU,
-    0x04D1U,
-    0x1EB7U,
-    0x1EB1U,
-    0x1EB3U,
-    0x1EB5U,
-    0x01CEU,
-    0x24D0U,
-    0x1EA5U,
-    0x1EADU,
-    0x1EA7U,
-    0x1EA9U,
-    0x1EABU,
-    0x0317U,
-    0x0301U,
-    0x0301U,
-    0x0954U,
-    0x02CFU,
-    0x0341U,
-    0x0430U,
-    0x0201U,
-    0x0A71U,
-    0x0905U,
-    0x04D3U,
-    0x01DFU,
-    0x1EA1U,
-    0x01E1U,
-    0x01FDU,
-    0x3150U,
-    0x01E3U,
-    0x2015U,
-    0x20A4U,
-    0x0410U,
-    0x0411U,
-    0x0412U,
-    0x0413U,
-    0x0414U,
-    0x0415U,
-    0x0401U,
-    0x0416U,
-    0x0417U,
-    0x0418U,
-    0x0419U,
-    0x041AU,
-    0x041BU,
-    0x041CU,
-    0x041DU,
-    0x041EU,
-    0x041FU,
-    0x0420U,
-    0x0421U,
-    0x0422U,
-    0x0423U,
-    0x0424U,
-    0x0425U,
-    0x0426U,
-    0x0427U,
-    0x0428U,
-    0x0429U,
-    0x042AU,
-    0x042BU,
-    0x042CU,
-    0x042DU,
-    0x042EU,
-    0x042FU,
-    0x0490U,
-    0x0402U,
-    0x0403U,
-    0x0404U,
-    0x0405U,
-    0x0406U,
-    0x0407U,
-    0x0408U,
-    0x0409U,
-    0x040AU,
-    0x040BU,
-    0x040CU,
-    0x040EU,
-    0xF6C4U,
-    0xF6C5U,
-    0x0430U,
-    0x0431U,
-    0x0432U,
-    0x0433U,
-    0x0434U,
-    0x0435U,
-    0x0451U,
-    0x0436U,
-    0x0437U,
-    0x0438U,
-    0x0439U,
-    0x043AU,
-    0x043BU,
-    0x043CU,
-    0x043DU,
-    0x043EU,
-    0x043FU,
-    0x0440U,
-    0x0441U,
-    0x0442U,
-    0x0443U,
-    0x0444U,
-    0x0445U,
-    0x0446U,
-    0x0447U,
-    0x0448U,
-    0x0449U,
-    0x044AU,
-    0x044BU,
-    0x044CU,
-    0x044DU,
-    0x044EU,
-    0x044FU,
-    0x0491U,
-    0x0452U,
-    0x0453U,
-    0x0454U,
-    0x0455U,
-    0x0456U,
-    0x0457U,
-    0x0458U,
-    0x0459U,
-    0x045AU,
-    0x045BU,
-    0x045CU,
-    0x045EU,
-    0x040FU,
-    0x0462U,
-    0x0472U,
-    0x0474U,
-    0xF6C6U,
-    0x045FU,
-    0x0463U,
-    0x0473U,
-    0x0475U,
-    0xF6C7U,
-    0xF6C8U,
-    0x04D9U,
-    0x200EU,
-    0x200FU,
-    0x200DU,
-    0x066AU,
-    0x060CU,
-    0x0660U,
-    0x0661U,
-    0x0662U,
-    0x0663U,
-    0x0664U,
-    0x0665U,
-    0x0666U,
-    0x0667U,
-    0x0668U,
-    0x0669U,
-    0x061BU,
-    0x061FU,
-    0x0621U,
-    0x0622U,
-    0x0623U,
-    0x0624U,
-    0x0625U,
-    0x0626U,
-    0x0627U,
-    0x0628U,
-    0x0629U,
-    0x062AU,
-    0x062BU,
-    0x062CU,
-    0x062DU,
-    0x062EU,
-    0x062FU,
-    0x0630U,
-    0x0631U,
-    0x0632U,
-    0x0633U,
-    0x0634U,
-    0x0635U,
-    0x0636U,
-    0x0637U,
-    0x0638U,
-    0x0639U,
-    0x063AU,
-    0x0640U,
-    0x0641U,
-    0x0642U,
-    0x0643U,
-    0x0644U,
-    0x0645U,
-    0x0646U,
-    0x0648U,
-    0x0649U,
-    0x064AU,
-    0x064BU,
-    0x064CU,
-    0x064DU,
-    0x064EU,
-    0x064FU,
-    0x0650U,
-    0x0651U,
-    0x0652U,
-    0x0647U,
-    0x06A4U,
-    0x067EU,
-    0x0686U,
-    0x0698U,
-    0x06AFU,
-    0x0679U,
-    0x0688U,
-    0x0691U,
-    0x06BAU,
-    0x06D2U,
-    0x06D5U,
-    0x20AAU,
-    0x05BEU,
-    0x05C3U,
-    0x05D0U,
-    0x05D1U,
-    0x05D2U,
-    0x05D3U,
-    0x05D4U,
-    0x05D5U,
-    0x05D6U,
-    0x05D7U,
-    0x05D8U,
-    0x05D9U,
-    0x05DAU,
-    0x05DBU,
-    0x05DCU,
-    0x05DDU,
-    0x05DEU,
-    0x05DFU,
-    0x05E0U,
-    0x05E1U,
-    0x05E2U,
-    0x05E3U,
-    0x05E4U,
-    0x05E5U,
-    0x05E6U,
-    0x05E7U,
-    0x05E8U,
-    0x05E9U,
-    0x05EAU,
-    0xFB2AU,
-    0xFB2BU,
-    0xFB4BU,
-    0xFB1FU,
-    0x05F0U,
-    0x05F1U,
-    0x05F2U,
-    0xFB35U,
-    0x05B4U,
-    0x05B5U,
-    0x05B6U,
-    0x05BBU,
-    0x05B8U,
-    0x05B7U,
-    0x05B0U,
-    0x05B2U,
-    0x05B1U,
-    0x05B3U,
-    0x05C2U,
-    0x05C1U,
-    0x05B9U,
-    0x05BCU,
-    0x05BDU,
-    0x05BFU,
-    0x05C0U,
-    0x02BCU,
-    0x2105U,
-    0x2113U,
-    0x2116U,
-    0x202CU,
-    0x202DU,
-    0x202EU,
-    0x200CU,
-    0x066DU,
-    0x02BDU,
-    0x0A85U,
-    0x0A05U,
-    0x3042U,
-    0x1EA3U,
-    0x0990U,
-    0x311EU,
-    0x0910U,
-    0x04D5U,
-    0x0A90U,
-    0x0A10U,
-    0x0A48U,
-    0x0639U,
-    0xFECAU,
-    0xFECBU,
-    0xFECCU,
-    0x0203U,
-    0x09C8U,
-    0x0948U,
-    0x0AC8U,
-    0x30A2U,
-    0xFF71U,
-    0x314FU,
-    0x05D0U,
-    0x0627U,
-    0xFB30U,
-    0xFE8EU,
-    0x0623U,
-    0xFE84U,
-    0x0625U,
-    0xFE88U,
-    0x05D0U,
-    0xFB4FU,
-    0x0622U,
-    0xFE82U,
-    0x0649U,
-    0xFEF0U,
-    0xFEF3U,
-    0xFEF4U,
-    0xFB2EU,
-    0xFB2FU,
-    0x2135U,
-    0x224CU,
-    0x03B1U,
-    0x03ACU,
-    0x0101U,
-    0xFF41U,
-    0xFF06U,
-    0x33C2U,
-    0x3122U,
-    0x3124U,
-    0x0E5AU,
-    0x2220U,
-    0x3008U,
-    0xFE3FU,
-    0x3009U,
-    0xFE40U,
-    0x2329U,
-    0x232AU,
-    0x212BU,
-    0x0387U,
-    0x0952U,
-    0x0982U,
-    0x0902U,
-    0x0A82U,
-    0x0105U,
-    0x3300U,
-    0x249CU,
-    0x055AU,
-    0x02BCU,
-    0xF8FFU,
-    0x2250U,
-    0x2248U,
-    0x2252U,
-    0x2245U,
-    0x318EU,
-    0x318DU,
-    0x2312U,
-    0x1E9AU,
-    0x01FBU,
-    0x1E01U,
-    0x2194U,
-    0x21E3U,
-    0x21E0U,
-    0x21E2U,
-    0x21E1U,
-    0x21D4U,
-    0x21D3U,
-    0x21D0U,
-    0x21D2U,
-    0x21D1U,
-    0x2193U,
-    0x2199U,
-    0x2198U,
-    0x21E9U,
-    0x02C5U,
-    0x02C2U,
-    0x02C3U,
-    0x02C4U,
-    0xF8E7U,
-    0x2190U,
-    0x21D0U,
-    0x21CDU,
-    0x21C6U,
-    0x21E6U,
-    0x2192U,
-    0x21CFU,
-    0x279EU,
-    0x21C4U,
-    0x21E8U,
-    0x21E4U,
-    0x21E5U,
-    0x2191U,
-    0x2195U,
-    0x21A8U,
-    0x21A8U,
-    0x2196U,
-    0x21C5U,
-    0x2197U,
-    0x21E7U,
-    0xF8E6U,
-    0xFF3EU,
-    0xFF5EU,
-    0x0251U,
-    0x0252U,
-    0x3041U,
-    0x30A1U,
-    0xFF67U,
-    0x066DU,
-    0x066DU,
-    0x2217U,
-    0xFF0AU,
-    0xFE61U,
-    0x2042U,
-    0x2243U,
-    0xFF20U,
-    0xFE6BU,
-    0x0250U,
-    0x0994U,
-    0x3120U,
-    0x0914U,
-    0x0A94U,
-    0x0A14U,
-    0x09D7U,
-    0x0A4CU,
-    0x09CCU,
-    0x094CU,
-    0x0ACCU,
-    0x093DU,
-    0x0561U,
-    0x05E2U,
-    0xFB20U,
-    0x05E2U,
-    0x09ACU,
-    0xFF3CU,
-    0x092CU,
-    0x0AACU,
-    0x0A2CU,
-    0x3070U,
-    0x0E3FU,
-    0x30D0U,
-    0xFF5CU,
-    0x3105U,
-    0x24D1U,
-    0x1E03U,
-    0x1E05U,
-    0x266CU,
-    0x2235U,
-    0x0431U,
-    0x0628U,
-    0xFE90U,
-    0xFE91U,
-    0x3079U,
-    0xFE92U,
-    0xFC9FU,
-    0xFC08U,
-    0xFC6DU,
-    0x30D9U,
-    0x0562U,
-    0x05D1U,
-    0x03B2U,
-    0x03D0U,
-    0xFB31U,
-    0xFB31U,
-    0x05D1U,
-    0xFB4CU,
-    0x09ADU,
-    0x092DU,
-    0x0AADU,
-    0x0A2DU,
-    0x0253U,
-    0x3073U,
-    0x30D3U,
-    0x0298U,
-    0x0A02U,
-    0x3331U,
-    0x25CFU,
-    0x25C6U,
-    0x25BCU,
-    0x25C4U,
-    0x25C0U,
-    0x3010U,
-    0xFE3BU,
-    0x3011U,
-    0xFE3CU,
-    0x25E3U,
-    0x25E2U,
-    0x25ACU,
-    0x25BAU,
-    0x25B6U,
-    0x25AAU,
-    0x263BU,
-    0x25A0U,
-    0x2605U,
-    0x25E4U,
-    0x25E5U,
-    0x25B4U,
-    0x25B2U,
-    0x2423U,
-    0x1E07U,
-    0x2588U,
-    0xFF42U,
-    0x0E1AU,
-    0x307CU,
-    0x30DCU,
-    0x249DU,
-    0x33C3U,
-    0xF8F4U,
-    0xF8F3U,
-    0xF8F2U,
-    0xFF5BU,
-    0xFE5BU,
-    0xF8F1U,
-    0xFE37U,
-    0xF8FEU,
-    0xF8FDU,
-    0xFF5DU,
-    0xFE5CU,
-    0xF8FCU,
-    0xFE38U,
-    0xF8F0U,
-    0xF8EFU,
-    0xFF3BU,
-    0xF8EEU,
-    0xF8FBU,
-    0xF8FAU,
-    0xFF3DU,
-    0xF8F9U,
-    0x032EU,
-    0x0306U,
-    0x032FU,
-    0x0311U,
-    0x0361U,
-    0x032AU,
-    0x033AU,
-    0x0180U,
-    0x0183U,
-    0x3076U,
-    0x30D6U,
-    0x25D8U,
-    0x2219U,
-    0x25CEU,
-    0x056EU,
-    0x099AU,
-    0x0107U,
-    0x091AU,
-    0x0A9AU,
-    0x0A1AU,
-    0x3388U,
-    0x0981U,
-    0x0310U,
-    0x0901U,
-    0x0A81U,
-    0x21EAU,
-    0x2105U,
-    0x032CU,
-    0x030CU,
-    0x21B5U,
-    0x3118U,
-    0x010DU,
-    0x1E09U,
-    0x24D2U,
-    0x0109U,
-    0x0255U,
-    0x010BU,
-    0x010BU,
-    0x33C5U,
-    0x0327U,
-    0x2103U,
-    0xFFE0U,
-    0x0579U,
-    0x099BU,
-    0x091BU,
-    0x0A9BU,
-    0x0A1BU,
-    0x3114U,
-    0x04BDU,
-    0x2713U,
-    0x0447U,
-    0x04BFU,
-    0x04B7U,
-    0x04F5U,
-    0x0573U,
-    0x04CCU,
-    0x04B9U,
-    0x03C7U,
-    0x3277U,
-    0x3217U,
-    0x3269U,
-    0x314AU,
-    0x3209U,
-    0x0E0AU,
-    0x0E08U,
-    0x0E09U,
-    0x0E0CU,
-    0x0188U,
-    0x3276U,
-    0x3216U,
-    0x3268U,
-    0x3148U,
-    0x3208U,
-    0x321CU,
-    0x25CBU,
-    0x2297U,
-    0x2299U,
-    0x2295U,
-    0x3036U,
-    0x25D0U,
-    0x25D1U,
-    0x032DU,
-    0x0302U,
-    0x2327U,
-    0x01C2U,
-    0x01C0U,
-    0x01C1U,
-    0x01C3U,
-    0x2663U,
-    0x2663U,
-    0x2667U,
-    0x33A4U,
-    0xFF43U,
-    0x33A0U,
-    0x0581U,
-    0xFF1AU,
-    0x20A1U,
-    0xFE55U,
-    0x02D1U,
-    0x02D0U,
-    0x0313U,
-    0x0315U,
-    0xF6C3U,
-    0x060CU,
-    0x055DU,
-    0xFF0CU,
-    0x0314U,
-    0x02BDU,
-    0xFE50U,
-    0x0312U,
-    0x02BBU,
-    0x263CU,
-    0x2245U,
-    0x222EU,
-    0x2303U,
-    0x0006U,
-    0x0007U,
-    0x0008U,
-    0x0018U,
-    0x000DU,
-    0x0011U,
-    0x0012U,
-    0x0013U,
-    0x0014U,
-    0x007FU,
-    0x0010U,
-    0x0019U,
-    0x0005U,
-    0x0004U,
-    0x001BU,
-    0x0017U,
-    0x0003U,
-    0x000CU,
-    0x001CU,
-    0x001DU,
-    0x0009U,
-    0x000AU,
-    0x0015U,
-    0x001EU,
-    0x000FU,
-    0x000EU,
-    0x0002U,
-    0x0001U,
-    0x001AU,
-    0x0016U,
-    0x001FU,
-    0x000BU,
-    0xF8E9U,
-    0xF6D9U,
-    0x300CU,
-    0xFF62U,
-    0xFE41U,
-    0x300DU,
-    0xFF63U,
-    0xFE42U,
-    0x337FU,
-    0x33C7U,
-    0x33C6U,
-    0x249EU,
-    0x20A2U,
-    0x0297U,
-    0x22CFU,
-    0x22CEU,
-    0xF6D1U,
-    0xF6D2U,
-    0xF6D4U,
-    0xF6D5U,
-    0x0564U,
-    0x09A6U,
-    0x0636U,
-    0x0926U,
-    0xFEBEU,
-    0xFEBFU,
-    0xFEC0U,
-    0x05BCU,
-    0x05BCU,
-    0x0AA6U,
-    0x0A26U,
-    0x3060U,
-    0x30C0U,
-    0x062FU,
-    0x05D3U,
-    0xFB33U,
-    0xFB33U,
-    0,
-    0,
-    0,
-    0,
-    0x05D3U,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0xFEAAU,
-    0x064FU,
-    0x064FU,
-    0x064CU,
-    0x064CU,
-    0x0964U,
-    0x05A7U,
-    0x05A7U,
-    0x0485U,
-    0xF6D3U,
-    0x300AU,
-    0xFE3DU,
-    0x300BU,
-    0xFE3EU,
-    0x032BU,
-    0x21D4U,
-    0x21D2U,
-    0x0965U,
-    0xF6D6U,
-    0x030FU,
-    0x222CU,
-    0x2017U,
-    0x0333U,
-    0x033FU,
-    0x02BAU,
-    0x2016U,
-    0x030EU,
-    0x3109U,
-    0x33C8U,
-    0x010FU,
-    0x1E11U,
-    0x24D3U,
-    0x1E13U,
-    0x0111U,
-    0x09A1U,
-    0x0921U,
-    0x0AA1U,
-    0x0A21U,
-    0x0688U,
-    0xFB89U,
-    0x095CU,
-    0x09A2U,
-    0x0922U,
-    0x0AA2U,
-    0x0A22U,
-    0x1E0BU,
-    0x1E0DU,
-    0x066BU,
-    0x066BU,
-    0x0434U,
-    0x05ADU,
-    0x3067U,
-    0x03EFU,
-    0x30C7U,
-    0x232BU,
-    0x2326U,
-    0x03B4U,
-    0x018DU,
-    0x09F8U,
-    0x02A4U,
-    0x09A7U,
-    0x0927U,
-    0x0AA7U,
-    0x0A27U,
-    0x0257U,
-    0x0385U,
-    0x0344U,
-    0x2666U,
-    0x2662U,
-    0xF6D7U,
-    0x0324U,
-    0x0308U,
-    0xF6D8U,
-    0x0385U,
-    0x3062U,
-    0x30C2U,
-    0x3003U,
-    0x2223U,
-    0x2215U,
-    0x0452U,
-    0x2593U,
-    0x1E0FU,
-    0x3397U,
-    0x0111U,
-    0xFF44U,
-    0x2584U,
-    0x0E0EU,
-    0x0E14U,
-    0x3069U,
-    0x30C9U,
-    0xFF04U,
-    0xFE69U,
-    0x20ABU,
-    0x3326U,
-    0x0307U,
-    0x0323U,
-    0x0323U,
-    0x30FBU,
-    0xF6BEU,
-    0x0284U,
-    0x22C5U,
-    0x25CCU,
-    0xFB1FU,
-    0xFB1FU,
-    0x031EU,
-    0x02D5U,
-    0x249FU,
-    0x0256U,
-    0x018CU,
-    0x3065U,
-    0x30C5U,
-    0x01F3U,
-    0x02A3U,
-    0x01C6U,
-    0x02A5U,
-    0x04E1U,
-    0x0455U,
-    0x045FU,
-    0x2641U,
-    0x098FU,
-    0x311CU,
-    0x0115U,
-    0x090DU,
-    0x0A8DU,
-    0x0945U,
-    0x0AC5U,
-    0x011BU,
-    0x1E1DU,
-    0x0565U,
-    0x0587U,
-    0x24D4U,
-    0x1EBFU,
-    0x1E19U,
-    0x1EC7U,
-    0x1EC1U,
-    0x1EC3U,
-    0x1EC5U,
-    0x0454U,
-    0x0205U,
-    0x090FU,
-    0x0117U,
-    0x0117U,
-    0x1EB9U,
-    0x0A0FU,
-    0x0A47U,
-    0x0444U,
-    0x0A8FU,
-    0x0567U,
-    0x311DU,
-    0x3048U,
-    0x1EBBU,
-    0x311FU,
-    0x0668U,
-    0x09EEU,
-    0x2467U,
-    0x2791U,
-    0x096EU,
-    0x2471U,
-    0x2485U,
-    0x2499U,
-    0x0AEEU,
-    0x0A6EU,
-    0x0668U,
-    0x3028U,
-    0x266BU,
-    0x3227U,
-    0xFF18U,
-    0x247BU,
-    0x248FU,
-    0x06F8U,
-    0x2177U,
-    0x0E58U,
-    0x0207U,
-    0x0465U,
-    0x30A8U,
-    0xFF74U,
-    0x0A74U,
-    0x3154U,
-    0x043BU,
-    0x2208U,
-    0x246AU,
-    0x247EU,
-    0x2492U,
-    0x217AU,
-    0x22EEU,
-    0x0113U,
-    0x1E17U,
-    0x1E15U,
-    0x043CU,
-    0xFE31U,
-    0xFF45U,
-    0x055BU,
-    0x2205U,
-    0x3123U,
-    0x043DU,
-    0xFE32U,
-    0x04A3U,
-    0x014BU,
-    0x3125U,
-    0x04A5U,
-    0x04C8U,
-    0x2002U,
-    0x0119U,
-    0x3153U,
-    0x025BU,
-    0x029AU,
-    0x025CU,
-    0x025EU,
-    0x025DU,
-    0x24A0U,
-    0x03B5U,
-    0x03ADU,
-    0xFF1DU,
-    0xFE66U,
-    0x207CU,
-    0x2261U,
-    0x3126U,
-    0x0440U,
-    0x0258U,
-    0x044DU,
-    0x0441U,
-    0x04ABU,
-    0x0283U,
-    0x0286U,
-    0x090EU,
-    0x0946U,
-    0x01AAU,
-    0x0285U,
-    0x3047U,
-    0x30A7U,
-    0xFF6AU,
-    0x212EU,
-    0x03B7U,
-    0x0568U,
-    0x03AEU,
-    0x1EBDU,
-    0x1E1BU,
-    0x0591U,
-    0x0591U,
-    0x0591U,
-    0x0591U,
-    0x01DDU,
-    0x3161U,
-    0x20ACU,
-    0x09C7U,
-    0x0947U,
-    0x0AC7U,
-    0x055CU,
-    0x203CU,
-    0xFF01U,
-    0x2203U,
-    0x0292U,
-    0x01EFU,
-    0x0293U,
-    0x01B9U,
-    0x01BAU,
-    0x095EU,
-    0x0A5EU,
-    0x2109U,
-    0x064EU,
-    0x064EU,
-    0x064BU,
-    0x3108U,
-    0x24D5U,
-    0x1E1FU,
-    0x0641U,
-    0x0586U,
-    0xFED2U,
-    0xFED3U,
-    0xFED4U,
-    0x03E5U,
-    0x2640U,
-    0x246EU,
-    0x2482U,
-    0x2496U,
-    0x25A0U,
-    0x25ACU,
-    0x05DAU,
-    0xFB3AU,
-    0xFB3AU,
-    0x05DAU,
-    0,
-    0,
-    0,
-    0,
-    0x05DDU,
-    0x05DDU,
-    0x05DFU,
-    0x05DFU,
-    0x05E3U,
-    0x05E3U,
-    0x05E5U,
-    0x05E5U,
-    0x02C9U,
-    0x25C9U,
-    0x0473U,
-    0x0665U,
-    0x09EBU,
-    0x2464U,
-    0x278EU,
-    0x096BU,
-    0x0AEBU,
-    0x0A6BU,
-    0x0665U,
-    0x3025U,
-    0x3224U,
-    0xFF15U,
-    0x2478U,
-    0x248CU,
-    0x06F5U,
-    0x2174U,
-    0x0E55U,
-    0xFF46U,
-    0x3399U,
-    0x0E1FU,
-    0x0E1DU,
-    0x0E4FU,
-    0x2200U,
-    0x0664U,
-    0x09EAU,
-    0x2463U,
-    0x278DU,
-    0x096AU,
-    0x0AEAU,
-    0x0A6AU,
-    0x0664U,
-    0x3024U,
-    0x3223U,
-    0xFF14U,
-    0x09F7U,
-    0x2477U,
-    0x248BU,
-    0x06F4U,
-    0x2173U,
-    0x246DU,
-    0x2481U,
-    0x2495U,
-    0x0E54U,
-    0x02CBU,
-    0x24A1U,
-    0x20A3U,
-    0x0997U,
-    0x01F5U,
-    0x0917U,
-    0x06AFU,
-    0xFB93U,
-    0xFB94U,
-    0xFB95U,
-    0x0A97U,
-    0x0A17U,
-    0x304CU,
-    0x30ACU,
-    0x03B3U,
-    0x0263U,
-    0x02E0U,
-    0x03EBU,
-    0x310DU,
-    0x011FU,
-    0x01E7U,
-    0x0123U,
-    0x24D6U,
-    0x011DU,
-    0x0123U,
-    0x0121U,
-    0x0121U,
-    0x0433U,
-    0x3052U,
-    0x30B2U,
-    0x2251U,
-    0x059CU,
-    0x05F3U,
-    0x059DU,
-    0x059EU,
-    0x05F4U,
-    0x3013U,
-    0x0998U,
-    0x0572U,
-    0x0918U,
-    0x0A98U,
-    0x0A18U,
-    0x063AU,
-    0xFECEU,
-    0xFECFU,
-    0xFED0U,
-    0x0495U,
-    0x0493U,
-    0x0491U,
-    0x095AU,
-    0x0A5AU,
-    0x0260U,
-    0x3393U,
-    0x304EU,
-    0x30AEU,
-    0x0563U,
-    0x05D2U,
-    0xFB32U,
-    0xFB32U,
-    0x05D2U,
-    0x0453U,
-    0x01BEU,
-    0x0294U,
-    0x0296U,
-    0x02C0U,
-    0x0295U,
-    0x02C1U,
-    0x02E4U,
-    0x02A1U,
-    0x02A2U,
-    0x1E21U,
-    0xFF47U,
-    0x3054U,
-    0x30B4U,
-    0x24A2U,
-    0x33ACU,
-    0x2207U,
-    0x0316U,
-    0x0300U,
-    0x0300U,
-    0x0953U,
-    0x02CEU,
-    0xFF40U,
-    0x0340U,
-    0x2265U,
-    0x22DBU,
-    0xFF1EU,
-    0x2273U,
-    0x2277U,
-    0x2267U,
-    0xFE65U,
-    0x0261U,
-    0x01E5U,
-    0x3050U,
-    0x30B0U,
-    0x3318U,
-    0x33C9U,
-    0x04A9U,
-    0x06C1U,
-    0x09B9U,
-    0x04B3U,
-    0x0939U,
-    0x0AB9U,
-    0x0A39U,
-    0x062DU,
-    0xFEA2U,
-    0xFEA3U,
-    0x306FU,
-    0xFEA4U,
-    0x332AU,
-    0x30CFU,
-    0xFF8AU,
-    0x0A4DU,
-    0x0621U,
-    0,
-    0,
-    0,
-    0,
-    0x0621U,
-    0,
-    0,
-    0,
-    0x3164U,
-    0x044AU,
-    0x21BCU,
-    0x21C0U,
-    0x33CAU,
-    0x05B2U,
-    0x05B2U,
-    0x05B2U,
-    0x05B2U,
-    0x05B2U,
-    0x05B2U,
-    0x05B2U,
-    0x05B2U,
-    0x05B3U,
-    0x05B3U,
-    0x05B3U,
-    0x05B3U,
-    0x05B3U,
-    0x05B3U,
-    0x05B3U,
-    0x05B3U,
-    0x05B1U,
-    0x05B1U,
-    0x05B1U,
-    0x05B1U,
-    0x05B1U,
-    0x05B1U,
-    0x05B1U,
-    0x05B1U,
-    0x0127U,
-    0x310FU,
-    0x1E2BU,
-    0x1E29U,
-    0x24D7U,
-    0x0125U,
-    0x1E27U,
-    0x1E23U,
-    0x1E25U,
-    0x05D4U,
-    0x2665U,
-    0x2665U,
-    0x2661U,
-    0xFB34U,
-    0xFB34U,
-    0x06C1U,
-    0x0647U,
-    0x05D4U,
-    0xFBA7U,
-    0xFEEAU,
-    0xFEEAU,
-    0xFBA5U,
-    0xFBA4U,
-    0xFBA8U,
-    0xFEEBU,
-    0x3078U,
-    0xFBA9U,
-    0xFEECU,
-    0x337BU,
-    0x30D8U,
-    0xFF8DU,
-    0x3336U,
-    0x0267U,
-    0x3339U,
-    0x05D7U,
-    0x05D7U,
-    0x0266U,
-    0x02B1U,
-    0x327BU,
-    0x321BU,
-    0x326DU,
-    0x314EU,
-    0x320DU,
-    0x3072U,
-    0x30D2U,
-    0xFF8BU,
-    0x05B4U,
-    0x05B4U,
-    0x05B4U,
-    0x05B4U,
-    0x05B4U,
-    0x05B4U,
-    0x05B4U,
-    0x05B4U,
-    0x1E96U,
-    0xFF48U,
-    0x0570U,
-    0x0E2BU,
-    0x307BU,
-    0x30DBU,
-    0xFF8EU,
-    0x05B9U,
-    0x05B9U,
-    0x05B9U,
-    0x05B9U,
-    0x05B9U,
-    0x05B9U,
-    0x05B9U,
-    0x05B9U,
-    0x0E2EU,
-    0x0309U,
-    0x0309U,
-    0x0321U,
-    0x0322U,
-    0x3342U,
-    0x03E9U,
-    0x2015U,
-    0x031BU,
-    0x2668U,
-    0x2302U,
-    0x24A3U,
-    0x02B0U,
-    0x0265U,
-    0x3075U,
-    0x3333U,
-    0x30D5U,
-    0xFF8CU,
-    0x030BU,
-    0x0195U,
-    0xFF0DU,
-    0xFE63U,
-    0x2010U,
-    0x044FU,
-    0x0987U,
-    0x3127U,
-    0x012DU,
-    0x01D0U,
-    0x24D8U,
-    0x0456U,
-    0x0209U,
-    0x328FU,
-    0x328BU,
-    0x323FU,
-    0x323AU,
-    0x32A5U,
-    0x3006U,
-    0x3001U,
-    0xFF64U,
-    0x3237U,
-    0x32A3U,
-    0x322FU,
-    0x323DU,
-    0x329DU,
-    0x3240U,
-    0x3296U,
-    0x3236U,
-    0x322BU,
-    0x3232U,
-    0x32A4U,
-    0x3005U,
-    0x3298U,
-    0x3238U,
-    0x32A7U,
-    0x32A6U,
-    0x32A9U,
-    0x322EU,
-    0x322AU,
-    0x3234U,
-    0x3002U,
-    0x329EU,
-    0x3243U,
-    0x3239U,
-    0x323EU,
-    0x32A8U,
-    0x3299U,
-    0x3242U,
-    0x3233U,
-    0x3000U,
-    0x3235U,
-    0x3231U,
-    0x323BU,
-    0x3230U,
-    0x323CU,
-    0x322CU,
-    0x322DU,
-    0x3007U,
-    0x328EU,
-    0x328AU,
-    0x3294U,
-    0x3290U,
-    0x328CU,
-    0x328DU,
-    0x0907U,
-    0x1E2FU,
-    0x04E5U,
-    0x1ECBU,
-    0x04D7U,
-    0x0435U,
-    0x3275U,
-    0x3215U,
-    0x3267U,
-    0x3147U,
-    0x3207U,
-    0x0A87U,
-    0x0A07U,
-    0x3044U,
-    0x1EC9U,
-    0x0988U,
-    0x0438U,
-    0x0908U,
-    0x0A88U,
-    0x0A08U,
-    0x0A40U,
-    0x020BU,
-    0x0439U,
-    0x09C0U,
-    0x0940U,
-    0x0AC0U,
-    0x0133U,
-    0x30A4U,
-    0xFF72U,
-    0x3163U,
-    0x02DCU,
-    0x05ACU,
-    0x012BU,
-    0x04E3U,
-    0x2253U,
-    0x0A3FU,
-    0xFF49U,
-    0x2206U,
-    0x221EU,
-    0x056BU,
-    0x222BU,
-    0x2321U,
-    0x2321U,
-    0xF8F5U,
-    0x2320U,
-    0x2320U,
-    0x2229U,
-    0x3305U,
-    0x25D8U,
-    0x25D9U,
-    0x263BU,
-    0x0451U,
-    0x012FU,
-    0x03B9U,
-    0x03CAU,
-    0x0390U,
-    0x0269U,
-    0x03AFU,
-    0x24A4U,
-    0x0A72U,
-    0x3043U,
-    0x30A3U,
-    0xFF68U,
-    0x09FAU,
-    0x0268U,
-    0x309DU,
-    0x30FDU,
-    0x0129U,
-    0x1E2DU,
-    0x3129U,
-    0x044EU,
-    0x09BFU,
-    0x093FU,
-    0x0ABFU,
-    0x0475U,
-    0x0477U,
-    0x0571U,
-    0x099CU,
-    0x091CU,
-    0x0A9CU,
-    0x0A1CU,
-    0x3110U,
-    0x01F0U,
-    0x24D9U,
-    0x0135U,
-    0x029DU,
-    0x025FU,
-    0x0458U,
-    0x062CU,
-    0xFE9EU,
-    0xFE9FU,
-    0xFEA0U,
-    0x0698U,
-    0xFB8BU,
-    0x099DU,
-    0x091DU,
-    0x0A9DU,
-    0x0A1DU,
-    0x057BU,
-    0x3004U,
-    0xFF4AU,
-    0x24A5U,
-    0x02B2U,
-    0x04A1U,
-    0x0995U,
-    0x1E31U,
-    0x043AU,
-    0x049BU,
-    0x0915U,
-    0x05DBU,
-    0x0643U,
-    0xFB3BU,
-    0xFB3BU,
-    0xFEDAU,
-    0x05DBU,
-    0xFEDBU,
-    0xFEDCU,
-    0xFB4DU,
-    0x0A95U,
-    0x0A15U,
-    0x304BU,
-    0x04C4U,
-    0x30ABU,
-    0xFF76U,
-    0x03BAU,
-    0x03F0U,
-    0x3171U,
-    0x3184U,
-    0x3178U,
-    0x3179U,
-    0x330DU,
-    0x0640U,
-    0x0640U,
-    0x30F5U,
-    0x3384U,
-    0x0650U,
-    0x064DU,
-    0x049FU,
-    0xFF70U,
-    0x049DU,
-    0x310EU,
-    0x3389U,
-    0x01E9U,
-    0x0137U,
-    0x24DAU,
-    0x0137U,
-    0x1E33U,
-    0x0584U,
-    0x3051U,
-    0x30B1U,
-    0xFF79U,
-    0x056FU,
-    0x30F6U,
-    0x0138U,
-    0x0996U,
-    0x0445U,
-    0x0916U,
-    0x0A96U,
-    0x0A16U,
-    0x062EU,
-    0xFEA6U,
-    0xFEA7U,
-    0xFEA8U,
-    0x03E7U,
-    0x0959U,
-    0x0A59U,
-    0x3278U,
-    0x3218U,
-    0x326AU,
-    0x314BU,
-    0x320AU,
-    0x0E02U,
-    0x0E05U,
-    0x0E03U,
-    0x0E04U,
-    0x0E5BU,
-    0x0199U,
-    0x0E06U,
-    0x3391U,
-    0x304DU,
-    0x30ADU,
-    0xFF77U,
-    0x3315U,
-    0x3316U,
-    0x3314U,
-    0x326EU,
-    0x320EU,
-    0x3260U,
-    0x3131U,
-    0x3200U,
-    0x3133U,
-    0x045CU,
-    0x1E35U,
-    0x3398U,
-    0x33A6U,
-    0xFF4BU,
-    0x33A2U,
-    0x3053U,
-    0x33C0U,
-    0x0E01U,
-    0x30B3U,
-    0xFF7AU,
-    0x331EU,
-    0x0481U,
-    0x327FU,
-    0x0343U,
-    0x24A6U,
-    0x33AAU,
-    0x046FU,
-    0x33CFU,
-    0x029EU,
-    0x304FU,
-    0x30AFU,
-    0xFF78U,
-    0x33B8U,
-    0x33BEU,
-    0x09B2U,
-    0x013AU,
-    0x0932U,
-    0x0AB2U,
-    0x0A32U,
-    0x0E45U,
-    0xFEFCU,
-    0xFEF8U,
-    0xFEF7U,
-    0xFEFAU,
-    0xFEF9U,
-    0xFEFBU,
-    0xFEF6U,
-    0xFEF5U,
-    0x0644U,
-    0x03BBU,
-    0x019BU,
-    0x05DCU,
-    0xFB3CU,
-    0xFB3CU,
-    0x05DCU,
-    0,
-    0,
-    0,
-    0,
-    0xFEDEU,
-    0xFCCAU,
-    0xFEDFU,
-    0xFCC9U,
-    0xFCCBU,
-    0xFDF2U,
-    0xFEE0U,
-    0xFD88U,
-    0xFCCCU,
-    0,
-    0,
-    0x25EFU,
-    0x019AU,
-    0x026CU,
-    0x310CU,
-    0x013EU,
-    0x013CU,
-    0x24DBU,
-    0x1E3DU,
-    0x013CU,
-    0x0140U,
-    0x0140U,
-    0x1E37U,
-    0x1E39U,
-    0x031AU,
-    0x0318U,
-    0x2264U,
-    0x22DAU,
-    0xFF1CU,
-    0x2272U,
-    0x2276U,
-    0x2266U,
-    0xFE64U,
-    0x026EU,
-    0x258CU,
-    0x026DU,
-    0x20A4U,
-    0x056CU,
-    0x01C9U,
-    0x0459U,
-    0xF6C0U,
-    0x0933U,
-    0x0AB3U,
-    0x1E3BU,
-    0x0934U,
-    0x09E1U,
-    0x0961U,
-    0x09E3U,
-    0x0963U,
-    0x026BU,
-    0xFF4CU,
-    0x33D0U,
-    0x0E2CU,
-    0x2227U,
-    0x2310U,
-    0x2228U,
-    0x0E25U,
-    0x017FU,
-    0xFE4EU,
-    0x0332U,
-    0xFE4DU,
-    0x25CAU,
-    0x24A7U,
-    0x2113U,
-    0x2591U,
-    0x0E26U,
-    0x098CU,
-    0x090CU,
-    0x09E2U,
-    0x0962U,
-    0x33D3U,
-    0x09AEU,
-    0x0331U,
-    0x0304U,
-    0x02CDU,
-    0xFFE3U,
-    0x1E3FU,
-    0x092EU,
-    0x0AAEU,
-    0x0A2EU,
-    0x05A4U,
-    0x05A4U,
-    0x307EU,
-    0xF895U,
-    0xF894U,
-    0x0E4BU,
-    0xF893U,
-    0xF88CU,
-    0xF88BU,
-    0x0E48U,
-    0xF88AU,
-    0xF884U,
-    0x0E31U,
-    0xF889U,
-    0x0E47U,
-    0xF88FU,
-    0xF88EU,
-    0x0E49U,
-    0xF88DU,
-    0xF892U,
-    0xF891U,
-    0x0E4AU,
-    0xF890U,
-    0x0E46U,
-    0x30DEU,
-    0xFF8FU,
-    0x2642U,
-    0x3347U,
-    0x05BEU,
-    0x2642U,
-    0x05AFU,
-    0x3383U,
-    0x3107U,
-    0x33D4U,
-    0x24DCU,
-    0x33A5U,
-    0x1E41U,
-    0x1E43U,
-    0x0645U,
-    0xFEE2U,
-    0xFEE3U,
-    0xFEE4U,
-    0xFCD1U,
-    0xFC48U,
-    0x334DU,
-    0x3081U,
-    0x337EU,
-    0x30E1U,
-    0xFF92U,
-    0x05DEU,
-    0xFB3EU,
-    0xFB3EU,
-    0x05DEU,
-    0x0574U,
-    0x05A5U,
-    0x05A6U,
-    0x05A6U,
-    0x05A5U,
-    0x0271U,
-    0x3392U,
-    0xFF65U,
-    0x00B7U,
-    0x3272U,
-    0x3212U,
-    0x3264U,
-    0x3141U,
-    0x3170U,
-    0x3204U,
-    0x316EU,
-    0x316FU,
-    0x307FU,
-    0x30DFU,
-    0xFF90U,
-    0x0320U,
-    0x2296U,
-    0x02D7U,
-    0x2213U,
-    0x2032U,
-    0x334AU,
-    0x3349U,
-    0x0270U,
-    0x3396U,
-    0x33A3U,
-    0xFF4DU,
-    0x339FU,
-    0x3082U,
-    0x33C1U,
-    0x30E2U,
-    0xFF93U,
-    0x33D6U,
-    0x0E21U,
-    0x33A7U,
-    0x33A8U,
-    0x24A8U,
-    0x33ABU,
-    0x33B3U,
-    0x026FU,
-    0x00B5U,
-    0x3382U,
-    0x226BU,
-    0x226AU,
-    0x338CU,
-    0x03BCU,
-    0x338DU,
-    0x3080U,
-    0x30E0U,
-    0xFF91U,
-    0x3395U,
-    0x339BU,
-    0x05A3U,
-    0x05A3U,
-    0x266AU,
-    0x266BU,
-    0x266DU,
-    0x266FU,
-    0x33B2U,
-    0x33B6U,
-    0x33BCU,
-    0x33B9U,
-    0x33B7U,
-    0x33BFU,
-    0x33BDU,
-    0x09A8U,
-    0x2207U,
-    0x0144U,
-    0x0928U,
-    0x0AA8U,
-    0x0A28U,
-    0x306AU,
-    0x30CAU,
-    0xFF85U,
-    0x0149U,
-    0x3381U,
-    0x310BU,
-    0x00A0U,
-    0x0148U,
-    0x0146U,
-    0x24DDU,
-    0x1E4BU,
-    0x0146U,
-    0x1E45U,
-    0x1E47U,
-    0x306DU,
-    0x30CDU,
-    0xFF88U,
-    0x20AAU,
-    0x338BU,
-    0x0999U,
-    0x0919U,
-    0x0A99U,
-    0x0A19U,
-    0x0E07U,
-    0x3093U,
-    0x0272U,
-    0x0273U,
-    0x326FU,
-    0x320FU,
-    0x3135U,
-    0x3261U,
-    0x3136U,
-    0x3134U,
-    0x3168U,
-    0x3201U,
-    0x3167U,
-    0x3166U,
-    0x306BU,
-    0x30CBU,
-    0xFF86U,
-    0xF899U,
-    0x0E4DU,
-    0x0669U,
-    0x09EFU,
-    0x2468U,
-    0x2792U,
-    0x096FU,
-    0x0AEFU,
-    0x0A6FU,
-    0x0669U,
-    0x3029U,
-    0x3228U,
-    0xFF19U,
-    0x247CU,
-    0x2490U,
-    0x06F9U,
-    0x2178U,
-    0x2472U,
-    0x2486U,
-    0x249AU,
-    0x0E59U,
-    0x01CCU,
-    0x045AU,
-    0x30F3U,
-    0xFF9DU,
-    0x019EU,
-    0x1E49U,
-    0xFF4EU,
-    0x339AU,
-    0x09A3U,
-    0x0923U,
-    0x0AA3U,
-    0x0A23U,
-    0x0929U,
-    0x306EU,
-    0x30CEU,
-    0xFF89U,
-    0x00A0U,
-    0x0E13U,
-    0x0E19U,
-    0x0646U,
-    0xFEE6U,
-    0x06BAU,
-    0xFB9FU,
-    0,
-    0xFEE7U,
-    0xFCD2U,
-    0xFC4BU,
-    0xFEE8U,
-    0xFCD5U,
-    0xFC4EU,
-    0xFC8DU,
-    0x220CU,
-    0x2209U,
-    0x2209U,
-    0x2260U,
-    0x226FU,
-    0x2271U,
-    0x2279U,
-    0x2262U,
-    0x226EU,
-    0x2270U,
-    0x2226U,
-    0x2280U,
-    0x2284U,
-    0x2281U,
-    0x2285U,
-    0x0576U,
-    0x24A9U,
-    0x33B1U,
-    0x03BDU,
-    0x306CU,
-    0x30CCU,
-    0xFF87U,
-    0x09BCU,
-    0x093CU,
-    0x0ABCU,
-    0x0A3CU,
-    0xFF03U,
-    0xFE5FU,
-    0x0374U,
-    0x0375U,
-    0x2116U,
-    0x05E0U,
-    0xFB40U,
-    0xFB40U,
-    0x05E0U,
-    0x33B5U,
-    0x33BBU,
-    0x099EU,
-    0x091EU,
-    0x0A9EU,
-    0x0A1EU,
-    0x0E2DU,
-    0x0275U,
-    0x04E9U,
-    0x04EBU,
-    0x0993U,
-    0x311BU,
-    0x014FU,
-    0x0911U,
-    0x0A91U,
-    0x0949U,
-    0x0AC9U,
-    0x01D2U,
-    0x24DEU,
-    0x1ED1U,
-    0x1ED9U,
-    0x1ED3U,
-    0x1ED5U,
-    0x1ED7U,
-    0x043EU,
-    0x0151U,
-    0x020DU,
-    0x0913U,
-    0x04E7U,
-    0x1ECDU,
-    0x315AU,
-    0x0328U,
-    0x0A93U,
-    0x0585U,
-    0x304AU,
-    0x1ECFU,
-    0x01A1U,
-    0x1EDBU,
-    0x1EE3U,
-    0x1EDDU,
-    0x1EDFU,
-    0x1EE1U,
-    0x0151U,
-    0x01A3U,
-    0x020FU,
-    0x30AAU,
-    0xFF75U,
-    0x3157U,
-    0x05ABU,
-    0x014DU,
-    0x1E53U,
-    0x1E51U,
-    0x0950U,
-    0x03C9U,
-    0x03D6U,
-    0x0461U,
-    0x0277U,
-    0x047BU,
-    0x047DU,
-    0x03CEU,
-    0x0AD0U,
-    0x03BFU,
-    0x03CCU,
-    0xFF4FU,
-    0x0661U,
-    0x09E7U,
-    0x2460U,
-    0x278AU,
-    0x0967U,
-    0x0AE7U,
-    0x0A67U,
-    0x0661U,
-    0x3021U,
-    0x3220U,
-    0xFF11U,
-    0x09F4U,
-    0x2474U,
-    0x2488U,
-    0x06F1U,
-    0x2170U,
-    0x0E51U,
-    0x01EBU,
-    0x01EDU,
-    0x0A13U,
-    0x0A4BU,
-    0x0254U,
-    0x24AAU,
-    0x25E6U,
-    0x2325U,
-    0x221FU,
-    0x0912U,
-    0x094AU,
-    0x01FFU,
-    0x3049U,
-    0x30A9U,
-    0xFF6BU,
-    0x01FFU,
-    0x047FU,
-    0x1E4DU,
-    0x1E4FU,
-    0x3121U,
-    0x203EU,
-    0xFE4AU,
-    0x0305U,
-    0xFE49U,
-    0xFE4CU,
-    0xFE4BU,
-    0x00AFU,
-    0x09CBU,
-    0x094BU,
-    0x0ACBU,
-    0x3380U,
-    0x332BU,
-    0x09AAU,
-    0x1E55U,
-    0x092AU,
-    0x21DFU,
-    0x21DEU,
-    0x0AAAU,
-    0x0A2AU,
-    0x3071U,
-    0x0E2FU,
-    0x30D1U,
-    0x0484U,
-    0x04C0U,
-    0x317FU,
-    0x2225U,
-    0xFD3EU,
-    0xF8EDU,
-    0xF8ECU,
-    0xFF08U,
-    0xFE59U,
-    0xF8EBU,
-    0xFE35U,
-    0xFD3FU,
-    0xF8F8U,
-    0xF8F7U,
-    0xFF09U,
-    0xFE5AU,
-    0xF8F6U,
-    0xFE36U,
-    0x2202U,
-    0x05C0U,
-    0x0599U,
-    0x33A9U,
-    0x05B7U,
-    0x05B7U,
-    0x05B7U,
-    0x05B7U,
-    0x05B7U,
-    0x05B7U,
-    0x05B7U,
-    0x05B7U,
-    0x05A1U,
-    0x3106U,
-    0x24DFU,
-    0x1E57U,
-    0x05E4U,
-    0x043FU,
-    0xFB44U,
-    0xFB44U,
-    0x333BU,
-    0xFB43U,
-    0x067EU,
-    0x057AU,
-    0x05E4U,
-    0xFB57U,
-    0xFB58U,
-    0x307AU,
-    0xFB59U,
-    0x30DAU,
-    0x04A7U,
-    0xFB4EU,
-    0x066AU,
-    0xFF05U,
-    0xFE6AU,
-    0x0589U,
-    0xFF61U,
-    0xFF0EU,
-    0xFE52U,
-    0x0342U,
-    0x22A5U,
-    0x20A7U,
-    0x338AU,
-    0x09ABU,
-    0x092BU,
-    0x0AABU,
-    0x0A2BU,
-    0x03C6U,
-    0x03D5U,
-    0x327AU,
-    0x321AU,
-    0x326CU,
-    0x314DU,
-    0x320CU,
-    0x0278U,
-    0x0E3AU,
-    0x03D5U,
-    0x01A5U,
-    0x0E1EU,
-    0x0E1CU,
-    0x0E20U,
-    0x03C0U,
-    0x3273U,
-    0x3213U,
-    0x3176U,
-    0x3265U,
-    0x3172U,
-    0x3142U,
-    0x3205U,
-    0x3174U,
-    0x3144U,
-    0x3175U,
-    0x3177U,
-    0x3173U,
-    0x3074U,
-    0x30D4U,
-    0x03D6U,
-    0x0583U,
-    0x031FU,
-    0x2295U,
-    0x02D6U,
-    0xFF0BU,
-    0xFE62U,
-    0x207AU,
-    0xFF50U,
-    0x33D8U,
-    0x307DU,
-    0x261FU,
-    0x261CU,
-    0x261EU,
-    0x261DU,
-    0x30DDU,
-    0x0E1BU,
-    0x3012U,
-    0x3020U,
-    0x24ABU,
-    0x227AU,
-    0x211EU,
-    0x02B9U,
-    0x2035U,
-    0x220FU,
-    0x2305U,
-    0x30FCU,
-    0x2318U,
-    0x2282U,
-    0x2283U,
-    0x2237U,
-    0x221DU,
-    0x03C8U,
-    0x0471U,
-    0x0486U,
-    0x33B0U,
-    0x3077U,
-    0x30D7U,
-    0x33B4U,
-    0x33BAU,
-    0x0958U,
-    0x05A8U,
-    0x0642U,
-    0xFED6U,
-    0xFED7U,
-    0xFED8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x05B8U,
-    0x059FU,
-    0x3111U,
-    0x24E0U,
-    0x02A0U,
-    0xFF51U,
-    0x05E7U,
-    0xFB47U,
-    0xFB47U,
-    0,
-    0,
-    0,
-    0,
-    0x05E7U,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0x24ACU,
-    0x2669U,
-    0x05BBU,
-    0x05BBU,
-    0x05BBU,
-    0x05BBU,
-    0x05BBU,
-    0x05BBU,
-    0x05BBU,
-    0x05BBU,
-    0x061FU,
-    0x055EU,
-    0x037EU,
-    0xFF1FU,
-    0xFF02U,
-    0x301EU,
-    0x301DU,
-    0x201BU,
-    0x201BU,
-    0x0149U,
-    0xFF07U,
-    0x057CU,
-    0x09B0U,
-    0x0155U,
-    0x0930U,
-    0x221AU,
-    0xF8E5U,
-    0x33AEU,
-    0x33AFU,
-    0x33ADU,
-    0x05BFU,
-    0x05BFU,
-    0x0AB0U,
-    0x0A30U,
-    0x3089U,
-    0x30E9U,
-    0xFF97U,
-    0x09F1U,
-    0x09F0U,
-    0x0264U,
-    0x2236U,
-    0x3116U,
-    0x0159U,
-    0x0157U,
-    0x24E1U,
-    0x0157U,
-    0x0211U,
-    0x1E59U,
-    0x1E5BU,
-    0x1E5DU,
-    0x203BU,
-    0x2286U,
-    0x2287U,
-    0xF8E8U,
-    0xF6DAU,
-    0x0631U,
-    0x0580U,
-    0xFEAEU,
-    0x308CU,
-    0,
-    0x30ECU,
-    0xFF9AU,
-    0x05E8U,
-    0xFB48U,
-    0,
-    0,
-    0,
-    0,
-    0x05E8U,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0x223DU,
-    0x0597U,
-    0x0597U,
-    0x2310U,
-    0x027EU,
-    0x027FU,
-    0x09DDU,
-    0x095DU,
-    0x03C1U,
-    0x027DU,
-    0x027BU,
-    0x02B5U,
-    0x03F1U,
-    0x02DEU,
-    0x3271U,
-    0x3211U,
-    0x3263U,
-    0x3140U,
-    0x313AU,
-    0x3169U,
-    0x3139U,
-    0x313BU,
-    0x316CU,
-    0x3203U,
-    0x313FU,
-    0x313CU,
-    0x316BU,
-    0x313DU,
-    0x313EU,
-    0x316AU,
-    0x316DU,
-    0x221FU,
-    0x0319U,
-    0x22BFU,
-    0x308AU,
-    0x30EAU,
-    0xFF98U,
-    0x0325U,
-    0x030AU,
-    0x02BFU,
-    0x0559U,
-    0x031CU,
-    0x02D3U,
-    0x02BEU,
-    0x0339U,
-    0x02D2U,
-    0x0213U,
-    0x3351U,
-    0x1E5FU,
-    0x027CU,
-    0x027AU,
-    0xFF52U,
-    0x308DU,
-    0x30EDU,
-    0xFF9BU,
-    0x0E23U,
-    0x24ADU,
-    0x09DCU,
-    0x0931U,
-    0x0A5CU,
-    0x0691U,
-    0xFB8DU,
-    0x09E0U,
-    0x0960U,
-    0x0AE0U,
-    0x09C4U,
-    0x0944U,
-    0x0AC4U,
-    0x2590U,
-    0x0279U,
-    0x02B4U,
-    0x308BU,
-    0x30EBU,
-    0xFF99U,
-    0x09F2U,
-    0x09F3U,
-    0x0E24U,
-    0x098BU,
-    0x090BU,
-    0x0A8BU,
-    0x09C3U,
-    0x0943U,
-    0x0AC3U,
-    0x09B8U,
-    0x015BU,
-    0x1E65U,
-    0x0635U,
-    0x0938U,
-    0xFEBAU,
-    0xFEBBU,
-    0xFEBCU,
-    0x0AB8U,
-    0x0A38U,
-    0x3055U,
-    0x30B5U,
-    0xFF7BU,
-    0xFDFAU,
-    0x05E1U,
-    0xFB41U,
-    0xFB41U,
-    0x05E1U,
-    0x0E32U,
-    0x0E41U,
-    0x0E44U,
-    0x0E43U,
-    0x0E33U,
-    0x0E30U,
-    0x0E40U,
-    0xF886U,
-    0x0E35U,
-    0xF885U,
-    0x0E34U,
-    0x0E42U,
-    0xF888U,
-    0x0E37U,
-    0xF887U,
-    0x0E36U,
-    0x0E38U,
-    0x0E39U,
-    0x3119U,
-    0x1E67U,
-    0x015FU,
-    0x0259U,
-    0x04D9U,
-    0x04DBU,
-    0x025AU,
-    0x24E2U,
-    0x015DU,
-    0x0219U,
-    0x1E61U,
-    0x1E63U,
-    0x1E69U,
-    0x033CU,
-    0x2033U,
-    0x02CAU,
-    0x0633U,
-    0xFEB2U,
-    0xFEB3U,
-    0xFEB4U,
-    0x05B6U,
-    0x05B6U,
-    0x05B6U,
-    0x05B6U,
-    0x05B6U,
-    0x05B6U,
-    0x05B6U,
-    0x0592U,
-    0x05B6U,
-    0x057DU,
-    0x305BU,
-    0x30BBU,
-    0xFF7EU,
-    0x061BU,
-    0xFF1BU,
-    0xFE54U,
-    0x309CU,
-    0xFF9FU,
-    0x3322U,
-    0x3323U,
-    0x0667U,
-    0x09EDU,
-    0x2466U,
-    0x2790U,
-    0x096DU,
-    0x0AEDU,
-    0x0A6DU,
-    0x0667U,
-    0x3027U,
-    0x3226U,
-    0xFF17U,
-    0x247AU,
-    0x248EU,
-    0x06F7U,
-    0x2176U,
-    0x2470U,
-    0x2484U,
-    0x2498U,
-    0x0E57U,
-    0x00ADU,
-    0x0577U,
-    0x09B6U,
-    0x0448U,
-    0x0651U,
-    0xFC61U,
-    0xFC5EU,
-    0xFC60U,
-    0,
-    0xFC62U,
-    0xFC5FU,
-    0x2592U,
-    0x2593U,
-    0x2591U,
-    0x2592U,
-    0x0936U,
-    0x0AB6U,
-    0x0A36U,
-    0x0593U,
-    0x3115U,
-    0x0449U,
-    0x0634U,
-    0xFEB6U,
-    0xFEB7U,
-    0xFEB8U,
-    0x03E3U,
-    0x20AAU,
-    0x20AAU,
-    0x05B0U,
-    0x05B0U,
-    0x05B0U,
-    0x05B0U,
-    0x05B0U,
-    0x05B0U,
-    0x05B0U,
-    0x05B0U,
-    0x05B0U,
-    0x04BBU,
-    0x03EDU,
-    0x05E9U,
-    0xFB49U,
-    0xFB49U,
-    0xFB2CU,
-    0xFB2CU,
-    0xFB2DU,
-    0xFB2DU,
-    0x05C1U,
-    0x05E9U,
-    0xFB2AU,
-    0xFB2AU,
-    0xFB2BU,
-    0xFB2BU,
-    0x0282U,
-    0x03C3U,
-    0x03C2U,
-    0x03C2U,
-    0x03F2U,
-    0x3057U,
-    0x30B7U,
-    0xFF7CU,
-    0x05BDU,
-    0x05BDU,
-    0x223CU,
-    0x05C2U,
-    0x3274U,
-    0x3214U,
-    0x317EU,
-    0x3266U,
-    0x317AU,
-    0x3145U,
-    0x317BU,
-    0x3206U,
-    0x317DU,
-    0x317CU,
-    0x0666U,
-    0x09ECU,
-    0x2465U,
-    0x278FU,
-    0x096CU,
-    0x0AECU,
-    0x0A6CU,
-    0x0666U,
-    0x3026U,
-    0x3225U,
-    0xFF16U,
-    0x2479U,
-    0x248DU,
-    0x06F6U,
-    0x2175U,
-    0x246FU,
-    0x09F9U,
-    0x2483U,
-    0x2497U,
-    0x0E56U,
-    0xFF0FU,
-    0x017FU,
-    0x1E9BU,
-    0x263AU,
-    0xFF53U,
-    0x05C3U,
-    0x00ADU,
-    0x044CU,
-    0x305DU,
-    0x30BDU,
-    0xFF7FU,
-    0x0338U,
-    0x0337U,
-    0x0E29U,
-    0x0E28U,
-    0x0E0BU,
-    0x0E2AU,
-    0x0020U,
-    0x2660U,
-    0x2660U,
-    0x2664U,
-    0x24AEU,
-    0x033BU,
-    0x33C4U,
-    0x339DU,
-    0x25A9U,
-    0x25A4U,
-    0x338FU,
-    0x339EU,
-    0x33CEU,
-    0x33D1U,
-    0x33D2U,
-    0x338EU,
-    0x33D5U,
-    0x339CU,
-    0x33A1U,
-    0x25A6U,
-    0x25A7U,
-    0x25A8U,
-    0x25A5U,
-    0x25A3U,
-    0x33DBU,
-    0x09B7U,
-    0x0937U,
-    0x0AB7U,
-    0x3149U,
-    0x3185U,
-    0x3180U,
-    0x3132U,
-    0x3165U,
-    0x3143U,
-    0x3146U,
-    0x3138U,
-    0xFFE1U,
-    0x0336U,
-    0x0335U,
-    0x2282U,
-    0x228AU,
-    0x2286U,
-    0x227BU,
-    0x220BU,
-    0x3059U,
-    0x30B9U,
-    0xFF7DU,
-    0x0652U,
-    0x2211U,
-    0x263CU,
-    0x2283U,
-    0x228BU,
-    0x2287U,
-    0x33DCU,
-    0x337CU,
-    0x09A4U,
-    0x22A4U,
-    0x22A3U,
-    0x0924U,
-    0x0AA4U,
-    0x0A24U,
-    0x0637U,
-    0xFEC2U,
-    0xFEC3U,
-    0x305FU,
-    0xFEC4U,
-    0x337DU,
-    0x30BFU,
-    0xFF80U,
-    0x0640U,
-    0x03C4U,
-    0x05EAU,
-    0xFB4AU,
-    0xFB4AU,
-    0xFB4AU,
-    0x05EAU,
-    0x0167U,
-    0x310AU,
-    0x0165U,
-    0x02A8U,
-    0x0163U,
-    0x0686U,
-    0xFB7BU,
-    0xFB7CU,
-    0xFB7DU,
-    0,
-    0x24E3U,
-    0x1E71U,
-    0x0163U,
-    0x1E97U,
-    0x1E6BU,
-    0x1E6DU,
-    0x0442U,
-    0x04ADU,
-    0x062AU,
-    0xFE96U,
-    0xFCA2U,
-    0xFC0CU,
-    0xFE97U,
-    0x3066U,
-    0xFCA1U,
-    0xFC0BU,
-    0x0629U,
-    0xFE94U,
-    0xFE98U,
-    0xFCA4U,
-    0xFC0EU,
-    0xFC73U,
-    0x30C6U,
-    0xFF83U,
-    0x2121U,
-    0x260EU,
-    0x05A0U,
-    0x05A9U,
-    0x2469U,
-    0x3229U,
-    0x247DU,
-    0x2491U,
-    0x2179U,
-    0x02A7U,
-    0x05D8U,
-    0xFB38U,
-    0xFB38U,
-    0x05D8U,
-    0x04B5U,
-    0x059BU,
-    0x059BU,
-    0x09A5U,
-    0x0925U,
-    0x0AA5U,
-    0x0A25U,
-    0x0630U,
-    0xFEACU,
-    0xF898U,
-    0xF897U,
-    0x0E4CU,
-    0xF896U,
-    0x062BU,
-    0xFE9AU,
-    0xFE9BU,
-    0xFE9CU,
-    0x2203U,
-    0x2234U,
-    0x03B8U,
-    0x03D1U,
-    0x03D1U,
-    0x3279U,
-    0x3219U,
-    0x326BU,
-    0x314CU,
-    0x320BU,
-    0x246CU,
-    0x2480U,
-    0x2494U,
-    0x0E11U,
-    0x01ADU,
-    0x0E12U,
-    0x0E17U,
-    0x0E10U,
-    0x0E18U,
-    0x0E16U,
-    0x0482U,
-    0x066CU,
-    0x066CU,
-    0x0663U,
-    0x09E9U,
-    0x2462U,
-    0x278CU,
-    0x0969U,
-    0x0AE9U,
-    0x0A69U,
-    0x0663U,
-    0x3023U,
-    0x3222U,
-    0xFF13U,
-    0x09F6U,
-    0x2476U,
-    0x248AU,
-    0x06F3U,
-    0x2172U,
-    0x0E53U,
-    0x3394U,
-    0x3061U,
-    0x30C1U,
-    0xFF81U,
-    0x3270U,
-    0x3210U,
-    0x3262U,
-    0x3137U,
-    0x3202U,
-    0x0330U,
-    0x0303U,
-    0x0303U,
-    0x0360U,
-    0x223CU,
-    0x0334U,
-    0x033EU,
-    0x2297U,
-    0x0596U,
-    0x0596U,
-    0x0A70U,
-    0x0483U,
-    0x057FU,
-    0x1E6FU,
-    0xFF54U,
-    0x0569U,
-    0x3068U,
-    0x30C8U,
-    0xFF84U,
-    0x02E5U,
-    0x02E9U,
-    0x02E6U,
-    0x02E8U,
-    0x02E7U,
-    0x01BDU,
-    0x0185U,
-    0x01A8U,
-    0x0384U,
-    0x3327U,
-    0x0E0FU,
-    0x3014U,
-    0xFE5DU,
-    0xFE39U,
-    0x3015U,
-    0xFE5EU,
-    0xFE3AU,
-    0x0E15U,
-    0x01ABU,
-    0x24AFU,
-    0xF8EAU,
-    0xF6DBU,
-    0x0288U,
-    0x25BCU,
-    0x25C4U,
-    0x25BAU,
-    0x25B2U,
-    0x02A6U,
-    0x05E6U,
-    0xFB46U,
-    0xFB46U,
-    0x05E6U,
-    0x0446U,
-    0x05B5U,
-    0x05B5U,
-    0x05B5U,
-    0x05B5U,
-    0x05B5U,
-    0x05B5U,
-    0x05B5U,
-    0x05B5U,
-    0x045BU,
-    0x099FU,
-    0x091FU,
-    0x0A9FU,
-    0x0A1FU,
-    0x0679U,
-    0xFB67U,
-    0xFB68U,
-    0xFB69U,
-    0x09A0U,
-    0x0920U,
-    0x0AA0U,
-    0x0A20U,
-    0x0287U,
-    0x3064U,
-    0x30C4U,
-    0xFF82U,
-    0x3063U,
-    0x30C3U,
-    0xFF6FU,
-    0x246BU,
-    0x247FU,
-    0x2493U,
-    0x217BU,
-    0x2473U,
-    0x5344U,
-    0x2487U,
-    0x249BU,
-    0x0662U,
-    0x09E8U,
-    0x2461U,
-    0x278BU,
-    0x0968U,
-    0x2025U,
-    0xFE30U,
-    0x0AE8U,
-    0x0A68U,
-    0x0662U,
-    0x3022U,
-    0x3221U,
-    0xFF12U,
-    0x09F5U,
-    0x2475U,
-    0x2489U,
-    0x06F2U,
-    0x2171U,
-    0x01BBU,
-    0x0E52U,
-    0x0289U,
-    0x0989U,
-    0x3128U,
-    0x016DU,
-    0x01D4U,
-    0x24E4U,
-    0x1E77U,
-    0x0443U,
-    0x0951U,
-    0x0171U,
-    0x0215U,
-    0x0909U,
-    0x01D8U,
-    0x1E73U,
-    0x01DAU,
-    0x04F1U,
-    0x01DCU,
-    0x01D6U,
-    0x1EE5U,
-    0x0A89U,
-    0x0A09U,
-    0x3046U,
-    0x1EE7U,
-    0x01B0U,
-    0x1EE9U,
-    0x1EF1U,
-    0x1EEBU,
-    0x1EEDU,
-    0x1EEFU,
-    0x0171U,
-    0x04F3U,
-    0x0217U,
-    0x30A6U,
-    0xFF73U,
-    0x0479U,
-    0x315CU,
-    0x016BU,
-    0x04EFU,
-    0x1E7BU,
-    0x0A41U,
-    0xFF55U,
-    0x2017U,
-    0xFF3FU,
-    0xFE33U,
-    0xFE4FU,
-    0x222AU,
-    0x2200U,
-    0x0173U,
-    0x24B0U,
-    0x2580U,
-    0x05C4U,
-    0x03C5U,
-    0x03CBU,
-    0x03B0U,
-    0x028AU,
-    0x03CDU,
-    0x031DU,
-    0x02D4U,
-    0x0A73U,
-    0x016FU,
-    0x045EU,
-    0x3045U,
-    0x30A5U,
-    0xFF69U,
-    0x04AFU,
-    0x04B1U,
-    0x0169U,
-    0x1E79U,
-    0x1E75U,
-    0x098AU,
-    0x090AU,
-    0x0A8AU,
-    0x0A0AU,
-    0x0A42U,
-    0x09C2U,
-    0x0942U,
-    0x0AC2U,
-    0x09C1U,
-    0x0941U,
-    0x0AC1U,
-    0x0935U,
-    0x0AB5U,
-    0x0A35U,
-    0x30F7U,
-    0x05D5U,
-    0xFB35U,
-    0xFB35U,
-    0xFB35U,
-    0x05D5U,
-    0xFB4BU,
-    0xFB4BU,
-    0x05F0U,
-    0x05F1U,
-    0x24E5U,
-    0x1E7FU,
-    0x0432U,
-    0x06A4U,
-    0xFB6BU,
-    0xFB6CU,
-    0xFB6DU,
-    0x30F9U,
-    0x2640U,
-    0x007CU,
-    0x030DU,
-    0x0329U,
-    0x02CCU,
-    0x02C8U,
-    0x057EU,
-    0x028BU,
-    0x30F8U,
-    0x09CDU,
-    0x094DU,
-    0x0ACDU,
-    0x0983U,
-    0x0903U,
-    0x0A83U,
-    0xFF56U,
-    0x0578U,
-    0x309EU,
-    0x30FEU,
-    0x309BU,
-    0xFF9EU,
-    0x30FAU,
-    0x24B1U,
-    0x1E7DU,
-    0x028CU,
-    0x3094U,
-    0x30F4U,
-    0x1E83U,
-    0x3159U,
-    0x308FU,
-    0x30EFU,
-    0xFF9CU,
-    0x3158U,
-    0x308EU,
-    0x30EEU,
-    0x3357U,
-    0x301CU,
-    0xFE34U,
-    0x0648U,
-    0xFEEEU,
-    0x0624U,
-    0xFE86U,
-    0x33DDU,
-    0x24E6U,
-    0x0175U,
-    0x1E85U,
-    0x1E87U,
-    0x1E89U,
-    0x3091U,
-    0x2118U,
-    0x30F1U,
-    0x315EU,
-    0x315DU,
-    0x1E81U,
-    0x25E6U,
-    0x25CBU,
-    0x25D9U,
-    0x300EU,
-    0xFE43U,
-    0x300FU,
-    0xFE44U,
-    0x25C7U,
-    0x25C8U,
-    0x25BFU,
-    0x25BDU,
-    0x25C3U,
-    0x25C1U,
-    0x3016U,
-    0x3017U,
-    0x25B9U,
-    0x25B7U,
-    0x25ABU,
-    0x263AU,
-    0x25A1U,
-    0x2606U,
-    0x260FU,
-    0x3018U,
-    0x3019U,
-    0x25B5U,
-    0x25B3U,
-    0x3090U,
-    0x30F0U,
-    0x315FU,
-    0xFF57U,
-    0x3092U,
-    0x30F2U,
-    0xFF66U,
-    0x20A9U,
-    0xFFE6U,
-    0x0E27U,
-    0x24B2U,
-    0x1E98U,
-    0x02B7U,
-    0x028DU,
-    0x01BFU,
-    0x033DU,
-    0x3112U,
-    0x24E7U,
-    0x1E8DU,
-    0x1E8BU,
-    0x056DU,
-    0x03BEU,
-    0xFF58U,
-    0x24B3U,
-    0x02E3U,
-    0x334EU,
-    0x09AFU,
-    0x092FU,
-    0x3152U,
-    0x0AAFU,
-    0x0A2FU,
-    0x3084U,
-    0x30E4U,
-    0xFF94U,
-    0x3151U,
-    0x0E4EU,
-    0x3083U,
-    0x30E3U,
-    0xFF6CU,
-    0x0463U,
-    0x24E8U,
-    0x0177U,
-    0x1E8FU,
-    0x1EF5U,
-    0x064AU,
-    0x06D2U,
-    0xFBAFU,
-    0xFEF2U,
-    0x0626U,
-    0xFE8AU,
-    0xFE8BU,
-    0xFE8CU,
-    0xFEF3U,
-    0xFEF4U,
-    0xFCDDU,
-    0xFC58U,
-    0xFC94U,
-    0x06D1U,
-    0x3156U,
-    0xFFE5U,
-    0x3155U,
-    0x3186U,
-    0x05AAU,
-    0x05AAU,
-    0x044BU,
-    0x04F9U,
-    0x3181U,
-    0x3183U,
-    0x3182U,
-    0x059AU,
-    0x1EF3U,
-    0x01B4U,
-    0x1EF7U,
-    0x0575U,
-    0x0457U,
-    0x3162U,
-    0x262FU,
-    0x0582U,
-    0xFF59U,
-    0x05D9U,
-    0xFB39U,
-    0xFB39U,
-    0x05D9U,
-    0x05F2U,
-    0xFB1FU,
-    0x3088U,
-    0x3189U,
-    0x30E8U,
-    0xFF96U,
-    0x315BU,
-    0x3087U,
-    0x30E7U,
-    0xFF6EU,
-    0x03F3U,
-    0x3188U,
-    0x3187U,
-    0x0E22U,
-    0x0E0DU,
-    0x24B4U,
-    0x037AU,
-    0x0345U,
-    0x01A6U,
-    0x1E99U,
-    0x02B8U,
-    0x1EF9U,
-    0x028EU,
-    0x3086U,
-    0x318CU,
-    0x30E6U,
-    0xFF95U,
-    0x3160U,
-    0x046BU,
-    0x046DU,
-    0x0467U,
-    0x0469U,
-    0x3085U,
-    0x30E5U,
-    0xFF6DU,
-    0x318BU,
-    0x318AU,
-    0x09DFU,
-    0x095FU,
-    0x0566U,
-    0x017AU,
-    0x095BU,
-    0x0A5BU,
-    0x0638U,
-    0xFEC6U,
-    0xFEC7U,
-    0x3056U,
-    0xFEC8U,
-    0x0632U,
-    0xFEB0U,
-    0x30B6U,
-    0x0595U,
-    0x0594U,
-    0x0598U,
-    0x05D6U,
-    0xFB36U,
-    0xFB36U,
-    0x05D6U,
-    0x3117U,
-    0x24E9U,
-    0x1E91U,
-    0x0291U,
-    0x017CU,
-    0x017CU,
-    0x1E93U,
-    0x0437U,
-    0x0499U,
-    0x04DFU,
-    0x305CU,
-    0x30BCU,
-    0x0660U,
-    0x09E6U,
-    0x0966U,
-    0x0AE6U,
-    0x0A66U,
-    0x0660U,
-    0xFF10U,
-    0x06F0U,
-    0x0E50U,
-    0xFEFFU,
-    0x200CU,
-    0x200BU,
-    0x03B6U,
-    0x3113U,
-    0x056AU,
-    0x04C2U,
-    0x0436U,
-    0x0497U,
-    0x04DDU,
-    0x3058U,
-    0x30B8U,
-    0x05AEU,
-    0x1E95U,
-    0xFF5AU,
-    0x305EU,
-    0x30BEU,
-    0x24B5U,
-    0x0290U,
-    0x01B6U,
-    0x305AU,
-    0x30BAU,
+    if ( name == 0 || name >= limit )
+      goto NotFound;
 
-#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
-    0
-  };
+    c     = *name++;
+    count = p[1];
+    p    += 2;
 
+    min = 0;
+    max = count;
 
+    while ( min < max )
+    {
+      int                   mid = ( min + max ) >> 1;
+      const unsigned char*  q   = p + mid * 2;
+      int                   c2;
 
-  static const unsigned short  t1_standard_encoding[257] =
-  {
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    1,
-    2,
-    3,
-    4,
-    5,
-    6,
-    7,
-    8,
-    9,
-    10,
-    11,
-    12,
-    13,
-    14,
-    15,
-    16,
-    17,
-    18,
-    19,
-    20,
-    21,
-    22,
-    23,
-    24,
-    25,
-    26,
-    27,
-    28,
-    29,
-    30,
-    31,
-    32,
-    33,
-    34,
-    35,
-    36,
-    37,
-    38,
-    39,
-    40,
-    41,
-    42,
-    43,
-    44,
-    45,
-    46,
-    47,
-    48,
-    49,
-    50,
-    51,
-    52,
-    53,
-    54,
-    55,
-    56,
-    57,
-    58,
-    59,
-    60,
-    61,
-    62,
-    63,
-    64,
-    65,
-    66,
-    67,
-    68,
-    69,
-    70,
-    71,
-    72,
-    73,
-    74,
-    75,
-    76,
-    77,
-    78,
-    79,
-    80,
-    81,
-    82,
-    83,
-    84,
-    85,
-    86,
-    87,
-    88,
-    89,
-    90,
-    91,
-    92,
-    93,
-    94,
-    95,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    96,
-    97,
-    98,
-    99,
-    100,
-    101,
-    102,
-    103,
-    104,
-    105,
-    106,
-    107,
-    108,
-    109,
-    110,
-    0,
-    111,
-    112,
-    113,
-    114,
-    0,
-    115,
-    116,
-    117,
-    118,
-    119,
-    120,
-    121,
-    122,
-    0,
-    123,
-    0,
-    124,
-    125,
-    126,
-    127,
-    128,
-    129,
-    130,
-    131,
-    0,
-    132,
-    133,
-    0,
-    134,
-    135,
-    136,
-    137,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    138,
-    0,
-    139,
-    0,
-    0,
-    0,
-    0,
-    140,
-    141,
-    142,
-    143,
-    0,
-    0,
-    0,
-    0,
-    0,
-    144,
-    0,
-    0,
-    0,
-    145,
-    0,
-    0,
-    146,
-    147,
-    148,
-    149,
-    0,
-    0,
-    0,
-    0,
-    0
-  };
 
+      q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] );
 
-  static const unsigned short  t1_expert_encoding[257] =
-  {
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    1,
-    229,
-    230,
-    0,
-    231,
-    232,
-    233,
-    234,
-    235,
-    236,
-    237,
-    238,
-    13,
-    14,
-    15,
-    99,
-    239,
-    240,
-    241,
-    242,
-    243,
-    244,
-    245,
-    246,
-    247,
-    248,
-    27,
-    28,
-    249,
-    250,
-    251,
-    252,
-    0,
-    253,
-    254,
-    255,
-    256,
-    257,
-    0,
-    0,
-    0,
-    258,
-    0,
-    0,
-    259,
-    260,
-    261,
-    262,
-    0,
-    0,
-    263,
-    264,
-    265,
-    0,
-    266,
-    109,
-    110,
-    267,
-    268,
-    269,
-    0,
-    270,
-    271,
-    272,
-    273,
-    274,
-    275,
-    276,
-    277,
-    278,
-    279,
-    280,
-    281,
-    282,
-    283,
-    284,
-    285,
-    286,
-    287,
-    288,
-    289,
-    290,
-    291,
-    292,
-    293,
-    294,
-    295,
-    296,
-    297,
-    298,
-    299,
-    300,
-    301,
-    302,
-    303,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    0,
-    304,
-    305,
-    306,
-    0,
-    0,
-    307,
-    308,
-    309,
-    310,
-    311,
-    0,
-    312,
-    0,
-    0,
-    313,
-    0,
-    0,
-    314,
-    315,
-    0,
-    0,
-    316,
-    317,
-    318,
-    0,
-    0,
-    0,
-    158,
-    155,
-    163,
-    319,
-    320,
-    321,
-    322,
-    323,
-    324,
-    325,
-    0,
-    0,
-    326,
-    150,
-    164,
-    169,
-    327,
-    328,
-    329,
-    330,
-    331,
-    332,
-    333,
-    334,
-    335,
-    336,
-    337,
-    338,
-    339,
-    340,
-    341,
-    342,
-    343,
-    344,
-    345,
-    346,
-    347,
-    348,
-    349,
-    350,
-    351,
-    352,
-    353,
-    354,
-    355,
-    356,
-    357,
-    358,
-    359,
-    360,
-    361,
-    362,
-    363,
-    364,
-    365,
-    366,
-    367,
-    368,
-    369,
-    370,
-    371,
-    372,
-    373,
-    374,
-    375,
-    376,
-    377,
-    378,
-    0
-  };
+      c2 = q[0] & 127;
+      if ( c2 == c )
+      {
+        p = q;
+        goto Found;
+      }
+      if ( c2 < c )
+        min = mid + 1;
+      else
+        max = mid;
+    }
+    goto NotFound;
+
+  Found:
+    for (;;)
+    {
+      /* assert (*p & 127) == c */
+
+      if ( name >= limit )
+      {
+        if ( (p[0] & 128) == 0 &&
+             (p[1] & 128) != 0 )
+          return (unsigned long)( ( (int)p[2] << 8 ) | p[3] );
+
+        goto NotFound;
+      }
+      c = *name++;
+      if ( p[0] & 128 )
+      {
+        p++;
+        if ( c != (p[0] & 127) )
+          goto NotFound;
+
+        continue;
+      }
+
+      p++;
+      count = p[0] & 127;
+      if ( p[0] & 128 )
+        p += 2;
+
+      p++;
+
+      for ( ; count > 0; count--, p += 2 )
+      {
+        int                   offset = ( (int)p[0] << 8 ) | p[1];
+        const unsigned char*  q      = ft_adobe_glyph_list + offset;
+
+        if ( c == ( q[0] & 127 ) )
+        {
+          p = q;
+          goto NextIter;
+        }
+      }
+      goto NotFound;
+
+    NextIter:
+      ;
+    }
+
+  NotFound:
+    return 0;
+  }
 
 
 /* END */
index 01b5c0d..f6e4251 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/raster Jamfile (c) 2001 David Turner
+# FreeType 2 src/raster Jamfile
 #
+# Copyright 2001 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) raster ;
 
diff --git a/reactos/lib/freetype/src/raster/ftmisc.h b/reactos/lib/freetype/src/raster/ftmisc.h
new file mode 100644 (file)
index 0000000..927ac4c
--- /dev/null
@@ -0,0 +1,83 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ftmisc.h                                                               */\r
+/*                                                                         */\r
+/*    Miscellaneous macros for stand-alone rasterizer (specification       */\r
+/*    only).                                                               */\r
+/*                                                                         */\r
+/*  Copyright 2005 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used        */\r
+/*  modified and distributed under the terms of the FreeType project       */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+  /***************************************************/\r
+  /*                                                 */\r
+  /* This file is *not* portable!  You have to adapt */\r
+  /* its definitions to your platform.               */\r
+  /*                                                 */\r
+  /***************************************************/\r
+\r
+#ifndef __FTMISC_H__\r
+#define __FTMISC_H__\r
+\r
+#include <string.h> /* memset */\r
+\r
+#define FT_BEGIN_HEADER\r
+#define FT_END_HEADER\r
+\r
+#define FT_LOCAL_DEF( x )   static x\r
+\r
+  /* from include/freetype2/fttypes.h */\r
+\r
+  typedef unsigned char  FT_Byte;\r
+  typedef signed int     FT_Int;\r
+  typedef unsigned int   FT_UInt;\r
+  typedef signed long    FT_Long;\r
+  typedef unsigned long  FT_ULong;\r
+  typedef signed long    FT_F26Dot6;\r
+  typedef int            FT_Error;\r
+\r
+#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\r
+          ( ( (FT_ULong)_x1 << 24 ) |     \\r
+            ( (FT_ULong)_x2 << 16 ) |     \\r
+            ( (FT_ULong)_x3 <<  8 ) |     \\r
+              (FT_ULong)_x4         )\r
+\r
+\r
+  /* from src/ftcalc.c */\r
+\r
+#include <inttypes.h>\r
+\r
+  typedef int64_t  FT_Int64;\r
+\r
+  static FT_Long\r
+  FT_MulDiv( FT_Long  a,\r
+             FT_Long  b,\r
+             FT_Long  c )\r
+  {\r
+    FT_Int   s;\r
+    FT_Long  d;\r
+\r
+\r
+    s = 1;\r
+    if ( a < 0 ) { a = -a; s = -1; }\r
+    if ( b < 0 ) { b = -b; s = -s; }\r
+    if ( c < 0 ) { c = -c; s = -s; }\r
+\r
+    d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c\r
+                         : 0x7FFFFFFFL );\r
+\r
+    return ( s > 0 ) ? d : -d;\r
+  }\r
+\r
+#endif /* __FTMISC_H__ */\r
+\r
+\r
+/* END */\r
index 0ba27e8..cb9f946 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph rasterizer (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*                                                                         */
 /***************************************************************************/
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* This file can be compiled without the rest of the FreeType engine, by */
+  /* defining the _STANDALONE_ macro when compiling it.  You also need to  */
+  /* put the files `ftimage.h' and `ftmisc.h' into the $(incdir)           */
+  /* directory.  Typically, you should do something like                   */
+  /*                                                                       */
+  /* - 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                                           */
+  /*                                                                       */
+  /* - compile `ftraster' with the _STANDALONE_ macro defined, as in       */
+  /*                                                                       */
+  /*     cc -c -D_STANDALONE_ ftraster.c                                   */
+  /*                                                                       */
+  /* The renderer can be initialized with a call to                        */
+  /* `ft_standard_raster.raster_new'; a bitmap can be generated            */
+  /* with a call to `ft_standard_raster.raster_render'.                    */
+  /*                                                                       */
+  /* See the comments and documentation in the file `ftimage.h' for more   */
+  /* details on how the raster works.                                      */
+  /*                                                                       */
+  /*************************************************************************/
+
+
   /*************************************************************************/
   /*                                                                       */
   /* This is a rewrite of the FreeType 1.x scan-line converter             */
   /*                                                                       */
   /*************************************************************************/
 
+#ifdef _STANDALONE_
+
+#include "ftmisc.h"
+#include "ftimage.h"
+
+#else /* !_STANDALONE_ */
 
 #include <ft2build.h>
 #include "ftraster.h"
 #include FT_INTERNAL_CALC_H   /* for FT_MulDiv only */
 
+#endif /* !_STANDALONE_ */
+
 
   /*************************************************************************/
   /*                                                                       */
   /* define DEBUG_RASTER if you want to compile a debugging version */
 #define xxxDEBUG_RASTER
 
-  /* The default render pool size in bytes */
-#define RASTER_RENDER_POOL  8192
-
   /* undefine FT_RASTER_OPTION_ANTI_ALIASING if you do not want to support */
   /* 5-levels anti-aliasing                                                */
 #ifdef FT_CONFIG_OPTION_5_GRAY_LEVELS
 #endif
 
 #ifndef FT_TRACE
-#define FT_TRACE( x )  do ; while ( 0 )     /* nothing */
+#define FT_TRACE( x )   do ; while ( 0 )    /* nothing */
+#define FT_TRACE1( x )  do ; while ( 0 )    /* nothing */
+#define FT_TRACE6( x )  do ; while ( 0 )    /* nothing */
 #endif
 
 #define Raster_Err_None          0
 #define Raster_Err_Invalid      -4
 #define Raster_Err_Unsupported  -5
 
+#define ft_memset   memset
 
 #else /* _STANDALONE_ */
 
 #define FT_MEM_SET( d, s, c )  ft_memset( d, s, c )
 #endif
 
+#ifndef FT_MEM_ZERO
+#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )
+#endif
 
   /* FMulDiv means `Fast MulDiv'; it is used in case where `b' is       */
   /* typically a small value and the result of a*b is known to fit into */
   ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )
 
 
-#ifdef TT_STATIC_RASTER
+#ifdef FT_STATIC_RASTER
 
 
 #define RAS_ARGS       /* void */
 #define FT_UNUSED_RASTER  do ; while ( 0 )
 
 
-#else /* TT_STATIC_RASTER */
+#else /* FT_STATIC_RASTER */
 
 
 #define RAS_ARGS       TRaster_Instance*  raster,
 #define FT_UNUSED_RASTER  FT_UNUSED( raster )
 
 
-#endif /* TT_STATIC_RASTER */
+#endif /* FT_STATIC_RASTER */
 
 
   typedef struct TRaster_Instance_  TRaster_Instance;
   };
 
 
-#ifdef FT_CONFIG_OPTION_STATIC_RASTER
+#ifdef FT_STATIC_RASTER
 
   static TRaster_Instance  cur_ras;
 #define ras  cur_ras
 
 #define ras  (*raster)
 
-#endif /* FT_CONFIG_OPTION_STATIC_RASTER */
+#endif /* FT_STATIC_RASTER */
 
 
   /*************************************************************************/
   /*                                                                       */
   /* <Input>                                                               */
   /*   x :: The x-coordinate of the segment's end point (its start point   */
-  /*        is stored in `LastX').                                         */
+  /*        is stored in `lastX').                                         */
   /*                                                                       */
   /*   y :: The y-coordinate of the segment's end point (its start point   */
-  /*        is stored in `LastY').                                         */
+  /*        is stored in `lastY').                                         */
   /*                                                                       */
   /* <Return>                                                              */
   /*   SUCCESS on success, FAILURE on render pool overflow or incorrect    */
   /*   cy :: The y-coordinate of the arc's new control point.              */
   /*                                                                       */
   /*   x  :: The x-coordinate of the arc's end point (its start point is   */
-  /*         stored in `LastX').                                           */
+  /*         stored in `lastX').                                           */
   /*                                                                       */
   /*   y  :: The y-coordinate of the arc's end point (its start point is   */
-  /*         stored in `LastY').                                           */
+  /*         stored in `lastY').                                           */
   /*                                                                       */
   /* <Return>                                                              */
   /*   SUCCESS on success, FAILURE on render pool overflow or incorrect    */
   /*   cy2 :: The y-coordinate of the arc's second new control point.      */
   /*                                                                       */
   /*   x   :: The x-coordinate of the arc's end point (its start point is  */
-  /*          stored in `LastX').                                          */
+  /*          stored in `lastX').                                          */
   /*                                                                       */
   /*   y   :: The y-coordinate of the arc's end point (its start point is  */
-  /*          stored in `LastY').                                          */
+  /*          stored in `lastY').                                          */
   /*                                                                       */
   /* <Return>                                                              */
   /*   SUCCESS on success, FAILURE on render pool overflow or incorrect    */
                                   Short*  max )
   {
     /* nothing, really */
-    FT_UNUSED( raster );
+    FT_UNUSED_RASTER;
     FT_UNUSED( min );
     FT_UNUSED( max );
   }
   Horizontal_Sweep_Step( RAS_ARG )
   {
     /* Nothing, really */
-    FT_UNUSED( raster );
+    FT_UNUSED_RASTER;
   }
 
 
                                        PProfile    right )
   {
     /* nothing, really */
-    FT_UNUSED( raster );
+    FT_UNUSED_RASTER;
     FT_UNUSED( y );
     FT_UNUSED( x1 );
     FT_UNUSED( x2 );
     Set_High_Precision( RAS_VARS ras.outline.flags &
                         FT_OUTLINE_HIGH_PRECISION );
     ras.scale_shift    = ras.precision_shift;
+    /* Drop-out mode 2 is hard-coded since this is the only mode used */
+    /* on Windows platforms.  Using other modes, as specified by the  */
+    /* font, results in misplaced pixels.                             */
     ras.dropOutControl = 2;
     ras.second_pass    = (FT_Byte)( !( ras.outline.flags &
                                        FT_OUTLINE_SINGLE_PASS ) );
         return error;
     }
 
-    return Raster_Err_Ok;
+    return Raster_Err_None;
   }
 
 
     Set_High_Precision( RAS_VARS ras.outline.flags &
                         FT_OUTLINE_HIGH_PRECISION );
     ras.scale_shift    = ras.precision_shift + 1;
+    /* Drop-out mode 2 is hard-coded since this is the only mode used */
+    /* on Windows platforms.  Using other modes, as specified by the  */
+    /* font, results in misplaced pixels.                             */
     ras.dropOutControl = 2;
     ras.second_pass    = !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS );
 
         return error;
     }
 
-    return Raster_Err_Ok;
+    return Raster_Err_None;
   }
 
 #else /* !FT_RASTER_OPTION_ANTI_ALIASING */
   {
     FT_UNUSED_RASTER;
 
-    return Raster_Err_Cannot_Render_Glyph;
+    return Raster_Err_Unsupported;
   }
 
 #endif /* !FT_RASTER_OPTION_ANTI_ALIASING */
           ( ( c << 2 ) & 0x0030 ) |
                    (c  & 0x0003 );
 
-      raster->count_table[n] = (UInt)c;
+      ras.count_table[n] = (UInt)c;
     }
 
 #ifdef FT_RASTER_OPTION_ANTI_ALIASING
     for ( n = 0; n < 5; n++ )
       raster->grays[n] = n * 255 / 4;
 
-    raster->gray_width = RASTER_GRAY_LINES / 2;
+    ras.gray_width = RASTER_GRAY_LINES / 2;
 
 #endif
   }
   ft_black_new( void*      memory,
                 FT_Raster  *araster )
   {
-     static FT_RasterRec_  the_raster;
+     static TRaster_Instance  the_raster;
 
 
-     *araster = &the_raster;
+     *araster = (FT_Raster)&the_raster;
      FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );
      ft_black_init( &the_raster );
 
   ft_black_done( FT_Raster  raster )
   {
     /* nothing */
-    raster->init = 0;
+    FT_UNUSED( raster );
   }
 
 
 
   static void
   ft_black_reset( TRaster_Instance*  raster,
-                  const char*        pool_base,
+                  char*              pool_base,
                   long               pool_size )
   {
-    if ( raster && pool_base && pool_size >= 4096 )
+    if ( (&ras) && pool_base && pool_size >= 4096 )
     {
       /* save the pool */
-      raster->buff     = (PLong)pool_base;
-      raster->sizeBuff = raster->buff + pool_size / sizeof ( Long );
+      ras.buff     = (PLong)pool_base;
+      ras.sizeBuff = ras.buff + pool_size / sizeof ( Long );
     }
   }
 
     if ( mode == FT_MAKE_TAG( 'p', 'a', 'l', '5' ) )
     {
       /* set 5-levels gray palette */
-      raster->grays[0] = palette[0];
-      raster->grays[1] = palette[1];
-      raster->grays[2] = palette[2];
-      raster->grays[3] = palette[3];
-      raster->grays[4] = palette[4];
+      ras.grays[0] = palette[0];
+      ras.grays[1] = palette[1];
+      ras.grays[2] = palette[2];
+      ras.grays[3] = palette[3];
+      ras.grays[4] = palette[4];
     }
 
 #else
 
 
   static int
-  ft_black_render( TRaster_Instance*  raster,
-                   FT_Raster_Params*  params )
+  ft_black_render( TRaster_Instance*        raster,
+                   const FT_Raster_Params*  params )
   {
-    FT_Outline*  outline    = (FT_Outline*)params->source;
-    FT_Bitmap*   target_map = params->target;
+    const FT_Outline*  outline    = (const FT_Outline*)params->source;
+    const FT_Bitmap*   target_map = params->target;
 
 
-    if ( !raster || !raster->buff || !raster->sizeBuff )
+    if ( !(&ras) || !ras.buff || !ras.sizeBuff )
       return Raster_Err_Not_Ini;
 
     /* return immediately if the outline is empty */
     ras.target   = *target_map;
 
     return ( ( params->flags & FT_RASTER_FLAG_AA )
-               ? Render_Gray_Glyph( raster )
-               : Render_Glyph( raster ) );
+               ? Render_Gray_Glyph( RAS_VAR )
+               : Render_Glyph( RAS_VAR ) );
   }
 
 
index a17ef9b..ed75fb6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph rasterizer interface (body).                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
   /* transform a given glyph image */
   static FT_Error
-  ft_raster1_transform( FT_Renderer   render,
-                        FT_GlyphSlot  slot,
-                        FT_Matrix*    matrix,
-                        FT_Vector*    delta )
+  ft_raster1_transform( FT_Renderer       render,
+                        FT_GlyphSlot      slot,
+                        const FT_Matrix*  matrix,
+                        const FT_Vector*  delta )
   {
     FT_Error error = Raster_Err_Ok;
 
 
   /* convert a slot's glyph image into a bitmap */
   static FT_Error
-  ft_raster1_render( FT_Renderer     render,
-                     FT_GlyphSlot    slot,
-                     FT_Render_Mode  mode,
-                     FT_Vector*      origin )
+  ft_raster1_render( FT_Renderer       render,
+                     FT_GlyphSlot      slot,
+                     FT_Render_Mode    mode,
+                     const FT_Vector*  origin )
   {
     FT_Error     error;
     FT_Outline*  outline;
index 257b344..8fe191f 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/sfnt Jamfile (c) 2001, 2002, 2004 David Turner
+# FreeType 2 src/sfnt Jamfile
 #
+# Copyright 2001, 2002, 2004, 2005 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) sfnt ;
 
@@ -8,7 +16,7 @@ SubDir  FT2_TOP $(FT2_SRC_DIR) sfnt ;
 
   if $(FT2_MULTI)
   {
-    _sources = sfobjs sfdriver ttcmap0 ttpost ttload ttsbit ;
+    _sources = sfobjs sfdriver ttcmap ttpost ttload ttsbit ttkern ;
   }
   else
   {
index f132385..e15681b 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003 by
+# Copyright 1996-2000, 2002, 2003, 2004, 2005 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -26,9 +26,10 @@ SFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR))
 # SFNT driver sources (i.e., C files)
 #
 SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c   \
-                $(SFNT_DIR)/ttcmap0.c  \
+                $(SFNT_DIR)/ttcmap.c   \
                 $(SFNT_DIR)/ttsbit.c   \
                 $(SFNT_DIR)/ttpost.c   \
+                $(SFNT_DIR)/ttkern.c   \
                 $(SFNT_DIR)/sfobjs.c   \
                 $(SFNT_DIR)/sfdriver.c
 
index 7da53d2..96a312d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level SFNT driver interface (body).                             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -34,7 +34,8 @@
 #include "ttpost.h"
 #endif
 
-#include "ttcmap0.h"
+#include "ttcmap.h"
+#include "ttkern.h"
 
 #include FT_SERVICE_GLYPH_DICT_H
 #include FT_SERVICE_POSTSCRIPT_NAME_H
   }
 
 
+  static FT_Error
+  sfnt_table_info( TT_Face    face,
+                   FT_UInt    idx,
+                   FT_ULong  *tag,
+                   FT_ULong  *length )
+  {
+    if ( !tag || !length )
+      return SFNT_Err_Invalid_Argument;
+
+    if ( idx >= face->num_tables )
+      return SFNT_Err_Table_Missing;
+
+    *tag    = face->dir_tables[idx].Tag;
+    *length = face->dir_tables[idx].Length;
+
+    return SFNT_Err_Ok;
+  }
+
+
   static const FT_Service_SFNT_TableRec  sfnt_service_sfnt_table =
   {
     (FT_SFNT_TableLoadFunc)tt_face_load_any,
-    (FT_SFNT_TableGetFunc) get_sfnt_table
+    (FT_SFNT_TableGetFunc) get_sfnt_table,
+    (FT_SFNT_TableInfoFunc)sfnt_table_info
   };
 
 
     /* see `ttsbit.h' and `sfnt.h' */
     tt_face_set_sbit_strike,
     tt_face_load_sbit_strikes,
-    tt_find_sbit_image,
-    tt_load_sbit_metrics,
+    0 /* tt_find_sbit_image */,
+    0 /* tt_load_sbit_metrics */,
     tt_face_load_sbit_image,
     tt_face_free_sbit_strikes,
 
     0,
     0,
     0,
-    0, 
-    0, 
+    0,
+    0,
     0,
     0,
 
 
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 
+    /* see `ttkern.h' */
+    tt_face_get_kerning,
+
     /* see `ttpost.h' */
     tt_face_get_ps_name,
     tt_face_free_ps_names,
index fd2736b..27f90de 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    SFNT error codes (specification only).                               */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -32,6 +32,8 @@
 #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 90c1bee..798f923 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Single object library component.                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -20,7 +20,8 @@
 
 #include <ft2build.h>
 #include "ttload.c"
-#include "ttcmap0.c"
+#include "ttcmap.c"
+#include "ttkern.c"
 #include "sfobjs.c"
 #include "sfdriver.c"
 
index aef3f5d..e2d2a17 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    SFNT object management (base).                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -19,7 +19,8 @@
 #include <ft2build.h>
 #include "sfobjs.h"
 #include "ttload.h"
-#include "ttcmap0.h"
+#include "ttcmap.h"
+#include "ttkern.h"
 #include FT_INTERNAL_SFNT_H
 #include FT_TRUETYPE_IDS_H
 #include FT_TRUETYPE_TAGS_H
             case TT_MS_ID_SYMBOL_CS:
             case TT_MS_ID_UNICODE_CS:
             case TT_MS_ID_UCS_4:
-              is_english = ( rec->languageID & 0x3FF ) == 0x009;
+              is_english = FT_BOOL( ( rec->languageID & 0x3FF ) == 0x009 );
               found_win  = n;
               break;
 
 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
 
     if ( LOAD_( hdmx )    ||
-         LOAD_( gasp )    ||
-         LOAD_( kerning ) ||
          LOAD_( pclt )    )
       goto Exit;
 
+    /* consider the kerning and gasp tables as optional */
+    (void)LOAD_( gasp );
+    (void)LOAD_( kerning );
+
+    error = SFNT_Err_Ok;
+
     face->root.family_name = tt_face_get_name( face,
-                                               TT_NAME_ID_FONT_FAMILY );
-    face->root.style_name  = tt_face_get_name( face,
-                                               TT_NAME_ID_FONT_SUBFAMILY );
+                                               TT_NAME_ID_PREFERRED_FAMILY );
+    if ( !face->root.family_name )
+      face->root.family_name = tt_face_get_name( face,
+                                                 TT_NAME_ID_FONT_FAMILY );
+
+    face->root.style_name = tt_face_get_name( face,
+                                              TT_NAME_ID_PREFERRED_SUBFAMILY );
+    if ( !face->root.style_name )
+      face->root.style_name  = tt_face_get_name( face,
+                                                 TT_NAME_ID_FONT_SUBFAMILY );
 
     /* now set up root fields */
     {
       FT_Face    root = &face->root;
-      FT_Int32   flags = 0;
-      FT_Memory  memory;
+      FT_Int32   flags = root->face_flags;
 
 
-      memory = root->memory;
-
       /*********************************************************************/
       /*                                                                   */
       /* Compute face flags.                                               */
       /*                                                                   */
       if ( has_outline == TRUE )
-        flags = FT_FACE_FLAG_SCALABLE;    /* scalable outlines */
+        flags |= FT_FACE_FLAG_SCALABLE;    /* scalable outlines */
 
       flags |= FT_FACE_FLAG_SFNT      |   /* SFNT file format  */
                FT_FACE_FLAG_HORIZONTAL;   /* horizontal data   */
       if ( face->vertical_info )
         flags |= FT_FACE_FLAG_VERTICAL;
 
+#if 0
       /* kerning available ? */
-      if ( face->kern_pairs )
+      if ( TT_FACE_HAS_KERNING( face ) )
         flags |= FT_FACE_FLAG_KERNING;
+#endif
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
       /* Don't bother to load the tables unless somebody asks for them. */
       }
 
 
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
-      if ( face->num_sbit_strikes )
-      {
-        FT_ULong  n;
-
-
-        root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
-
-#if 0
-        /* XXX: I don't know criteria whether layout is horizontal */
-        /*      or vertical.                                       */
-        if ( has_outline.... )
-        {
-          ...
-          root->face_flags |= FT_FACE_FLAG_VERTICAL;
-        }
-#endif
-        root->num_fixed_sizes = (FT_Int)face->num_sbit_strikes;
-
-        if ( FT_NEW_ARRAY( root->available_sizes, face->num_sbit_strikes ) )
-          goto Exit;
-
-        for ( n = 0 ; n < face->num_sbit_strikes ; n++ )
-        {
-          FT_Bitmap_Size*  bsize  = root->available_sizes + n;
-          TT_SBit_Strike   strike = face->sbit_strikes + n;
-          FT_UShort        fupem  = face->header.Units_Per_EM;
-          FT_Short         height = (FT_Short)( face->horizontal.Ascender -
-                                                face->horizontal.Descender +
-                                                face->horizontal.Line_Gap );
-          FT_Short         avg    = face->os2.xAvgCharWidth;
-
-
-          /* assume 72dpi */
-          bsize->height =
-            (FT_Short)( ( height * strike->y_ppem + fupem/2 ) / fupem );
-          bsize->width  =
-            (FT_Short)( ( avg * strike->y_ppem + fupem/2 ) / fupem );
-          bsize->size   = strike->y_ppem << 6;
-          bsize->x_ppem = strike->x_ppem << 6;
-          bsize->y_ppem = strike->y_ppem << 6;
-        }
-      }
-      else
-
-#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
-
-      {
-        root->num_fixed_sizes = 0;
-        root->available_sizes = 0;
-      }
-
       /*********************************************************************/
       /*                                                                   */
       /*  Set up metrics.                                                  */
     }
 
     /* freeing the kerning table */
-    FT_FREE( face->kern_pairs );
-    face->num_kern_pairs = 0;
+    tt_face_done_kern( face );
 
     /* freeing the collection table */
     FT_FREE( face->ttc_header.offsets );
     }
 
     /* freeing the horizontal metrics */
+#ifdef FT_OPTIMIZE_MEMORY
+    {
+      FT_Stream  stream = FT_FACE_STREAM( face );
+
+
+      FT_FRAME_RELEASE( face->horz_metrics );
+      FT_FRAME_RELEASE( face->vert_metrics );
+      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 )
diff --git a/reactos/lib/freetype/src/sfnt/ttcmap.c b/reactos/lib/freetype/src/sfnt/ttcmap.c
new file mode 100644 (file)
index 0000000..e095ab4
--- /dev/null
@@ -0,0 +1,2214 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ttcmap.c                                                               */\r
+/*                                                                         */\r
+/*    TrueType character mapping table (cmap) support (body).              */\r
+/*                                                                         */\r
+/*  Copyright 2002, 2003, 2004, 2005 by                                    */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_INTERNAL_DEBUG_H\r
+\r
+#include "sferrors.h"           /* must come before FT_INTERNAL_VALIDATE_H */\r
+\r
+#include FT_INTERNAL_VALIDATE_H\r
+#include FT_INTERNAL_STREAM_H\r
+#include "ttload.h"\r
+#include "ttcmap.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_ttcmap\r
+\r
+\r
+#define TT_PEEK_SHORT   FT_PEEK_SHORT\r
+#define TT_PEEK_USHORT  FT_PEEK_USHORT\r
+#define TT_PEEK_LONG    FT_PEEK_LONG\r
+#define TT_PEEK_ULONG   FT_PEEK_ULONG\r
+\r
+#define TT_NEXT_SHORT   FT_NEXT_SHORT\r
+#define TT_NEXT_USHORT  FT_NEXT_USHORT\r
+#define TT_NEXT_LONG    FT_NEXT_LONG\r
+#define TT_NEXT_ULONG   FT_NEXT_ULONG\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap_init( TT_CMap   cmap,\r
+                FT_Byte*  table )\r
+  {\r
+    cmap->data = table;\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                           FORMAT 0                            *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* TABLE OVERVIEW                                                        */\r
+  /* --------------                                                        */\r
+  /*                                                                       */\r
+  /*   NAME        OFFSET         TYPE          DESCRIPTION                */\r
+  /*                                                                       */\r
+  /*   format      0              USHORT        must be 0                  */\r
+  /*   length      2              USHORT        table length in bytes      */\r
+  /*   language    4              USHORT        Mac language code          */\r
+  /*   glyph_ids   6              BYTE[256]     array of glyph indices     */\r
+  /*               262                                                     */\r
+  /*                                                                       */\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_0\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap0_validate( FT_Byte*      table,\r
+                     FT_Validator  valid )\r
+  {\r
+    FT_Byte*  p      = table + 2;\r
+    FT_UInt   length = TT_NEXT_USHORT( p );\r
+\r
+\r
+    if ( table + length > valid->limit || length < 262 )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    /* check glyph indices whenever necessary */\r
+    if ( valid->level >= FT_VALIDATE_TIGHT )\r
+    {\r
+      FT_UInt  n, idx;\r
+\r
+\r
+      p = table + 6;\r
+      for ( n = 0; n < 256; n++ )\r
+      {\r
+        idx = *p++;\r
+        if ( idx >= TT_VALID_GLYPH_COUNT( valid ) )\r
+          FT_INVALID_GLYPH_ID;\r
+      }\r
+    }\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap0_char_index( TT_CMap    cmap,\r
+                       FT_UInt32  char_code )\r
+  {\r
+    FT_Byte*  table = cmap->data;\r
+\r
+\r
+    return char_code < 256 ? table[6 + char_code] : 0;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap0_char_next( TT_CMap     cmap,\r
+                      FT_UInt32  *pchar_code )\r
+  {\r
+    FT_Byte*   table    = cmap->data;\r
+    FT_UInt32  charcode = *pchar_code;\r
+    FT_UInt32  result   = 0;\r
+    FT_UInt    gindex   = 0;\r
+\r
+\r
+    table += 6;  /* go to glyph ids */\r
+    while ( ++charcode < 256 )\r
+    {\r
+      gindex = table[charcode];\r
+      if ( gindex != 0 )\r
+      {\r
+        result = charcode;\r
+        break;\r
+      }\r
+    }\r
+\r
+    *pchar_code = result;\r
+    return gindex;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap0_get_info( TT_CMap       cmap,\r
+                     TT_CMapInfo  *cmap_info )\r
+  {\r
+    FT_Byte*  p = cmap->data + 4;\r
+\r
+\r
+    cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_TABLE_DEF\r
+  const TT_CMap_ClassRec  tt_cmap0_class_rec =\r
+  {\r
+    {\r
+      sizeof ( TT_CMapRec ),\r
+\r
+      (FT_CMap_InitFunc)     tt_cmap_init,\r
+      (FT_CMap_DoneFunc)     NULL,\r
+      (FT_CMap_CharIndexFunc)tt_cmap0_char_index,\r
+      (FT_CMap_CharNextFunc) tt_cmap0_char_next\r
+    },\r
+    0,\r
+    (TT_CMap_ValidateFunc)   tt_cmap0_validate,\r
+    (TT_CMap_Info_GetFunc)   tt_cmap0_get_info\r
+  };\r
+\r
+#endif /* TT_CONFIG_CMAP_FORMAT_0 */\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                          FORMAT 2                             *****/\r
+  /*****                                                               *****/\r
+  /***** This is used for certain CJK encodings that encode text in a  *****/\r
+  /***** mixed 8/16 bits encoding along the following lines:           *****/\r
+  /*****                                                               *****/\r
+  /***** * Certain byte values correspond to an 8-bit character code   *****/\r
+  /*****   (typically in the range 0..127 for ASCII compatibility).    *****/\r
+  /*****                                                               *****/\r
+  /***** * Certain byte values signal the first byte of a 2-byte       *****/\r
+  /*****   character code (but these values are also valid as the      *****/\r
+  /*****   second byte of a 2-byte character).                         *****/\r
+  /*****                                                               *****/\r
+  /***** The following charmap lookup and iteration functions all      *****/\r
+  /***** assume that the value "charcode" correspond to following:     *****/\r
+  /*****                                                               *****/\r
+  /*****   - For one byte characters, "charcode" is simply the         *****/\r
+  /*****     character code.                                           *****/\r
+  /*****                                                               *****/\r
+  /*****   - For two byte characters, "charcode" is the 2-byte         *****/\r
+  /*****     character code in big endian format.  More exactly:       *****/\r
+  /*****                                                               *****/\r
+  /*****       (charcode >> 8)    is the first byte value              *****/\r
+  /*****       (charcode & 0xFF)  is the second byte value             *****/\r
+  /*****                                                               *****/\r
+  /***** Note that not all values of "charcode" are valid according    *****/\r
+  /***** to these rules, and the function moderately check the         *****/\r
+  /***** arguments.                                                    *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* TABLE OVERVIEW                                                        */\r
+  /* --------------                                                        */\r
+  /*                                                                       */\r
+  /*   NAME        OFFSET         TYPE            DESCRIPTION              */\r
+  /*                                                                       */\r
+  /*   format      0              USHORT          must be 2                */\r
+  /*   length      2              USHORT          table length in bytes    */\r
+  /*   language    4              USHORT          Mac language code        */\r
+  /*   keys        6              USHORT[256]     sub-header keys          */\r
+  /*   subs        518            SUBHEAD[NSUBS]  sub-headers array        */\r
+  /*   glyph_ids   518+NSUB*8     USHORT[]        glyph id array           */\r
+  /*                                                                       */\r
+  /* The `keys' table is used to map charcode high-bytes to sub-headers.   */\r
+  /* The value of `NSUBS' is the number of sub-headers defined in the      */\r
+  /* table and is computed by finding the maximum of the `keys' table.     */\r
+  /*                                                                       */\r
+  /* Note that for any n, `keys[n]' is a byte offset within the `subs'     */\r
+  /* table, i.e., it is the corresponding sub-header index multiplied      */\r
+  /* by 8.                                                                 */\r
+  /*                                                                       */\r
+  /* Each sub-header has the following format:                             */\r
+  /*                                                                       */\r
+  /*   NAME        OFFSET      TYPE            DESCRIPTION                 */\r
+  /*                                                                       */\r
+  /*   first       0           USHORT          first valid low-byte        */\r
+  /*   count       2           USHORT          number of valid low-bytes   */\r
+  /*   delta       4           SHORT           see below                   */\r
+  /*   offset      6           USHORT          see below                   */\r
+  /*                                                                       */\r
+  /* A sub-header defines, for each high-byte, the range of valid          */\r
+  /* low-bytes within the charmap.  Note that the range defined by `first' */\r
+  /* and `count' must be completely included in the interval [0..255]      */\r
+  /* according to the specification.                                       */\r
+  /*                                                                       */\r
+  /* If a character code is contained within a given sub-header, then      */\r
+  /* mapping it to a glyph index is done as follows:                       */\r
+  /*                                                                       */\r
+  /* * The value of `offset' is read.  This is a _byte_ distance from the  */\r
+  /*   location of the `offset' field itself into a slice of the           */\r
+  /*   `glyph_ids' table.  Let's call it `slice' (it's a USHORT[] too).    */\r
+  /*                                                                       */\r
+  /* * The value `slice[char.lo - first]' is read.  If it is 0, there is   */\r
+  /*   no glyph for the charcode.  Otherwise, the value of `delta' is      */\r
+  /*   added to it (modulo 65536) to form a new glyph index.               */\r
+  /*                                                                       */\r
+  /* It is up to the validation routine to check that all offsets fall     */\r
+  /* within the glyph ids table (and not within the `subs' table itself or */\r
+  /* outside of the CMap).                                                 */\r
+  /*                                                                       */\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_2\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap2_validate( FT_Byte*      table,\r
+                     FT_Validator  valid )\r
+  {\r
+    FT_Byte*  p      = table + 2;           /* skip format */\r
+    FT_UInt   length = TT_PEEK_USHORT( p );\r
+    FT_UInt   n, max_subs;\r
+    FT_Byte*  keys;                         /* keys table */\r
+    FT_Byte*  subs;                         /* sub-headers */\r
+    FT_Byte*  glyph_ids;                    /* glyph id array */\r
+\r
+\r
+    if ( table + length > valid->limit || length < 6 + 512 )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    keys = table + 6;\r
+\r
+    /* parse keys to compute sub-headers count */\r
+    p        = keys;\r
+    max_subs = 0;\r
+    for ( n = 0; n < 256; n++ )\r
+    {\r
+      FT_UInt  idx = TT_NEXT_USHORT( p );\r
+\r
+\r
+      /* value must be multiple of 8 */\r
+      if ( valid->level >= FT_VALIDATE_PARANOID && ( idx & 7 ) != 0 )\r
+        FT_INVALID_DATA;\r
+\r
+      idx >>= 3;\r
+\r
+      if ( idx > max_subs )\r
+        max_subs = idx;\r
+    }\r
+\r
+    FT_ASSERT( p == table + 518 );\r
+\r
+    subs      = p;\r
+    glyph_ids = subs + (max_subs + 1) * 8;\r
+    if ( glyph_ids > valid->limit )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    /* parse sub-headers */\r
+    for ( n = 0; n <= max_subs; n++ )\r
+    {\r
+      FT_UInt   first_code, code_count, offset;\r
+      FT_Int    delta;\r
+      FT_Byte*  ids;\r
+\r
+\r
+      first_code = TT_NEXT_USHORT( p );\r
+      code_count = TT_NEXT_USHORT( p );\r
+      delta      = TT_NEXT_SHORT( p );\r
+      offset     = TT_NEXT_USHORT( p );\r
+\r
+      /* check range within 0..255 */\r
+      if ( valid->level >= FT_VALIDATE_PARANOID )\r
+      {\r
+        if ( first_code >= 256 || first_code + code_count > 256 )\r
+          FT_INVALID_DATA;\r
+      }\r
+\r
+      /* check offset */\r
+      if ( offset != 0 )\r
+      {\r
+        ids = p - 2 + offset;\r
+        if ( ids < glyph_ids || ids + code_count*2 > table + length )\r
+          FT_INVALID_OFFSET;\r
+\r
+        /* check glyph ids */\r
+        if ( valid->level >= FT_VALIDATE_TIGHT )\r
+        {\r
+          FT_Byte*  limit = p + code_count * 2;\r
+          FT_UInt   idx;\r
+\r
+\r
+          for ( ; p < limit; )\r
+          {\r
+            idx = TT_NEXT_USHORT( p );\r
+            if ( idx != 0 )\r
+            {\r
+              idx = ( idx + delta ) & 0xFFFFU;\r
+              if ( idx >= TT_VALID_GLYPH_COUNT( valid ) )\r
+                FT_INVALID_GLYPH_ID;\r
+            }\r
+          }\r
+        }\r
+      }\r
+    }\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  /* return sub header corresponding to a given character code */\r
+  /* NULL on invalid charcode                                  */\r
+  static FT_Byte*\r
+  tt_cmap2_get_subheader( FT_Byte*   table,\r
+                          FT_UInt32  char_code )\r
+  {\r
+    FT_Byte*  result = NULL;\r
+\r
+\r
+    if ( char_code < 0x10000UL )\r
+    {\r
+      FT_UInt   char_lo = (FT_UInt)( char_code & 0xFF );\r
+      FT_UInt   char_hi = (FT_UInt)( char_code >> 8 );\r
+      FT_Byte*  p       = table + 6;    /* keys table */\r
+      FT_Byte*  subs    = table + 518;  /* subheaders table */\r
+      FT_Byte*  sub;\r
+\r
+\r
+      if ( char_hi == 0 )\r
+      {\r
+        /* an 8-bit character code -- we use subHeader 0 in this case */\r
+        /* to test whether the character code is in the charmap       */\r
+        /*                                                            */\r
+        sub = subs;  /* jump to first sub-header */\r
+\r
+        /* check that the sub-header for this byte is 0, which */\r
+        /* indicates that it's really a valid one-byte value   */\r
+        /* Otherwise, return 0                                 */\r
+        /*                                                     */\r
+        p += char_lo * 2;\r
+        if ( TT_PEEK_USHORT( p ) != 0 )\r
+          goto Exit;\r
+      }\r
+      else\r
+      {\r
+        /* a 16-bit character code */\r
+\r
+        /* jump to key entry  */\r
+        p  += char_hi * 2;\r
+        /* jump to sub-header */\r
+        sub = subs + ( FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 8 ) );\r
+\r
+        /* check that the high byte isn't a valid one-byte value */\r
+        if ( sub == subs )\r
+          goto Exit;\r
+      }\r
+      result = sub;\r
+    }\r
+  Exit:\r
+    return result;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap2_char_index( TT_CMap    cmap,\r
+                       FT_UInt32  char_code )\r
+  {\r
+    FT_Byte*  table   = cmap->data;\r
+    FT_UInt   result  = 0;\r
+    FT_Byte*  subheader;\r
+\r
+\r
+    subheader = tt_cmap2_get_subheader( table, char_code );\r
+    if ( subheader )\r
+    {\r
+      FT_Byte*  p   = subheader;\r
+      FT_UInt   idx = (FT_UInt)(char_code & 0xFF);\r
+      FT_UInt   start, count;\r
+      FT_Int    delta;\r
+      FT_UInt   offset;\r
+\r
+\r
+      start  = TT_NEXT_USHORT( p );\r
+      count  = TT_NEXT_USHORT( p );\r
+      delta  = TT_NEXT_SHORT ( p );\r
+      offset = TT_PEEK_USHORT( p );\r
+\r
+      idx -= start;\r
+      if ( idx < count && offset != 0 )\r
+      {\r
+        p  += offset + 2 * idx;\r
+        idx = TT_PEEK_USHORT( p );\r
+\r
+        if ( idx != 0 )\r
+          result = (FT_UInt)( idx + delta ) & 0xFFFFU;\r
+      }\r
+    }\r
+    return result;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap2_char_next( TT_CMap     cmap,\r
+                      FT_UInt32  *pcharcode )\r
+  {\r
+    FT_Byte*   table    = cmap->data;\r
+    FT_UInt    gindex   = 0;\r
+    FT_UInt32  result   = 0;\r
+    FT_UInt32  charcode = *pcharcode + 1;\r
+    FT_Byte*   subheader;\r
+\r
+\r
+    while ( charcode < 0x10000UL )\r
+    {\r
+      subheader = tt_cmap2_get_subheader( table, charcode );\r
+      if ( subheader )\r
+      {\r
+        FT_Byte*  p       = subheader;\r
+        FT_UInt   start   = TT_NEXT_USHORT( p );\r
+        FT_UInt   count   = TT_NEXT_USHORT( p );\r
+        FT_Int    delta   = TT_NEXT_SHORT ( p );\r
+        FT_UInt   offset  = TT_PEEK_USHORT( p );\r
+        FT_UInt   char_lo = (FT_UInt)( charcode & 0xFF );\r
+        FT_UInt   pos, idx;\r
+\r
+\r
+        if ( offset == 0 )\r
+          goto Next_SubHeader;\r
+\r
+        if ( char_lo < start )\r
+        {\r
+          char_lo = start;\r
+          pos     = 0;\r
+        }\r
+        else\r
+          pos = (FT_UInt)( char_lo - start );\r
+\r
+        p       += offset + pos * 2;\r
+        charcode = FT_PAD_FLOOR( charcode, 256 ) + char_lo;\r
+\r
+        for ( ; pos < count; pos++, charcode++ )\r
+        {\r
+          idx = TT_NEXT_USHORT( p );\r
+\r
+          if ( idx != 0 )\r
+          {\r
+            gindex = ( idx + delta ) & 0xFFFFU;\r
+            if ( gindex != 0 )\r
+            {\r
+              result = charcode;\r
+              goto Exit;\r
+            }\r
+          }\r
+        }\r
+      }\r
+\r
+      /* jump to next sub-header, i.e. higher byte value */\r
+    Next_SubHeader:\r
+      charcode = FT_PAD_FLOOR( charcode, 256 ) + 256;\r
+    }\r
+\r
+  Exit:\r
+    *pcharcode = result;\r
+\r
+    return gindex;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap2_get_info( TT_CMap       cmap,\r
+                     TT_CMapInfo  *cmap_info )\r
+  {\r
+    FT_Byte*  p = cmap->data + 4;\r
+\r
+\r
+    cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_TABLE_DEF\r
+  const TT_CMap_ClassRec  tt_cmap2_class_rec =\r
+  {\r
+    {\r
+      sizeof ( TT_CMapRec ),\r
+\r
+      (FT_CMap_InitFunc)     tt_cmap_init,\r
+      (FT_CMap_DoneFunc)     NULL,\r
+      (FT_CMap_CharIndexFunc)tt_cmap2_char_index,\r
+      (FT_CMap_CharNextFunc) tt_cmap2_char_next\r
+    },\r
+    2,\r
+    (TT_CMap_ValidateFunc)   tt_cmap2_validate,\r
+    (TT_CMap_Info_GetFunc)   tt_cmap2_get_info\r
+  };\r
+\r
+#endif /* TT_CONFIG_CMAP_FORMAT_2 */\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                           FORMAT 4                            *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* TABLE OVERVIEW                                                        */\r
+  /* --------------                                                        */\r
+  /*                                                                       */\r
+  /*   NAME          OFFSET         TYPE              DESCRIPTION          */\r
+  /*                                                                       */\r
+  /*   format        0              USHORT            must be 4            */\r
+  /*   length        2              USHORT            table length         */\r
+  /*                                                  in bytes             */\r
+  /*   language      4              USHORT            Mac language code    */\r
+  /*                                                                       */\r
+  /*   segCountX2    6              USHORT            2*NUM_SEGS           */\r
+  /*   searchRange   8              USHORT            2*(1 << LOG_SEGS)    */\r
+  /*   entrySelector 10             USHORT            LOG_SEGS             */\r
+  /*   rangeShift    12             USHORT            segCountX2 -         */\r
+  /*                                                    searchRange        */\r
+  /*                                                                       */\r
+  /*   endCount      14             USHORT[NUM_SEGS]  end charcode for     */\r
+  /*                                                  each segment; last   */\r
+  /*                                                  is 0xFFFF            */\r
+  /*                                                                       */\r
+  /*   pad           14+NUM_SEGS*2  USHORT            padding              */\r
+  /*                                                                       */\r
+  /*   startCount    16+NUM_SEGS*2  USHORT[NUM_SEGS]  first charcode for   */\r
+  /*                                                  each segment         */\r
+  /*                                                                       */\r
+  /*   idDelta       16+NUM_SEGS*4  SHORT[NUM_SEGS]   delta for each       */\r
+  /*                                                  segment              */\r
+  /*   idOffset      16+NUM_SEGS*6  SHORT[NUM_SEGS]   range offset for     */\r
+  /*                                                  each segment; can be */\r
+  /*                                                  zero                 */\r
+  /*                                                                       */\r
+  /*   glyphIds      16+NUM_SEGS*8  USHORT[]          array of glyph id    */\r
+  /*                                                  ranges               */\r
+  /*                                                                       */\r
+  /* Character codes are modelled by a series of ordered (increasing)      */\r
+  /* intervals called segments.  Each segment has start and end codes,     */\r
+  /* provided by the `startCount' and `endCount' arrays.  Segments must    */\r
+  /* not be overlapping and the last segment should always contain the     */\r
+  /* `0xFFFF' endCount.                                                    */\r
+  /*                                                                       */\r
+  /* The fields `searchRange', `entrySelector' and `rangeShift' are better */\r
+  /* ignored (they are traces of over-engineering in the TrueType          */\r
+  /* specification).                                                       */\r
+  /*                                                                       */\r
+  /* Each segment also has a signed `delta', as well as an optional offset */\r
+  /* within the `glyphIds' table.                                          */\r
+  /*                                                                       */\r
+  /* If a segment's idOffset is 0, the glyph index corresponding to any    */\r
+  /* charcode within the segment is obtained by adding the value of        */\r
+  /* `idDelta' directly to the charcode, modulo 65536.                     */\r
+  /*                                                                       */\r
+  /* Otherwise, a glyph index is taken from the glyph ids sub-array for    */\r
+  /* the segment, and the value of `idDelta' is added to it.               */\r
+  /*                                                                       */\r
+  /*                                                                       */\r
+  /* Finally, note that certain fonts contain invalid charmaps that        */\r
+  /* contain end=0xFFFF, start=0xFFFF, delta=0x0001, offset=0xFFFF at the  */\r
+  /* of their charmaps (e.g. opens___.ttf which comes with OpenOffice.org) */\r
+  /* we need special code to deal with them correctly...                   */\r
+  /*                                                                       */\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_4\r
+\r
+#define  OPT_CMAP4\r
+\r
+#ifdef OPT_CMAP4\r
+\r
+  typedef struct  TT_CMap4Rec_\r
+  {\r
+    TT_CMapRec  cmap;\r
+    FT_UInt32   old_charcode;   /* old charcode */\r
+    FT_UInt32   cur_charcode;   /* current charcode */\r
+    FT_UInt     cur_gindex;     /* current glyph index */\r
+\r
+    FT_UInt     table_length;\r
+    FT_UInt     num_ranges;\r
+    FT_UInt     cur_range;\r
+    FT_UInt     cur_start;\r
+    FT_UInt     cur_end;\r
+    FT_Int      cur_delta;\r
+    FT_Byte*    cur_values;\r
+\r
+  } TT_CMap4Rec, *TT_CMap4;\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap4_init( TT_CMap4  cmap,\r
+                 FT_Byte*  table )\r
+  {\r
+    FT_Byte*  p;\r
+\r
+\r
+    cmap->cmap.data    = table;\r
+\r
+    p                  = table + 2;\r
+    cmap->table_length = FT_PEEK_USHORT( p );\r
+\r
+    p                  = table + 6;\r
+    cmap->num_ranges   = FT_PEEK_USHORT( p ) >> 1;\r
+    cmap->cur_range    = cmap->num_ranges;\r
+    cmap->old_charcode = 0xFFFFFFFFUL;\r
+    cmap->cur_charcode = 0;\r
+    cmap->cur_gindex   = 0;\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  static FT_Int\r
+  tt_cmap4_set_range( TT_CMap4  cmap,\r
+                      FT_UInt   range_index )\r
+  {\r
+    FT_Byte*  table = cmap->cmap.data;\r
+    FT_Byte*  p;\r
+    FT_UInt   num_ranges = cmap->num_ranges;\r
+\r
+\r
+    while ( range_index < num_ranges )\r
+    {\r
+      FT_UInt  offset;\r
+\r
+\r
+      p             = table + 14 + range_index * 2;\r
+      cmap->cur_end = FT_PEEK_USHORT( p );\r
+\r
+      p              += 2 + num_ranges * 2;\r
+      cmap->cur_start = FT_PEEK_USHORT( p );\r
+\r
+      p              += num_ranges * 2;\r
+      cmap->cur_delta = FT_PEEK_SHORT( p );\r
+\r
+      p     += num_ranges * 2;\r
+      offset = FT_PEEK_USHORT( p );\r
+\r
+      if ( offset != 0xFFFFU )\r
+      {\r
+        cmap->cur_values = offset ? p + offset : NULL;\r
+        cmap->cur_range  = range_index;\r
+        return 0;\r
+      }\r
+\r
+      /* we skip empty segments */\r
+      range_index++;\r
+    }\r
+\r
+    cmap->old_charcode = 0xFFFFFFFFUL;\r
+    cmap->cur_charcode = 0;\r
+    cmap->cur_gindex   = 0;\r
+    cmap->cur_range    = num_ranges;\r
+    return -1;\r
+  }\r
+\r
+\r
+  static void\r
+  tt_cmap4_next( TT_CMap4  cmap )\r
+  {\r
+    FT_UInt  charcode   = cmap->cur_charcode + 1;\r
+\r
+\r
+    cmap->old_charcode = cmap->cur_charcode;\r
+\r
+    for ( ;; )\r
+    {\r
+      FT_Byte*  values = cmap->cur_values;\r
+      FT_UInt   end    = cmap->cur_end;\r
+      FT_Int    delta  = cmap->cur_delta;\r
+\r
+\r
+      if ( charcode <= end )\r
+      {\r
+        if ( values )\r
+        {\r
+          FT_Byte*  p = values + 2 * ( charcode - cmap->cur_start );\r
+\r
+\r
+          do\r
+          {\r
+            FT_UInt  gindex = FT_NEXT_USHORT( p );\r
+\r
+\r
+            if ( gindex != 0 )\r
+            {\r
+              gindex = (FT_UInt)( ( gindex + delta ) & 0xFFFFU );\r
+              if ( gindex != 0 )\r
+              {\r
+                cmap->cur_charcode = charcode;\r
+                cmap->cur_gindex   = gindex;\r
+                return;\r
+              }\r
+            }\r
+          } while ( ++charcode <= end );\r
+        }\r
+        else\r
+        {\r
+          do\r
+          {\r
+            FT_UInt  gindex = (FT_UInt)( ( charcode + delta ) & 0xFFFFU );\r
+\r
+\r
+            if ( gindex != 0 )\r
+            {\r
+              cmap->cur_charcode = charcode;\r
+              cmap->cur_gindex   = gindex;\r
+              return;\r
+            }\r
+          } while ( ++charcode <= end );\r
+        }\r
+      }\r
+\r
+      /* we need to find another range */\r
+      if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 )\r
+        break;\r
+\r
+      charcode = cmap->cur_start;\r
+    }\r
+  }\r
+\r
+\r
+  static void\r
+  tt_cmap4_reset( TT_CMap4  cmap,\r
+                  FT_UInt   code,\r
+                  FT_UInt   range_index )\r
+  {\r
+    if ( tt_cmap4_set_range( cmap, range_index ) >= 0 )\r
+    {\r
+      cmap->cur_charcode = code;\r
+      tt_cmap4_next( cmap );\r
+    }\r
+  }\r
+\r
+#endif /* OPT_CMAP4 */\r
+\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap4_validate( FT_Byte*      table,\r
+                     FT_Validator  valid )\r
+  {\r
+    FT_Byte*  p      = table + 2;               /* skip format */\r
+    FT_UInt   length = TT_NEXT_USHORT( p );\r
+    FT_Byte   *ends, *starts, *offsets, *deltas, *glyph_ids;\r
+    FT_UInt   num_segs;\r
+    FT_Error  error = SFNT_Err_Ok;\r
+\r
+\r
+    /* in certain fonts, the `length' field is invalid and goes */\r
+    /* out of bound.  We try to correct this here...            */\r
+    if ( length < 16 )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    if ( table + length > valid->limit )\r
+    {\r
+      if ( valid->level >= FT_VALIDATE_TIGHT )\r
+        FT_INVALID_TOO_SHORT;\r
+\r
+      length = (FT_UInt)( valid->limit - table );\r
+    }\r
+\r
+    p        = table + 6;\r
+    num_segs = TT_NEXT_USHORT( p );   /* read segCountX2 */\r
+\r
+    if ( valid->level >= FT_VALIDATE_PARANOID )\r
+    {\r
+      /* check that we have an even value here */\r
+      if ( num_segs & 1 )\r
+        FT_INVALID_DATA;\r
+    }\r
+\r
+    num_segs /= 2;\r
+\r
+    /* check the search parameters - even though we never use them */\r
+    /*                                                             */\r
+    if ( valid->level >= FT_VALIDATE_PARANOID )\r
+    {\r
+      /* check the values of 'searchRange', 'entrySelector', 'rangeShift' */\r
+      FT_UInt  search_range   = TT_NEXT_USHORT( p );\r
+      FT_UInt  entry_selector = TT_NEXT_USHORT( p );\r
+      FT_UInt  range_shift    = TT_NEXT_USHORT( p );\r
+\r
+\r
+      if ( ( search_range | range_shift ) & 1 )  /* must be even values */\r
+        FT_INVALID_DATA;\r
+\r
+      search_range /= 2;\r
+      range_shift  /= 2;\r
+\r
+      /* `search range' is the greatest power of 2 that is <= num_segs */\r
+\r
+      if ( search_range                > num_segs                 ||\r
+           search_range * 2            < num_segs                 ||\r
+           search_range + range_shift != num_segs                 ||\r
+           search_range               != ( 1U << entry_selector ) )\r
+        FT_INVALID_DATA;\r
+    }\r
+\r
+    ends      = table   + 14;\r
+    starts    = table   + 16 + num_segs * 2;\r
+    deltas    = starts  + num_segs * 2;\r
+    offsets   = deltas  + num_segs * 2;\r
+    glyph_ids = offsets + num_segs * 2;\r
+\r
+    if ( glyph_ids > table + length )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    /* check last segment, its end count must be FFFF */\r
+    if ( valid->level >= FT_VALIDATE_PARANOID )\r
+    {\r
+      p = ends + ( num_segs - 1 ) * 2;\r
+      if ( TT_PEEK_USHORT( p ) != 0xFFFFU )\r
+        FT_INVALID_DATA;\r
+    }\r
+\r
+    /* check that segments are sorted in increasing order and do not */\r
+    /* overlap; check also the offsets                               */\r
+    {\r
+      FT_UInt  start, end, last = 0, offset, n;\r
+      FT_Int   delta;\r
+\r
+\r
+      for ( n = 0; n < num_segs; n++ )\r
+      {\r
+        p = starts + n * 2;\r
+        start = TT_PEEK_USHORT( p );\r
+        p = ends + n * 2;\r
+        end = TT_PEEK_USHORT( p );\r
+        p = deltas + n * 2;\r
+        delta = TT_PEEK_SHORT( p );\r
+        p = offsets + n * 2;\r
+        offset = TT_PEEK_USHORT( p );\r
+\r
+        if ( start > end )\r
+          FT_INVALID_DATA;\r
+\r
+        /* this test should be performed at default validation level;  */\r
+        /* unfortunately, some popular Asian fonts present overlapping */\r
+        /* ranges in their charmaps                                    */\r
+        /*                                                             */\r
+        if ( n > 0 && start <= last )\r
+        {\r
+          if ( valid->level >= FT_VALIDATE_TIGHT )\r
+            FT_INVALID_DATA;\r
+          else\r
+            error = SFNT_Err_Invalid_CharMap_Format;\r
+        }\r
+\r
+        if ( offset && offset != 0xFFFFU )\r
+        {\r
+          p += offset;  /* start of glyph id array */\r
+\r
+          /* check that we point within the glyph ids table only */\r
+          if ( valid->level >= FT_VALIDATE_TIGHT )\r
+          {\r
+            if ( p < glyph_ids                                ||\r
+                 p + ( end - start + 1 ) * 2 > table + length )\r
+              FT_INVALID_DATA;\r
+          }\r
+          else\r
+          {\r
+            if ( p < glyph_ids                              ||\r
+                 p + ( end - start + 1 ) * 2 > valid->limit )\r
+              FT_INVALID_DATA;\r
+          }\r
+\r
+          /* check glyph indices within the segment range */\r
+          if ( valid->level >= FT_VALIDATE_TIGHT )\r
+          {\r
+            FT_UInt  i, idx;\r
+\r
+\r
+            for ( i = start; i < end; i++ )\r
+            {\r
+              idx = FT_NEXT_USHORT( p );\r
+              if ( idx != 0 )\r
+              {\r
+                idx = (FT_UInt)( idx + delta ) & 0xFFFFU;\r
+\r
+                if ( idx >= TT_VALID_GLYPH_COUNT( valid ) )\r
+                  FT_INVALID_GLYPH_ID;\r
+              }\r
+            }\r
+          }\r
+        }\r
+        else if ( offset == 0xFFFFU )\r
+        {\r
+          /* Some fonts (erroneously?) use a range offset of 0xFFFF */\r
+          /* to mean missing glyph in cmap table                    */\r
+          /*                                                        */\r
+          if ( valid->level >= FT_VALIDATE_PARANOID                     ||\r
+               n != num_segs - 1                                        ||\r
+               !( start == 0xFFFFU && end == 0xFFFFU && delta == 0x1U ) )\r
+            FT_INVALID_DATA;\r
+        }\r
+\r
+        last = end;\r
+      }\r
+    }\r
+\r
+    return error;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap4_char_index( TT_CMap    cmap,\r
+                       FT_UInt32  char_code )\r
+  {\r
+    FT_Byte*  table  = cmap->data;\r
+    FT_UInt   result = 0;\r
+\r
+\r
+    if ( char_code < 0x10000UL )\r
+    {\r
+      FT_UInt   idx, num_segs2;\r
+      FT_Int    delta;\r
+      FT_UInt   code = (FT_UInt)char_code;\r
+      FT_Byte*  p;\r
+\r
+      p         = table + 6;\r
+      num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 );  /* be paranoid! */\r
+\r
+      if ( !cmap->unsorted )\r
+      {\r
+        /* Some fonts have more than 170 segments in their charmaps! */\r
+        /* We changed this function to use a more efficient binary   */\r
+        /* search for improving performance                          */\r
+        FT_UInt  min = 0;\r
+        FT_UInt  max = num_segs2 >> 1;\r
+        FT_UInt  mid, start, end, offset;\r
+\r
+\r
+        while ( min < max )\r
+        {\r
+          mid   = ( min + max ) >> 1;\r
+          p     = table + 14 + mid * 2;\r
+          end   = TT_NEXT_USHORT( p );\r
+          p    += num_segs2;\r
+          start = TT_PEEK_USHORT( p);\r
+\r
+          if ( code < start )\r
+            max = mid;\r
+          else if ( code > end )\r
+            min = mid + 1;\r
+          else\r
+          {\r
+            /* we found the segment */\r
+            idx = code;\r
+\r
+            p += num_segs2;\r
+            delta = TT_PEEK_SHORT( p );\r
+\r
+            p += num_segs2;\r
+            offset = TT_PEEK_USHORT( p );\r
+\r
+            if ( offset == 0xFFFFU )\r
+              goto Exit;\r
+\r
+            if ( offset != 0 )\r
+            {\r
+              p  += offset + 2 * ( idx - start );\r
+              idx = TT_PEEK_USHORT( p );\r
+            }\r
+\r
+            if ( idx != 0 )\r
+              result = (FT_UInt)( idx + delta ) & 0xFFFFU;\r
+\r
+            goto Exit;\r
+          }\r
+        }\r
+      }\r
+      else\r
+      {\r
+        FT_UInt   n;\r
+        FT_Byte*  q;\r
+\r
+\r
+        p = table + 14;               /* ends table   */\r
+        q = table + 16 + num_segs2;   /* starts table */\r
+\r
+\r
+        for ( n = 0; n < num_segs2; n += 2 )\r
+        {\r
+          FT_UInt  end   = TT_NEXT_USHORT( p );\r
+          FT_UInt  start = TT_NEXT_USHORT( q );\r
+          FT_UInt  offset;\r
+\r
+\r
+          if ( code < start )\r
+            break;\r
+\r
+          if ( code <= end )\r
+          {\r
+            idx = code;\r
+\r
+            p = q + num_segs2 - 2;\r
+            delta = TT_PEEK_SHORT( p );\r
+            p += num_segs2;\r
+            offset = TT_PEEK_USHORT( p );\r
+\r
+            if ( offset == 0xFFFFU )\r
+              goto Exit;\r
+\r
+            if ( offset != 0 )\r
+            {\r
+              p  += offset + 2 * ( idx - start );\r
+              idx = TT_PEEK_USHORT( p );\r
+            }\r
+\r
+            if ( idx != 0 )\r
+              result = (FT_UInt)( idx + delta ) & 0xFFFFU;\r
+          }\r
+        }\r
+      }\r
+    }\r
+\r
+  Exit:\r
+    return result;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap4_char_next( TT_CMap     cmap,\r
+                      FT_UInt32  *pchar_code )\r
+  {\r
+    FT_Byte*   table     = cmap->data;\r
+    FT_UInt32  result    = 0;\r
+    FT_UInt    gindex    = 0;\r
+    FT_UInt32  char_code = *pchar_code;\r
+    FT_Byte*   p;\r
+    FT_UInt    code, num_segs2;\r
+\r
+\r
+    if ( char_code >= 0xFFFFUL )\r
+      goto Exit;\r
+\r
+#ifdef OPT_CMAP4\r
+      {\r
+        TT_CMap4  cmap4 = (TT_CMap4)cmap;\r
+\r
+\r
+        if ( char_code == cmap4->old_charcode )\r
+        {\r
+          result = cmap4->cur_charcode;\r
+          gindex = cmap4->cur_gindex;\r
+          if ( result != 0 )\r
+          {\r
+            tt_cmap4_next( cmap4 );\r
+            goto Exit;\r
+          }\r
+        }\r
+      }\r
+#endif /* OPT_CMAP4 */\r
+\r
+    code      = (FT_UInt)char_code + 1;\r
+    p         = table + 6;\r
+    num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); /* ensure even-ness */\r
+\r
+    if ( !cmap->unsorted )\r
+    {\r
+      for (;;)\r
+      {\r
+        /* Some fonts have more than 170 segments in their charmaps! */\r
+        /* We changed this function to use a more efficient binary   */\r
+        /* search                                                    */\r
+        FT_UInt  offset;\r
+        FT_Int   delta;\r
+        FT_UInt  min = 0;\r
+        FT_UInt  max = num_segs2 >> 1;\r
+        FT_UInt  mid, start, end;\r
+        FT_UInt  hi;\r
+\r
+\r
+        /* we begin by finding the segment which end is\r
+           closer to our code point */\r
+        hi = max + 1;\r
+        while ( min < max )\r
+        {\r
+          mid = ( min + max ) >> 1;\r
+          p   = table + 14 + mid * 2;\r
+          end = TT_PEEK_USHORT( p );\r
+\r
+          if ( end < code )\r
+            min = mid + 1;\r
+          else\r
+          {\r
+            hi  = mid;\r
+            max = mid;\r
+          }\r
+        }\r
+\r
+        if ( hi > max )\r
+        {\r
+          /* the point is behind the last segment;\r
+             we will exit right now */\r
+          goto Exit;\r
+        }\r
+\r
+        p   = table + 14 + hi * 2;\r
+        end = TT_PEEK_USHORT( p );\r
+\r
+        p    += 2 + num_segs2;\r
+        start = TT_PEEK_USHORT( p );\r
+\r
+        if ( code < start )\r
+          code = start;\r
+\r
+        p    += num_segs2;\r
+        delta = TT_PEEK_USHORT( p );\r
+\r
+        p     += num_segs2;\r
+        offset = TT_PEEK_USHORT( p );\r
+\r
+        if ( offset != 0 && offset != 0xFFFFU )\r
+        {\r
+          /* parse the glyph ids array for non-zero index */\r
+          p += offset + ( code - start ) * 2;\r
+          while ( code <= end )\r
+          {\r
+            gindex = TT_NEXT_USHORT( p );\r
+            if ( gindex != 0 )\r
+            {\r
+              gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU;\r
+              if ( gindex != 0 )\r
+              {\r
+                result = code;\r
+#ifdef OPT_CMAP4\r
+                tt_cmap4_reset( (TT_CMap4)cmap, code, hi );\r
+#endif\r
+                goto Exit;\r
+              }\r
+            }\r
+            code++;\r
+          }\r
+        }\r
+        else if ( offset == 0xFFFFU )\r
+        {\r
+          /* an offset of 0xFFFF means an empty segment in certain fonts! */\r
+          code = end + 1;\r
+        }\r
+        else  /* offset == 0 */\r
+        {\r
+          gindex = (FT_UInt)( code + delta ) & 0xFFFFU;\r
+          if ( gindex != 0 )\r
+          {\r
+            result = code;\r
+#ifdef OPT_CMAP4\r
+            tt_cmap4_reset( (TT_CMap4)cmap, code, hi );\r
+#endif\r
+            goto Exit;\r
+          }\r
+          code++;\r
+        }\r
+      }\r
+    }\r
+    else\r
+    {\r
+      for ( ;; )\r
+      {\r
+        FT_UInt   offset, n;\r
+        FT_Int    delta;\r
+        FT_Byte*  q;\r
+\r
+\r
+        p = table + 14;              /* ends table  */\r
+        q = table + 16 + num_segs2;  /* starts table */\r
+\r
+        for ( n = 0; n < num_segs2; n += 2 )\r
+        {\r
+          FT_UInt  end   = TT_NEXT_USHORT( p );\r
+          FT_UInt  start = TT_NEXT_USHORT( q );\r
+\r
+\r
+          if ( code < start )\r
+            code = start;\r
+\r
+          if ( code <= end )\r
+          {\r
+            p = q + num_segs2 - 2;\r
+            delta = TT_PEEK_SHORT( p );\r
+            p += num_segs2;\r
+            offset = TT_PEEK_USHORT( p );\r
+\r
+            if ( offset != 0 && offset != 0xFFFFU )\r
+            {\r
+              /* parse the glyph ids array for non-0 index */\r
+              p += offset + ( code - start ) * 2;\r
+              while ( code <= end )\r
+              {\r
+                gindex = TT_NEXT_USHORT( p );\r
+                if ( gindex != 0 )\r
+                {\r
+                  gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU;\r
+                  if ( gindex != 0 )\r
+                    break;\r
+                }\r
+                code++;\r
+              }\r
+            }\r
+            else if ( offset == 0xFFFFU )\r
+            {\r
+              /* an offset of 0xFFFF means an empty glyph in certain fonts! */\r
+              code = end;\r
+              break;\r
+            }\r
+            else\r
+              gindex = (FT_UInt)( code + delta ) & 0xFFFFU;\r
+\r
+            if ( gindex == 0 )\r
+              break;\r
+\r
+            result = code;\r
+            goto Exit;\r
+          }\r
+        }\r
+        /* loop to next trial charcode */\r
+        if ( code >= 0xFFFFU )\r
+          break;\r
+\r
+        code++;\r
+      }\r
+    }\r
+\r
+  Exit:\r
+    *pchar_code = result;\r
+    return gindex;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap4_get_info( TT_CMap       cmap,\r
+                     TT_CMapInfo  *cmap_info )\r
+  {\r
+    FT_Byte*  p = cmap->data + 4;\r
+\r
+\r
+    cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_TABLE_DEF\r
+  const TT_CMap_ClassRec  tt_cmap4_class_rec =\r
+  {\r
+    {\r
+#ifdef OPT_CMAP4\r
+      sizeof ( TT_CMap4Rec ),\r
+      (FT_CMap_InitFunc)     tt_cmap4_init,\r
+#else\r
+      sizeof ( TT_CMapRec ),\r
+      (FT_CMap_InitFunc)     tt_cmap_init,\r
+#endif\r
+      (FT_CMap_DoneFunc)     NULL,\r
+      (FT_CMap_CharIndexFunc)tt_cmap4_char_index,\r
+      (FT_CMap_CharNextFunc) tt_cmap4_char_next\r
+    },\r
+    4,\r
+    (TT_CMap_ValidateFunc)   tt_cmap4_validate,\r
+    (TT_CMap_Info_GetFunc)   tt_cmap4_get_info\r
+  };\r
+\r
+#endif /* TT_CONFIG_CMAP_FORMAT_4 */\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                          FORMAT 6                             *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* TABLE OVERVIEW                                                        */\r
+  /* --------------                                                        */\r
+  /*                                                                       */\r
+  /*   NAME        OFFSET          TYPE             DESCRIPTION            */\r
+  /*                                                                       */\r
+  /*   format       0              USHORT           must be 4              */\r
+  /*   length       2              USHORT           table length in bytes  */\r
+  /*   language     4              USHORT           Mac language code      */\r
+  /*                                                                       */\r
+  /*   first        6              USHORT           first segment code     */\r
+  /*   count        8              USHORT           segment size in chars  */\r
+  /*   glyphIds     10             USHORT[count]    glyph ids              */\r
+  /*                                                                       */\r
+  /* A very simplified segment mapping.                                    */\r
+  /*                                                                       */\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_6\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap6_validate( FT_Byte*      table,\r
+                     FT_Validator  valid )\r
+  {\r
+    FT_Byte*  p;\r
+    FT_UInt   length, count;\r
+\r
+\r
+    if ( table + 10 > valid->limit )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    p      = table + 2;\r
+    length = TT_NEXT_USHORT( p );\r
+\r
+    p      = table + 8;             /* skip language and start index */\r
+    count  = TT_NEXT_USHORT( p );\r
+\r
+    if ( table + length > valid->limit || length < 10 + count * 2 )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    /* check glyph indices */\r
+    if ( valid->level >= FT_VALIDATE_TIGHT )\r
+    {\r
+      FT_UInt  gindex;\r
+\r
+\r
+      for ( ; count > 0; count-- )\r
+      {\r
+        gindex = TT_NEXT_USHORT( p );\r
+        if ( gindex >= TT_VALID_GLYPH_COUNT( valid ) )\r
+          FT_INVALID_GLYPH_ID;\r
+      }\r
+    }\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap6_char_index( TT_CMap    cmap,\r
+                       FT_UInt32  char_code )\r
+  {\r
+    FT_Byte*  table  = cmap->data;\r
+    FT_UInt   result = 0;\r
+    FT_Byte*  p      = table + 6;\r
+    FT_UInt   start  = TT_NEXT_USHORT( p );\r
+    FT_UInt   count  = TT_NEXT_USHORT( p );\r
+    FT_UInt   idx    = (FT_UInt)( char_code - start );\r
+\r
+\r
+    if ( idx < count )\r
+    {\r
+      p += 2 * idx;\r
+      result = TT_PEEK_USHORT( p );\r
+    }\r
+    return result;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap6_char_next( TT_CMap     cmap,\r
+                      FT_UInt32  *pchar_code )\r
+  {\r
+    FT_Byte*   table     = cmap->data;\r
+    FT_UInt32  result    = 0;\r
+    FT_UInt32  char_code = *pchar_code + 1;\r
+    FT_UInt    gindex    = 0;\r
+\r
+    FT_Byte*   p         = table + 6;\r
+    FT_UInt    start     = TT_NEXT_USHORT( p );\r
+    FT_UInt    count     = TT_NEXT_USHORT( p );\r
+    FT_UInt    idx;\r
+\r
+\r
+    if ( char_code >= 0x10000UL )\r
+      goto Exit;\r
+\r
+    if ( char_code < start )\r
+      char_code = start;\r
+\r
+    idx = (FT_UInt)( char_code - start );\r
+    p  += 2 * idx;\r
+\r
+    for ( ; idx < count; idx++ )\r
+    {\r
+      gindex = TT_NEXT_USHORT( p );\r
+      if ( gindex != 0 )\r
+      {\r
+        result = char_code;\r
+        break;\r
+      }\r
+      char_code++;\r
+    }\r
+\r
+  Exit:\r
+    *pchar_code = result;\r
+    return gindex;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap6_get_info( TT_CMap       cmap,\r
+                     TT_CMapInfo  *cmap_info )\r
+  {\r
+    FT_Byte*  p = cmap->data + 4;\r
+\r
+\r
+    cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_TABLE_DEF\r
+  const TT_CMap_ClassRec  tt_cmap6_class_rec =\r
+  {\r
+    {\r
+      sizeof ( TT_CMapRec ),\r
+\r
+      (FT_CMap_InitFunc)     tt_cmap_init,\r
+      (FT_CMap_DoneFunc)     NULL,\r
+      (FT_CMap_CharIndexFunc)tt_cmap6_char_index,\r
+      (FT_CMap_CharNextFunc) tt_cmap6_char_next\r
+    },\r
+    6,\r
+    (TT_CMap_ValidateFunc)   tt_cmap6_validate,\r
+    (TT_CMap_Info_GetFunc)   tt_cmap6_get_info\r
+  };\r
+\r
+#endif /* TT_CONFIG_CMAP_FORMAT_6 */\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                          FORMAT 8                             *****/\r
+  /*****                                                               *****/\r
+  /***** It's hard to completely understand what the OpenType spec     *****/\r
+  /***** says about this format, but here is my conclusion.            *****/\r
+  /*****                                                               *****/\r
+  /***** The purpose of this format is to easily map UTF-16 text to    *****/\r
+  /***** glyph indices.  Basically, the `char_code' must be in one of  *****/\r
+  /***** the following formats:                                        *****/\r
+  /*****                                                               *****/\r
+  /*****   - A 16-bit value that isn't part of the Unicode Surrogates  *****/\r
+  /*****     Area (i.e. U+D800-U+DFFF).                                *****/\r
+  /*****                                                               *****/\r
+  /*****   - A 32-bit value, made of two surrogate values, i.e.. if    *****/\r
+  /*****     `char_code = (char_hi << 16) | char_lo', then both        *****/\r
+  /*****     `char_hi' and `char_lo' must be in the Surrogates Area.   *****/\r
+  /*****      Area.                                                    *****/\r
+  /*****                                                               *****/\r
+  /***** The 'is32' table embedded in the charmap indicates whether a  *****/\r
+  /***** given 16-bit value is in the surrogates area or not.          *****/\r
+  /*****                                                               *****/\r
+  /***** So, for any given `char_code', we can assert the following:   *****/\r
+  /*****                                                               *****/\r
+  /*****   If `char_hi == 0' then we must have `is32[char_lo] == 0'.   *****/\r
+  /*****                                                               *****/\r
+  /*****   If `char_hi != 0' then we must have both                    *****/\r
+  /*****   `is32[char_hi] != 0' and `is32[char_lo] != 0'.              *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* TABLE OVERVIEW                                                        */\r
+  /* --------------                                                        */\r
+  /*                                                                       */\r
+  /*   NAME        OFFSET         TYPE        DESCRIPTION                  */\r
+  /*                                                                       */\r
+  /*   format      0              USHORT      must be 8                    */\r
+  /*   reseved     2              USHORT      reserved                     */\r
+  /*   length      4              ULONG       length in bytes              */\r
+  /*   language    8              ULONG       Mac language code            */\r
+  /*   is32        12             BYTE[8192]  32-bitness bitmap            */\r
+  /*   count       8204           ULONG       number of groups             */\r
+  /*                                                                       */\r
+  /* This header is followed by 'count' groups of the following format:    */\r
+  /*                                                                       */\r
+  /*   start       0              ULONG       first charcode               */\r
+  /*   end         4              ULONG       last charcode                */\r
+  /*   startId     8              ULONG       start glyph id for the group */\r
+  /*                                                                       */\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_8\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap8_validate( FT_Byte*      table,\r
+                     FT_Validator  valid )\r
+  {\r
+    FT_Byte*   p = table + 4;\r
+    FT_Byte*   is32;\r
+    FT_UInt32  length;\r
+    FT_UInt32  num_groups;\r
+\r
+\r
+    if ( table + 16 + 8192 > valid->limit )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    length = TT_NEXT_ULONG( p );\r
+    if ( table + length > valid->limit || length < 8208 )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    is32       = table + 12;\r
+    p          = is32  + 8192;          /* skip `is32' array */\r
+    num_groups = TT_NEXT_ULONG( p );\r
+\r
+    if ( p + num_groups * 12 > valid->limit )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    /* check groups, they must be in increasing order */\r
+    {\r
+      FT_UInt32  n, start, end, start_id, count, last = 0;\r
+\r
+\r
+      for ( n = 0; n < num_groups; n++ )\r
+      {\r
+        FT_UInt   hi, lo;\r
+\r
+\r
+        start    = TT_NEXT_ULONG( p );\r
+        end      = TT_NEXT_ULONG( p );\r
+        start_id = TT_NEXT_ULONG( p );\r
+\r
+        if ( start > end )\r
+          FT_INVALID_DATA;\r
+\r
+        if ( n > 0 && start <= last )\r
+          FT_INVALID_DATA;\r
+\r
+        if ( valid->level >= FT_VALIDATE_TIGHT )\r
+        {\r
+          if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) )\r
+            FT_INVALID_GLYPH_ID;\r
+\r
+          count = (FT_UInt32)( end - start + 1 );\r
+\r
+          if ( start & ~0xFFFFU )\r
+          {\r
+            /* start_hi != 0; check that is32[i] is 1 for each i in */\r
+            /* the `hi' and `lo' of the range [start..end]          */\r
+            for ( ; count > 0; count--, start++ )\r
+            {\r
+              hi = (FT_UInt)( start >> 16 );\r
+              lo = (FT_UInt)( start & 0xFFFFU );\r
+\r
+              if ( (is32[hi >> 3] & ( 0x80 >> ( hi & 7 ) ) ) == 0 )\r
+                FT_INVALID_DATA;\r
+\r
+              if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) == 0 )\r
+                FT_INVALID_DATA;\r
+            }\r
+          }\r
+          else\r
+          {\r
+            /* start_hi == 0; check that is32[i] is 0 for each i in */\r
+            /* the range [start..end]                               */\r
+\r
+            /* end_hi cannot be != 0! */\r
+            if ( end & ~0xFFFFU )\r
+              FT_INVALID_DATA;\r
+\r
+            for ( ; count > 0; count--, start++ )\r
+            {\r
+              lo = (FT_UInt)( start & 0xFFFFU );\r
+\r
+              if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) != 0 )\r
+                FT_INVALID_DATA;\r
+            }\r
+          }\r
+        }\r
+\r
+        last = end;\r
+      }\r
+    }\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap8_char_index( TT_CMap    cmap,\r
+                       FT_UInt32  char_code )\r
+  {\r
+    FT_Byte*   table      = cmap->data;\r
+    FT_UInt    result     = 0;\r
+    FT_Byte*   p          = table + 8204;\r
+    FT_UInt32  num_groups = TT_NEXT_ULONG( p );\r
+    FT_UInt32  start, end, start_id;\r
+\r
+\r
+    for ( ; num_groups > 0; num_groups-- )\r
+    {\r
+      start    = TT_NEXT_ULONG( p );\r
+      end      = TT_NEXT_ULONG( p );\r
+      start_id = TT_NEXT_ULONG( p );\r
+\r
+      if ( char_code < start )\r
+        break;\r
+\r
+      if ( char_code <= end )\r
+      {\r
+        result = (FT_UInt)( start_id + char_code - start );\r
+        break;\r
+      }\r
+    }\r
+    return result;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap8_char_next( TT_CMap     cmap,\r
+                      FT_UInt32  *pchar_code )\r
+  {\r
+    FT_UInt32  result     = 0;\r
+    FT_UInt32  char_code  = *pchar_code + 1;\r
+    FT_UInt    gindex     = 0;\r
+    FT_Byte*   table      = cmap->data;\r
+    FT_Byte*   p          = table + 8204;\r
+    FT_UInt32  num_groups = TT_NEXT_ULONG( p );\r
+    FT_UInt32  start, end, start_id;\r
+\r
+\r
+    p = table + 8208;\r
+\r
+    for ( ; num_groups > 0; num_groups-- )\r
+    {\r
+      start    = TT_NEXT_ULONG( p );\r
+      end      = TT_NEXT_ULONG( p );\r
+      start_id = TT_NEXT_ULONG( p );\r
+\r
+      if ( char_code < start )\r
+        char_code = start;\r
+\r
+      if ( char_code <= end )\r
+      {\r
+        gindex = (FT_UInt)( char_code - start + start_id );\r
+        if ( gindex != 0 )\r
+        {\r
+          result = char_code;\r
+          goto Exit;\r
+        }\r
+      }\r
+    }\r
+\r
+  Exit:\r
+    *pchar_code = result;\r
+    return gindex;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap8_get_info( TT_CMap       cmap,\r
+                     TT_CMapInfo  *cmap_info )\r
+  {\r
+    FT_Byte*  p = cmap->data + 8;\r
+\r
+\r
+    cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_TABLE_DEF\r
+  const TT_CMap_ClassRec  tt_cmap8_class_rec =\r
+  {\r
+    {\r
+      sizeof ( TT_CMapRec ),\r
+\r
+      (FT_CMap_InitFunc)     tt_cmap_init,\r
+      (FT_CMap_DoneFunc)     NULL,\r
+      (FT_CMap_CharIndexFunc)tt_cmap8_char_index,\r
+      (FT_CMap_CharNextFunc) tt_cmap8_char_next\r
+    },\r
+    8,\r
+    (TT_CMap_ValidateFunc)   tt_cmap8_validate,\r
+    (TT_CMap_Info_GetFunc)   tt_cmap8_get_info\r
+  };\r
+\r
+#endif /* TT_CONFIG_CMAP_FORMAT_8 */\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                          FORMAT 10                            *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* TABLE OVERVIEW                                                        */\r
+  /* --------------                                                        */\r
+  /*                                                                       */\r
+  /*   NAME      OFFSET  TYPE               DESCRIPTION                    */\r
+  /*                                                                       */\r
+  /*   format     0      USHORT             must be 10                     */\r
+  /*   reserved   2      USHORT             reserved                       */\r
+  /*   length     4      ULONG              length in bytes                */\r
+  /*   language   8      ULONG              Mac language code              */\r
+  /*                                                                       */\r
+  /*   start     12      ULONG              first char in range            */\r
+  /*   count     16      ULONG              number of chars in range       */\r
+  /*   glyphIds  20      USHORT[count]      glyph indices covered          */\r
+  /*                                                                       */\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_10\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap10_validate( FT_Byte*      table,\r
+                      FT_Validator  valid )\r
+  {\r
+    FT_Byte*  p = table + 4;\r
+    FT_ULong  length, count;\r
+\r
+\r
+    if ( table + 20 > valid->limit )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    length = TT_NEXT_ULONG( p );\r
+    p      = table + 16;\r
+    count  = TT_NEXT_ULONG( p );\r
+\r
+    if ( table + length > valid->limit || length < 20 + count * 2 )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    /* check glyph indices */\r
+    if ( valid->level >= FT_VALIDATE_TIGHT )\r
+    {\r
+      FT_UInt  gindex;\r
+\r
+\r
+      for ( ; count > 0; count-- )\r
+      {\r
+        gindex = TT_NEXT_USHORT( p );\r
+        if ( gindex >= TT_VALID_GLYPH_COUNT( valid ) )\r
+          FT_INVALID_GLYPH_ID;\r
+      }\r
+    }\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap10_char_index( TT_CMap    cmap,\r
+                        FT_UInt32  char_code )\r
+  {\r
+    FT_Byte*   table  = cmap->data;\r
+    FT_UInt    result = 0;\r
+    FT_Byte*   p      = table + 12;\r
+    FT_UInt32  start  = TT_NEXT_ULONG( p );\r
+    FT_UInt32  count  = TT_NEXT_ULONG( p );\r
+    FT_UInt32  idx    = (FT_ULong)( char_code - start );\r
+\r
+\r
+    if ( idx < count )\r
+    {\r
+      p     += 2 * idx;\r
+      result = TT_PEEK_USHORT( p );\r
+    }\r
+    return result;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap10_char_next( TT_CMap     cmap,\r
+                       FT_UInt32  *pchar_code )\r
+  {\r
+    FT_Byte*   table     = cmap->data;\r
+    FT_UInt32  char_code = *pchar_code + 1;\r
+    FT_UInt    gindex    = 0;\r
+    FT_Byte*   p         = table + 12;\r
+    FT_UInt32  start     = TT_NEXT_ULONG( p );\r
+    FT_UInt32  count     = TT_NEXT_ULONG( p );\r
+    FT_UInt32  idx;\r
+\r
+\r
+    if ( char_code < start )\r
+      char_code = start;\r
+\r
+    idx = (FT_UInt32)( char_code - start );\r
+    p  += 2 * idx;\r
+\r
+    for ( ; idx < count; idx++ )\r
+    {\r
+      gindex = TT_NEXT_USHORT( p );\r
+      if ( gindex != 0 )\r
+        break;\r
+      char_code++;\r
+    }\r
+\r
+    *pchar_code = char_code;\r
+    return gindex;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap10_get_info( TT_CMap       cmap,\r
+                      TT_CMapInfo  *cmap_info )\r
+  {\r
+    FT_Byte*  p = cmap->data + 8;\r
+\r
+\r
+    cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_TABLE_DEF\r
+  const TT_CMap_ClassRec  tt_cmap10_class_rec =\r
+  {\r
+    {\r
+      sizeof ( TT_CMapRec ),\r
+\r
+      (FT_CMap_InitFunc)     tt_cmap_init,\r
+      (FT_CMap_DoneFunc)     NULL,\r
+      (FT_CMap_CharIndexFunc)tt_cmap10_char_index,\r
+      (FT_CMap_CharNextFunc) tt_cmap10_char_next\r
+    },\r
+    10,\r
+    (TT_CMap_ValidateFunc)   tt_cmap10_validate,\r
+    (TT_CMap_Info_GetFunc)   tt_cmap10_get_info\r
+  };\r
+\r
+#endif /* TT_CONFIG_CMAP_FORMAT_10 */\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                          FORMAT 12                            *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* TABLE OVERVIEW                                                        */\r
+  /* --------------                                                        */\r
+  /*                                                                       */\r
+  /*   NAME        OFFSET     TYPE       DESCRIPTION                       */\r
+  /*                                                                       */\r
+  /*   format      0          USHORT     must be 12                        */\r
+  /*   reserved    2          USHORT     reserved                          */\r
+  /*   length      4          ULONG      length in bytes                   */\r
+  /*   language    8          ULONG      Mac language code                 */\r
+  /*   count       12         ULONG      number of groups                  */\r
+  /*               16                                                      */\r
+  /*                                                                       */\r
+  /* This header is followed by `count' groups of the following format:    */\r
+  /*                                                                       */\r
+  /*   start       0          ULONG      first charcode                    */\r
+  /*   end         4          ULONG      last charcode                     */\r
+  /*   startId     8          ULONG      start glyph id for the group      */\r
+  /*                                                                       */\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_12\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap12_validate( FT_Byte*      table,\r
+                      FT_Validator  valid )\r
+  {\r
+    FT_Byte*   p;\r
+    FT_ULong   length;\r
+    FT_ULong   num_groups;\r
+\r
+\r
+    if ( table + 16 > valid->limit )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    p      = table + 4;\r
+    length = TT_NEXT_ULONG( p );\r
+\r
+    p          = table + 12;\r
+    num_groups = TT_NEXT_ULONG( p );\r
+\r
+    if ( table + length > valid->limit || length < 16 + 12 * num_groups )\r
+      FT_INVALID_TOO_SHORT;\r
+\r
+    /* check groups, they must be in increasing order */\r
+    {\r
+      FT_ULong  n, start, end, start_id, last = 0;\r
+\r
+\r
+      for ( n = 0; n < num_groups; n++ )\r
+      {\r
+        start    = TT_NEXT_ULONG( p );\r
+        end      = TT_NEXT_ULONG( p );\r
+        start_id = TT_NEXT_ULONG( p );\r
+\r
+        if ( start > end )\r
+          FT_INVALID_DATA;\r
+\r
+        if ( n > 0 && start <= last )\r
+          FT_INVALID_DATA;\r
+\r
+        if ( valid->level >= FT_VALIDATE_TIGHT )\r
+        {\r
+          if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) )\r
+            FT_INVALID_GLYPH_ID;\r
+        }\r
+\r
+        last = end;\r
+      }\r
+    }\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap12_char_index( TT_CMap    cmap,\r
+                        FT_UInt32  char_code )\r
+  {\r
+    FT_UInt    result     = 0;\r
+    FT_Byte*   table      = cmap->data;\r
+    FT_Byte*   p          = table + 12;\r
+    FT_UInt32  num_groups = TT_NEXT_ULONG( p );\r
+    FT_UInt32  start, end, start_id;\r
+\r
+\r
+    for ( ; num_groups > 0; num_groups-- )\r
+    {\r
+      start    = TT_NEXT_ULONG( p );\r
+      end      = TT_NEXT_ULONG( p );\r
+      start_id = TT_NEXT_ULONG( p );\r
+\r
+      if ( char_code < start )\r
+        break;\r
+\r
+      if ( char_code <= end )\r
+      {\r
+        result = (FT_UInt)( start_id + char_code - start );\r
+        break;\r
+      }\r
+    }\r
+    return result;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_UInt )\r
+  tt_cmap12_char_next( TT_CMap     cmap,\r
+                       FT_UInt32  *pchar_code )\r
+  {\r
+    FT_Byte*   table      = cmap->data;\r
+    FT_UInt32  result     = 0;\r
+    FT_UInt32  char_code  = *pchar_code + 1;\r
+    FT_UInt    gindex     = 0;\r
+    FT_Byte*   p          = table + 12;\r
+    FT_UInt32  num_groups = TT_NEXT_ULONG( p );\r
+    FT_UInt32  start, end, start_id;\r
+\r
+\r
+    p = table + 16;\r
+\r
+    for ( ; num_groups > 0; num_groups-- )\r
+    {\r
+      start    = TT_NEXT_ULONG( p );\r
+      end      = TT_NEXT_ULONG( p );\r
+      start_id = TT_NEXT_ULONG( p );\r
+\r
+      if ( char_code < start )\r
+        char_code = start;\r
+\r
+      if ( char_code <= end )\r
+      {\r
+        gindex = (FT_UInt)(char_code - start + start_id);\r
+        if ( gindex != 0 )\r
+        {\r
+          result = char_code;\r
+          goto Exit;\r
+        }\r
+      }\r
+    }\r
+\r
+  Exit:\r
+    *pchar_code = result;\r
+    return gindex;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( FT_Error )\r
+  tt_cmap12_get_info( TT_CMap       cmap,\r
+                      TT_CMapInfo  *cmap_info )\r
+  {\r
+    FT_Byte*  p = cmap->data + 8;\r
+\r
+\r
+    cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_TABLE_DEF\r
+  const TT_CMap_ClassRec  tt_cmap12_class_rec =\r
+  {\r
+    {\r
+      sizeof ( TT_CMapRec ),\r
+\r
+      (FT_CMap_InitFunc)     tt_cmap_init,\r
+      (FT_CMap_DoneFunc)     NULL,\r
+      (FT_CMap_CharIndexFunc)tt_cmap12_char_index,\r
+      (FT_CMap_CharNextFunc) tt_cmap12_char_next\r
+    },\r
+    12,\r
+    (TT_CMap_ValidateFunc)   tt_cmap12_validate,\r
+    (TT_CMap_Info_GetFunc)   tt_cmap12_get_info\r
+  };\r
+\r
+\r
+#endif /* TT_CONFIG_CMAP_FORMAT_12 */\r
+\r
+\r
+  static const TT_CMap_Class  tt_cmap_classes[] =\r
+  {\r
+#ifdef TT_CONFIG_CMAP_FORMAT_0\r
+    &tt_cmap0_class_rec,\r
+#endif\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_2\r
+    &tt_cmap2_class_rec,\r
+#endif\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_4\r
+    &tt_cmap4_class_rec,\r
+#endif\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_6\r
+    &tt_cmap6_class_rec,\r
+#endif\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_8\r
+    &tt_cmap8_class_rec,\r
+#endif\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_10\r
+    &tt_cmap10_class_rec,\r
+#endif\r
+\r
+#ifdef TT_CONFIG_CMAP_FORMAT_12\r
+    &tt_cmap12_class_rec,\r
+#endif\r
+\r
+    NULL,\r
+  };\r
+\r
+\r
+  /* parse the `cmap' table and build the corresponding TT_CMap objects */\r
+  /* in the current face                                                */\r
+  /*                                                                    */\r
+  FT_LOCAL_DEF( FT_Error )\r
+  tt_face_build_cmaps( TT_Face  face )\r
+  {\r
+    FT_Byte*           table = face->cmap_table;\r
+    FT_Byte*           limit = table + face->cmap_size;\r
+    FT_UInt volatile   num_cmaps;\r
+    FT_Byte* volatile  p     = table;\r
+\r
+\r
+    if ( p + 4 > limit )\r
+      return SFNT_Err_Invalid_Table;\r
+\r
+    /* only recognize format 0 */\r
+    if ( TT_NEXT_USHORT( p ) != 0 )\r
+    {\r
+      p -= 2;\r
+      FT_ERROR(( "tt_face_build_cmaps: unsupported `cmap' table format = %d\n",\r
+                 TT_PEEK_USHORT( p ) ));\r
+      return SFNT_Err_Invalid_Table;\r
+    }\r
+\r
+    num_cmaps = TT_NEXT_USHORT( p );\r
+\r
+    for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- )\r
+    {\r
+      FT_CharMapRec  charmap;\r
+      FT_UInt32      offset;\r
+\r
+\r
+      charmap.platform_id = TT_NEXT_USHORT( p );\r
+      charmap.encoding_id = TT_NEXT_USHORT( p );\r
+      charmap.face        = FT_FACE( face );\r
+      charmap.encoding    = FT_ENCODING_NONE;  /* will be filled later */\r
+      offset              = TT_NEXT_ULONG( p );\r
+\r
+      if ( offset                     &&\r
+           table + offset + 2 < limit &&\r
+           table + offset >= table    )\r
+      {\r
+        FT_Byte*                       cmap   = table + offset;\r
+        volatile FT_UInt               format = TT_PEEK_USHORT( cmap );\r
+        const TT_CMap_Class* volatile  pclazz = tt_cmap_classes;\r
+        TT_CMap_Class                  clazz;\r
+\r
+\r
+        for ( ; *pclazz; pclazz++ )\r
+        {\r
+          clazz = *pclazz;\r
+          if ( clazz->format == format )\r
+          {\r
+            volatile TT_ValidatorRec  valid;\r
+            FT_Error                  error = SFNT_Err_Ok;\r
+\r
+\r
+            ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit,\r
+                               FT_VALIDATE_DEFAULT );\r
+\r
+            valid.num_glyphs = (FT_UInt)face->root.num_glyphs;\r
+\r
+            if ( ft_setjmp( FT_VALIDATOR( &valid )->jump_buffer ) == 0 )\r
+            {\r
+              /* validate this cmap sub-table */\r
+              error = clazz->validate( cmap, FT_VALIDATOR( &valid ) );\r
+            }\r
+\r
+            if ( valid.validator.error == 0 )\r
+            {\r
+              (void)FT_CMap_New( (FT_CMap_Class)clazz, cmap, &charmap, NULL );\r
+\r
+              /* it is simpler to directly set the `unsorted' flag instead */\r
+              /* of adding a parameter to FT_CMap_New                      */\r
+              ((TT_CMap)(face->root.charmaps\r
+                          [face->root.num_charmaps - 1]))->unsorted =\r
+                FT_BOOL( error );\r
+            }\r
+            else\r
+            {\r
+              FT_ERROR(( "tt_face_build_cmaps:" ));\r
+              FT_ERROR(( " broken cmap sub-table ignored!\n" ));\r
+            }\r
+            break;\r
+          }\r
+        }\r
+      }\r
+    }\r
+\r
+    return SFNT_Err_Ok;\r
+  }\r
+\r
+\r
+  FT_LOCAL( FT_Error )\r
+  tt_get_cmap_info( FT_CharMap    charmap,\r
+                    TT_CMapInfo  *cmap_info )\r
+  {\r
+    FT_CMap        cmap  = (FT_CMap)charmap;\r
+    TT_CMap_Class  clazz = (TT_CMap_Class)cmap->clazz;\r
+\r
+\r
+    return clazz->get_cmap_info( charmap, cmap_info );\r
+  }\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/sfnt/ttcmap.h b/reactos/lib/freetype/src/sfnt/ttcmap.h
new file mode 100644 (file)
index 0000000..6db691e
--- /dev/null
@@ -0,0 +1,81 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ttcmap.h                                                               */\r
+/*                                                                         */\r
+/*    TrueType character mapping table (cmap) support (specification).     */\r
+/*                                                                         */\r
+/*  Copyright 2002, 2003, 2004, 2005 by                                    */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __TTCMAP_H__\r
+#define __TTCMAP_H__\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_INTERNAL_TRUETYPE_TYPES_H\r
+#include FT_INTERNAL_VALIDATE_H\r
+#include FT_SERVICE_TT_CMAP_H\r
+\r
+FT_BEGIN_HEADER\r
+\r
+  typedef struct  TT_CMapRec_\r
+  {\r
+    FT_CMapRec  cmap;\r
+    FT_Byte*    data;           /* pointer to in-memory cmap table */\r
+    FT_Bool     unsorted;       /* for format 4 only               */\r
+\r
+  } TT_CMapRec, *TT_CMap;\r
+\r
+  typedef const struct TT_CMap_ClassRec_*  TT_CMap_Class;\r
+\r
+\r
+  typedef FT_Error\r
+  (*TT_CMap_ValidateFunc)( FT_Byte*      data,\r
+                           FT_Validator  valid );\r
+\r
+  typedef struct  TT_CMap_ClassRec_\r
+  {\r
+    FT_CMap_ClassRec      clazz;\r
+    FT_UInt               format;\r
+    TT_CMap_ValidateFunc  validate;\r
+    TT_CMap_Info_GetFunc  get_cmap_info;\r
+\r
+  } TT_CMap_ClassRec;\r
+\r
+\r
+  typedef struct  TT_ValidatorRec_\r
+  {\r
+    FT_ValidatorRec  validator;\r
+    FT_UInt          num_glyphs;\r
+\r
+  } TT_ValidatorRec, *TT_Validator;\r
+\r
+\r
+#define TT_VALIDATOR( x )          ((TT_Validator)( x ))\r
+#define TT_VALID_GLYPH_COUNT( x )  TT_VALIDATOR( x )->num_glyphs\r
+\r
+\r
+  FT_LOCAL( FT_Error )\r
+  tt_face_build_cmaps( TT_Face  face );\r
+\r
+  /* used in tt-cmaps service */\r
+  FT_LOCAL( FT_Error )\r
+  tt_get_cmap_info( FT_CharMap    charmap,\r
+                    TT_CMapInfo  *cmap_info );\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __TTCMAP_H__ */\r
+\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/sfnt/ttkern.c b/reactos/lib/freetype/src/sfnt/ttkern.c
new file mode 100644 (file)
index 0000000..e32d703
--- /dev/null
@@ -0,0 +1,491 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ttkern.c                                                               */\r
+/*                                                                         */\r
+/*    Load the basic TrueType kerning table.  This doesn't handle          */\r
+/*    kerning data within the GPOS table at the moment.                    */\r
+/*                                                                         */\r
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_INTERNAL_DEBUG_H\r
+#include FT_INTERNAL_STREAM_H\r
+#include FT_TRUETYPE_TAGS_H\r
+#include "ttkern.h"\r
+#include "ttload.h"\r
+\r
+#include "sferrors.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_ttkern\r
+\r
+\r
+#undef  TT_KERN_INDEX\r
+#define TT_KERN_INDEX( g1, g2 )  ( ( (FT_ULong)(g1) << 16 ) | (g2) )\r
+\r
+\r
+#ifdef FT_OPTIMIZE_MEMORY\r
+\r
+  FT_LOCAL_DEF( FT_Error )\r
+  tt_face_load_kern( TT_Face    face,\r
+                     FT_Stream  stream )\r
+  {\r
+    FT_Error   error;\r
+    FT_ULong   table_size;\r
+    FT_Byte*   p;\r
+    FT_Byte*   p_limit;\r
+    FT_UInt    nn, num_tables;\r
+    FT_UInt32  avail = 0, ordered = 0;\r
+\r
+\r
+    /* the kern table is optional; exit silently if it is missing */\r
+    error = face->goto_table( face, TTAG_kern, stream, &table_size );\r
+    if ( error )\r
+      goto Exit;\r
+\r
+    if ( table_size < 4 )  /* the case of a malformed table */\r
+    {\r
+      FT_ERROR(( "kerning table is too small - ignored\n" ));\r
+      error = SFNT_Err_Table_Missing;\r
+      goto Exit;\r
+    }\r
+\r
+    if ( FT_FRAME_EXTRACT( table_size, face->kern_table ) )\r
+    {\r
+      FT_ERROR(( "could not extract kerning table\n" ));\r
+      goto Exit;\r
+    }\r
+\r
+    face->kern_table_size = table_size;\r
+\r
+    p       = face->kern_table;\r
+    p_limit = p + table_size;\r
+\r
+    p         += 2; /* skip version */\r
+    num_tables = FT_NEXT_USHORT( p );\r
+\r
+    if ( num_tables > 32 ) /* we only support up to 32 sub-tables */\r
+      num_tables = 32;\r
+\r
+    for ( nn = 0; nn < num_tables; nn++ )\r
+    {\r
+      FT_UInt    num_pairs, version, length, coverage;\r
+      FT_Byte*   p_next;\r
+      FT_UInt32  mask = 1UL << nn;\r
+\r
+\r
+      if ( p + 6 > p_limit )\r
+        break;\r
+\r
+      p_next = p;\r
+\r
+      version  = FT_NEXT_USHORT( p );\r
+      length   = FT_NEXT_USHORT( p );\r
+      coverage = FT_NEXT_USHORT( p );\r
+\r
+      if ( length <= 6 )\r
+        break;\r
+\r
+      p_next += length;\r
+\r
+      /* only use horizontal kerning tables */\r
+      if ( ( coverage & ~8 ) != 0x0001 ||\r
+           p + 8 > p_limit             )\r
+        goto NextTable;\r
+\r
+      num_pairs = FT_NEXT_USHORT( p );\r
+      p        += 6;\r
+\r
+      if ( p + 6 * num_pairs > p_limit )\r
+        goto NextTable;\r
+\r
+      avail |= mask;\r
+\r
+      /*\r
+       *  Now check whether the pairs in this table are ordered.\r
+       *  We then can use binary search.\r
+       */\r
+      if ( num_pairs > 0 )\r
+      {\r
+        FT_UInt  count;\r
+        FT_UInt  old_pair;\r
+\r
+\r
+        old_pair = FT_NEXT_ULONG( p );\r
+        p       += 2;\r
+\r
+        for ( count = num_pairs - 1; count > 0; count-- )\r
+        {\r
+          FT_UInt32  cur_pair;\r
+\r
+\r
+          cur_pair = FT_NEXT_ULONG( p );\r
+          if ( cur_pair <= old_pair )\r
+            break;\r
+\r
+          p += 2;\r
+          old_pair = cur_pair;\r
+        }\r
+\r
+        if ( count == 0 )\r
+          ordered |= mask;\r
+      }\r
+\r
+    NextTable:\r
+      p = p_next;\r
+    }\r
+\r
+    face->num_kern_tables = nn;\r
+    face->kern_avail_bits = avail;\r
+    face->kern_order_bits = ordered;\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( void )\r
+  tt_face_done_kern( TT_Face  face )\r
+  {\r
+    FT_Stream  stream = face->root.stream;\r
+\r
+\r
+    FT_FRAME_RELEASE( face->kern_table );\r
+    face->kern_table_size = 0;\r
+    face->num_kern_tables = 0;\r
+    face->kern_avail_bits = 0;\r
+    face->kern_order_bits = 0;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( FT_Int )\r
+  tt_face_get_kerning( TT_Face  face,\r
+                       FT_UInt  left_glyph,\r
+                       FT_UInt  right_glyph )\r
+  {\r
+    FT_Int    result = 0;\r
+    FT_UInt   count, mask = 1;\r
+    FT_Byte*  p       = face->kern_table;\r
+\r
+\r
+    p   += 4;\r
+    mask = 0x0001;\r
+\r
+    for ( count = face->num_kern_tables; count > 0; count--, mask <<= 1 )\r
+    {\r
+      FT_Byte* base     = p;\r
+      FT_Byte* next     = base;\r
+      FT_UInt  version  = FT_NEXT_USHORT( p );\r
+      FT_UInt  length   = FT_NEXT_USHORT( p );\r
+      FT_UInt  coverage = FT_NEXT_USHORT( p );\r
+      FT_Int   value    = 0;\r
+\r
+      FT_UNUSED( version );\r
+\r
+\r
+      next = base + length;\r
+\r
+      if ( ( face->kern_avail_bits & mask ) == 0 )\r
+        goto NextTable;\r
+\r
+      if ( p + 8 > next )\r
+        goto NextTable;\r
+\r
+      switch ( coverage >> 8 )\r
+      {\r
+      case 0:\r
+        {\r
+          FT_UInt   num_pairs = FT_NEXT_USHORT( p );\r
+          FT_ULong  key0      = TT_KERN_INDEX( left_glyph, right_glyph );\r
+\r
+\r
+          p += 6;\r
+\r
+          if ( face->kern_order_bits & mask )   /* binary search */\r
+          {\r
+            FT_UInt   min = 0;\r
+            FT_UInt   max = num_pairs;\r
+\r
+\r
+            while ( min < max )\r
+            {\r
+              FT_UInt   mid = ( min + max ) >> 1;\r
+              FT_Byte*  q   = p + 6 * mid;\r
+              FT_ULong  key;\r
+\r
+\r
+              key = FT_NEXT_ULONG( q );\r
+\r
+              if ( key == key0 )\r
+              {\r
+                value = FT_PEEK_SHORT( q );\r
+                goto Found;\r
+              }\r
+              if ( key < key0 )\r
+                min = mid + 1;\r
+              else\r
+                max = mid;\r
+            }\r
+          }\r
+          else /* linear search */\r
+          {\r
+            for ( count = num_pairs; count > 0; count-- )\r
+            {\r
+              FT_ULong  key = FT_NEXT_ULONG( p );\r
+\r
+\r
+              if ( key == key0 )\r
+              {\r
+                value = FT_PEEK_SHORT( p );\r
+                goto Found;\r
+              }\r
+              p += 2;\r
+            }\r
+          }\r
+        }\r
+        break;\r
+\r
+       /*\r
+        *  We don't support format 2 because we've never seen a single font\r
+        *  using it in real life...\r
+        */\r
+\r
+      default:\r
+        ;\r
+      }\r
+\r
+      goto NextTable;\r
+\r
+    Found:\r
+      if ( coverage & 8 ) /* overide or add */\r
+        result = value;\r
+      else\r
+        result += value;\r
+\r
+    NextTable:\r
+      p = next;\r
+    }\r
+\r
+    return result;\r
+  }\r
+\r
+#else /* !OPTIMIZE_MEMORY */\r
+\r
+  FT_CALLBACK_DEF( int )\r
+  tt_kern_pair_compare( const void*  a,\r
+                        const void*  b );\r
+\r
+\r
+  FT_LOCAL_DEF( FT_Error )\r
+  tt_face_load_kern( TT_Face    face,\r
+                     FT_Stream  stream )\r
+  {\r
+    FT_Error   error;\r
+    FT_Memory  memory = stream->memory;\r
+\r
+    FT_UInt    n, num_tables;\r
+\r
+\r
+    /* the kern table is optional; exit silently if it is missing */\r
+    error = face->goto_table( face, TTAG_kern, stream, 0 );\r
+    if ( error )\r
+      return SFNT_Err_Ok;\r
+\r
+    if ( FT_FRAME_ENTER( 4L ) )\r
+      goto Exit;\r
+\r
+    (void)FT_GET_USHORT();         /* version */\r
+    num_tables = FT_GET_USHORT();\r
+\r
+    FT_FRAME_EXIT();\r
+\r
+    for ( n = 0; n < num_tables; n++ )\r
+    {\r
+      FT_UInt  coverage;\r
+      FT_UInt  length;\r
+\r
+\r
+      if ( FT_FRAME_ENTER( 6L ) )\r
+        goto Exit;\r
+\r
+      (void)FT_GET_USHORT();           /* version                 */\r
+      length   = FT_GET_USHORT() - 6;  /* substract header length */\r
+      coverage = FT_GET_USHORT();\r
+\r
+      FT_FRAME_EXIT();\r
+\r
+      if ( coverage == 0x0001 )\r
+      {\r
+        FT_UInt        num_pairs;\r
+        TT_Kern0_Pair  pair;\r
+        TT_Kern0_Pair  limit;\r
+\r
+\r
+        /* found a horizontal format 0 kerning table! */\r
+        if ( FT_FRAME_ENTER( 8L ) )\r
+          goto Exit;\r
+\r
+        num_pairs = FT_GET_USHORT();\r
+\r
+        /* skip the rest */\r
+\r
+        FT_FRAME_EXIT();\r
+\r
+        /* allocate array of kerning pairs */\r
+        if ( FT_QNEW_ARRAY( face->kern_pairs, num_pairs ) ||\r
+             FT_FRAME_ENTER( 6L * num_pairs )             )\r
+          goto Exit;\r
+\r
+        pair  = face->kern_pairs;\r
+        limit = pair + num_pairs;\r
+        for ( ; pair < limit; pair++ )\r
+        {\r
+          pair->left  = FT_GET_USHORT();\r
+          pair->right = FT_GET_USHORT();\r
+          pair->value = FT_GET_USHORT();\r
+        }\r
+\r
+        FT_FRAME_EXIT();\r
+\r
+        face->num_kern_pairs   = num_pairs;\r
+        face->kern_table_index = n;\r
+\r
+        /* ensure that the kerning pair table is sorted (yes, some */\r
+        /* fonts have unsorted tables!)                            */\r
+\r
+        if ( num_pairs > 0 )\r
+        {\r
+          TT_Kern0_Pair  pair0 = face->kern_pairs;\r
+          FT_ULong       prev  = TT_KERN_INDEX( pair0->left, pair0->right );\r
+\r
+\r
+          for ( pair0++; pair0 < limit; pair0++ )\r
+          {\r
+            FT_ULong  next = TT_KERN_INDEX( pair0->left, pair0->right );\r
+\r
+\r
+            if ( next < prev )\r
+              goto SortIt;\r
+\r
+            prev = next;\r
+          }\r
+          goto Exit;\r
+\r
+        SortIt:\r
+          ft_qsort( (void*)face->kern_pairs, (int)num_pairs,\r
+                    sizeof ( TT_Kern0_PairRec ), tt_kern_pair_compare );\r
+        }\r
+\r
+        goto Exit;\r
+      }\r
+\r
+      if ( FT_STREAM_SKIP( length ) )\r
+        goto Exit;\r
+    }\r
+\r
+    /* no kern table found -- doesn't matter */\r
+    face->kern_table_index = -1;\r
+    face->num_kern_pairs   = 0;\r
+    face->kern_pairs       = NULL;\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+  FT_CALLBACK_DEF( int )\r
+  tt_kern_pair_compare( const void*  a,\r
+                        const void*  b )\r
+  {\r
+    TT_Kern0_Pair  pair1 = (TT_Kern0_Pair)a;\r
+    TT_Kern0_Pair  pair2 = (TT_Kern0_Pair)b;\r
+\r
+    FT_ULong  index1 = TT_KERN_INDEX( pair1->left, pair1->right );\r
+    FT_ULong  index2 = TT_KERN_INDEX( pair2->left, pair2->right );\r
+\r
+    return index1 < index2 ? -1\r
+                           : ( index1 > index2 ? 1\r
+                                               : 0 );\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( void )\r
+  tt_face_done_kern( TT_Face  face )\r
+  {\r
+    FT_Memory  memory = face->root.stream->memory;\r
+\r
+\r
+    FT_FREE( face->kern_pairs );\r
+    face->num_kern_pairs = 0;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( FT_Int )\r
+  tt_face_get_kerning( TT_Face  face,\r
+                       FT_UInt  left_glyph,\r
+                       FT_UInt  right_glyph )\r
+  {\r
+    FT_Int         result = 0;\r
+    TT_Kern0_Pair  pair;\r
+\r
+\r
+    if ( face && face->kern_pairs )\r
+    {\r
+      /* there are some kerning pairs in this font file! */\r
+      FT_ULong  search_tag = TT_KERN_INDEX( left_glyph, right_glyph );\r
+      FT_Long   left, right;\r
+\r
+\r
+      left  = 0;\r
+      right = face->num_kern_pairs - 1;\r
+\r
+      while ( left <= right )\r
+      {\r
+        FT_Long   middle = left + ( ( right - left ) >> 1 );\r
+        FT_ULong  cur_pair;\r
+\r
+\r
+        pair     = face->kern_pairs + middle;\r
+        cur_pair = TT_KERN_INDEX( pair->left, pair->right );\r
+\r
+        if ( cur_pair == search_tag )\r
+          goto Found;\r
+\r
+        if ( cur_pair < search_tag )\r
+          left = middle + 1;\r
+        else\r
+          right = middle - 1;\r
+      }\r
+    }\r
+\r
+  Exit:\r
+    return result;\r
+\r
+  Found:\r
+    result = pair->value;\r
+    goto Exit;\r
+  }\r
+\r
+#endif /* !OPTIMIZE_MEMORY */\r
+\r
+\r
+#undef TT_KERN_INDEX\r
+\r
+/* END */\r
diff --git a/reactos/lib/freetype/src/sfnt/ttkern.h b/reactos/lib/freetype/src/sfnt/ttkern.h
new file mode 100644 (file)
index 0000000..40134af
--- /dev/null
@@ -0,0 +1,56 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ttkern.h                                                               */\r
+/*                                                                         */\r
+/*    Load the basic TrueType kerning table.  This doesn't handle          */\r
+/*    kerning data within the GPOS table at the moment.                    */\r
+/*                                                                         */\r
+/*  Copyright 1996-2001, 2002, 2005 by                                     */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __TTKERN_H__\r
+#define __TTKERN_H__\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_INTERNAL_STREAM_H\r
+#include FT_INTERNAL_TRUETYPE_TYPES_H\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  FT_LOCAL( FT_Error  )\r
+  tt_face_load_kern( TT_Face    face,\r
+                     FT_Stream  stream );\r
+\r
+  FT_LOCAL( void )\r
+  tt_face_done_kern( TT_Face  face );\r
+\r
+  FT_LOCAL( FT_Int )\r
+  tt_face_get_kerning( TT_Face     face,\r
+                       FT_UInt     left_glyph,\r
+                       FT_UInt     right_glyph );\r
+\r
+#ifdef FT_OPTIMIZE_MEMORY\r
+#  define TT_FACE_HAS_KERNING( face )  ( (face)->kern_avail_bits != 0 )\r
+#else\r
+#  define TT_FACE_HAS_KERNING( face )  ( (face)->kern_pairs != NULL )\r
+#endif\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __TTKERN_H__ */\r
+\r
+\r
+/* END */\r
index fa5c6a7..0f91984 100644 (file)
@@ -5,7 +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 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   }
 
 
/* In theory, we should check the values of `search_range',               */
/* `entry_selector', and `range_shift' to detect non-SFNT based files     */
/* whose header might also start with 0x100000L (yes, these exist).       */
/*                                                                        */
/* Very unfortunately, many TrueType fonts don't have these fields        */
/* set correctly and we must ignore them to support them.  An alternative */
/* way to check the font file is thus to:                                 */
/*                                                                        */
/* - check that `num_tables' is valid                                     */
/* - look for a "head" table, check its size, and parse it to             */
/*   see if its "magic" field is correctly set                            */
/*                                                                        */
/* When checking directory entries, ignore the tables `glyx' and `locx'   */
/* which are hacked-out versions of `glyf' and `loca' in some PostScript  */
/* Type 42 fonts, and will generally be invalid.                          */
/*                                                                        */
 /* In theory, we should check the values of `search_range',              */
 /* `entry_selector', and `range_shift' to detect non-SFNT based files    */
 /* whose header might also start with 0x100000L (yes, these exist).      */
 /*                                                                       */
 /* Very unfortunately, many TrueType fonts don't have these fields       */
 /* set correctly and we must ignore them to support them.  An            */
 /* alternative way to check the font file is thus to:                    */
 /*                                                                       */
 /* - check that `num_tables' is valid                                    */
 /* - look for a "head" table, check its size, and parse it to            */
 /*   see if its "magic" field is correctly set                           */
 /*                                                                       */
 /* When checking directory entries, ignore the tables `glyx' and `locx'  */
 /* which are hacked-out versions of `glyf' and `loca' in some PostScript */
 /* Type 42 fonts, and will generally be invalid.                         */
 /*                                                                       */
   static FT_Error
   sfnt_dir_check( FT_Stream  stream,
                   FT_ULong   offset,
       goto Bad_Format;
 
   Exit:
-    return  error;
+    return error;
 
   Bad_Format:
     error = SFNT_Err_Unknown_File_Format;
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
+#ifdef FT_OPTIMIZE_MEMORY
+
+  static FT_Error
+  tt_face_load_metrics( TT_Face    face,
+                        FT_Stream  stream,
+                        FT_Bool    vertical )
+  {
+    FT_Error   error;
+    FT_ULong   table_size;
+    FT_Byte**  ptable;
+    FT_ULong*  ptable_size;
+    
+    
+    FT_TRACE2(( "TT_Load_%s_Metrics: %08p\n", vertical ? "Vertical"
+                                                       : "Horizontal",
+                                              face ));
+
+    if ( vertical )
+    {
+      ptable      = &face->vert_metrics;
+      ptable_size = &face->vert_metrics_size;
+      
+      /* The table is optional, quit silently if it wasn't found.      */
+      /*                                                               */
+      /* XXX: Some fonts have a valid vertical header with a non-null  */
+      /*      `number_of_VMetrics' fields, but no corresponding `vmtx' */
+      /*      table to get the metrics from (e.g. mingliu).            */
+      /*                                                               */
+      /*      For safety, we set the field to 0!                       */
+      /*                                                               */
+      error = face->goto_table( face, TTAG_vmtx, stream, &table_size );
+      if ( error )
+      {
+        /* Set number_Of_VMetrics to 0! */
+        FT_TRACE2(( "  no vertical header in file.\n" ));
+        error = SFNT_Err_Ok;
+        goto Exit;
+      }
+    }
+    else
+    {
+      ptable      = &face->horz_metrics;
+      ptable_size = &face->horz_metrics_size;
+
+      error = face->goto_table( face, TTAG_hmtx, stream, &table_size );
+      if ( error )
+      {
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+        /* If this is an incrementally loaded font and there are */
+        /* overriding metrics, tolerate a missing `hmtx' table.  */
+        if ( face->root.internal->incremental_interface          &&
+             face->root.internal->incremental_interface->funcs->
+               get_glyph_metrics                                 )
+        {
+          face->horizontal.number_Of_HMetrics = 0;
+          error = SFNT_Err_Ok;
+          goto Exit;
+        }
+#endif
+
+        FT_ERROR(( " no horizontal metrics in file!\n" ));
+        error = SFNT_Err_Hmtx_Table_Missing;
+        goto Exit;
+      }
+    }
+    
+    if ( FT_FRAME_EXTRACT( table_size, *ptable ) )
+      goto Exit;
+      
+    *ptable_size = table_size;
+    
+  Exit:
+    return error;
+  }
+
+#else /* !OPTIMIZE_MEMORY */
+
   static FT_Error
   tt_face_load_metrics( TT_Face    face,
                         FT_Stream  stream,
 
     if ( vertical )
     {
-      /* The table is optional, quit silently if it wasn't found       */
+      /* The table is optional, quit silently if it wasn't found.      */
       /*                                                               */
       /* XXX: Some fonts have a valid vertical header with a non-null  */
       /*      `number_of_VMetrics' fields, but no corresponding `vmtx' */
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
         /* If this is an incrementally loaded font and there are */
-        /* overriding metrics tolerate a missing 'hmtx' table.   */
-        if ( face->root.internal->incremental_interface &&
+        /* overriding metrics, tolerate a missing `hmtx' table.  */
+        if ( face->root.internal->incremental_interface          &&
              face->root.internal->incremental_interface->funcs->
-               get_glyph_metrics )
+               get_glyph_metrics                                 )
         {
           face->horizontal.number_Of_HMetrics = 0;
           error = SFNT_Err_Ok;
       for ( ; cur < limit; cur++ )
         *cur = FT_GET_SHORT();
 
-      /* we fill up the missing left side bearings with the     */
+      /* 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        */
+      /* 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];
     return error;
   }
 
+#endif /* !FT_OPTIMIZE_METRICS */
+
 
   /*************************************************************************/
   /*                                                                       */
   }
 
 
-  FT_CALLBACK_DEF( int )
-  tt_kern_pair_compare( const void*  a,
-                        const void*  b );
-
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    tt_face_load_kern                                                  */
+  /*    tt_face_load_hdmx                                                  */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Loads the first kerning table with format 0 in the font.  Only     */
-  /*    accepts the first horizontal kerning table.  Developers should use */
-  /*    the `ftxkern' extension to access other kerning tables in the font */
-  /*    file, if they really want to.                                      */
+  /*    Loads the horizontal device metrics table.                         */
   /*                                                                       */
   /* <Input>                                                               */
   /*    face   :: A handle to the target face object.                      */
   /*                                                                       */
-  /*    stream :: The input stream.                                        */
+  /*    stream :: A handle to the input stream.                            */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
-  
-#undef  TT_KERN_INDEX
-#define TT_KERN_INDEX( g1, g2 )  ( ( (FT_ULong)g1 << 16 ) | g2 )
-
+#ifdef FT_OPTIMIZE_MEMORY
 
   FT_LOCAL_DEF( FT_Error )
-  tt_face_load_kern( TT_Face    face,
+  tt_face_load_hdmx( TT_Face    face,
                      FT_Stream  stream )
   {
     FT_Error   error;
     FT_Memory  memory = stream->memory;
+    FT_UInt    version, nn, num_records;
+    FT_ULong   table_size, record_size;
+    FT_Byte*   p;
+    FT_Byte*   limit;
 
-    FT_UInt    n, num_tables;
 
-
-    /* the kern table is optional; exit silently if it is missing */
-    error = face->goto_table( face, TTAG_kern, stream, 0 );
-    if ( error )
+    /* this table is optional */
+    error = face->goto_table( face, TTAG_hdmx, stream, &table_size );
+    if ( error || table_size < 8 )
       return SFNT_Err_Ok;
 
-    if ( FT_FRAME_ENTER( 4L ) )
+    if ( FT_FRAME_EXTRACT( table_size, face->hdmx_table ) )
       goto Exit;
 
-    (void)FT_GET_USHORT();         /* version */
-    num_tables = FT_GET_USHORT();
+    p     = face->hdmx_table;
+    limit = p + table_size;
 
-    FT_FRAME_EXIT();
+    version     = FT_NEXT_USHORT( p );
+    num_records = FT_NEXT_USHORT( p );
+    record_size = FT_NEXT_ULONG( p );
 
-    for ( n = 0; n < num_tables; n++ )
+    if ( version != 0 || num_records > 255 || record_size > 0x40000 )
     {
-      FT_UInt  coverage;
-      FT_UInt  length;
-
-
-      if ( FT_FRAME_ENTER( 6L ) )
-        goto Exit;
-
-      (void)FT_GET_USHORT();           /* version                 */
-      length   = FT_GET_USHORT() - 6;  /* substract header length */
-      coverage = FT_GET_USHORT();
-
-      FT_FRAME_EXIT();
-
-      if ( coverage == 0x0001 )
-      {
-        FT_UInt        num_pairs;
-        TT_Kern0_Pair  pair;
-        TT_Kern0_Pair  limit;
-
-
-        /* found a horizontal format 0 kerning table! */
-        if ( FT_FRAME_ENTER( 8L ) )
-          goto Exit;
-
-        num_pairs = FT_GET_USHORT();
-
-        /* skip the rest */
-
-        FT_FRAME_EXIT();
-
-        /* allocate array of kerning pairs */
-        if ( FT_QNEW_ARRAY( face->kern_pairs, num_pairs ) ||
-             FT_FRAME_ENTER( 6L * num_pairs )             )
-          goto Exit;
-
-        pair  = face->kern_pairs;
-        limit = pair + num_pairs;
-        for ( ; pair < limit; pair++ )
-        {
-          pair->left  = FT_GET_USHORT();
-          pair->right = FT_GET_USHORT();
-          pair->value = FT_GET_USHORT();
-        }
-
-        FT_FRAME_EXIT();
-
-        face->num_kern_pairs   = num_pairs;
-        face->kern_table_index = n;
-
-        /* ensure that the kerning pair table is sorted (yes, some */
-        /* fonts have unsorted tables!)                            */
-
-#if 1
-        if ( num_pairs > 0 )     
-        {
-          TT_Kern0_Pair  pair0 = face->kern_pairs;
-          FT_ULong       prev  = TT_KERN_INDEX( pair0->left, pair0->right );
-          
-
-          for ( pair0++; pair0 < limit; pair0++ )
-          {
-            FT_ULong  next = TT_KERN_INDEX( pair0->left, pair0->right );
-            
-
-            if ( next < prev )
-              goto SortIt;
-              
-            prev = next;
-          }
-          goto Exit;
-          
-        SortIt:
-          ft_qsort( (void*)face->kern_pairs, (int)num_pairs,
-                    sizeof ( TT_Kern0_PairRec ), tt_kern_pair_compare );
-        }
-#else        
-        {
-          TT_Kern0_Pair  pair0    = face->kern_pairs;
-          FT_UInt        i;
-          
-
-          for ( i = 1; i < num_pairs; i++, pair0++ )
-          {
-            if ( tt_kern_pair_compare( pair0, pair0 + 1 ) != -1 )
-            {
-              ft_qsort( (void*)face->kern_pairs, (int)num_pairs,
-                        sizeof ( TT_Kern0_PairRec ), tt_kern_pair_compare );
-              break;
-            }
-          }
-        }
-#endif
+      error = SFNT_Err_Invalid_File_Format;
+      goto Fail;
+    }
 
-        goto Exit;
-      }
+    if ( FT_NEW_ARRAY( face->hdmx_record_sizes, num_records ) )
+      goto Fail;
 
-      if ( FT_STREAM_SKIP( length ) )
-        goto Exit;
+    for ( nn = 0; nn < num_records; nn++ )
+    {
+      if ( p + record_size > limit )
+        break;
+        
+      face->hdmx_record_sizes[nn] = p[0];
+      p                          += record_size;
     }
-
-    /* no kern table found -- doesn't matter */
-    face->kern_table_index = -1;
-    face->num_kern_pairs   = 0;
-    face->kern_pairs       = NULL;
+    
+    face->hdmx_record_count = nn;
+    face->hdmx_table_size   = table_size;
 
   Exit:
     return error;
+    
+  Fail:
+    FT_FRAME_RELEASE( face->hdmx_table );
+    face->hdmx_table_size = 0;
+    goto Exit;
   }
 
 
-  FT_CALLBACK_DEF( int )
-  tt_kern_pair_compare( const void*  a,
-                        const void*  b )
+  FT_LOCAL_DEF( void )
+  tt_face_free_hdmx( TT_Face  face )
   {
-    TT_Kern0_Pair  pair1 = (TT_Kern0_Pair)a;
-    TT_Kern0_Pair  pair2 = (TT_Kern0_Pair)b;
-
-    FT_ULong  index1 = TT_KERN_INDEX( pair1->left, pair1->right );
-    FT_ULong  index2 = TT_KERN_INDEX( pair2->left, pair2->right );
-
+    FT_Stream  stream = face->root.stream;
+    FT_Memory  memory = stream->memory;
+    
 
-    return ( index1 < index2 ? -1 :
-           ( index1 > index2 ?  1 : 0 ));
+    FT_FREE( face->hdmx_record_sizes );
+    FT_FRAME_RELEASE( face->hdmx_table );
   }
 
+#else /* !FT_OPTIMIZE_MEMORY */
 
-#undef TT_KERN_INDEX
-  
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    tt_face_load_hdmx                                                  */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads the horizontal device metrics table.                         */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face   :: A handle to the target face object.                      */
-  /*                                                                       */
-  /*    stream :: A handle to the input stream.                            */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   tt_face_load_hdmx( TT_Face    face,
                      FT_Stream  stream )
     if ( FT_FRAME_ENTER( 8L ) )
       goto Exit;
 
-    hdmx->version     = FT_GET_USHORT();
-    num_records       = FT_GET_SHORT();
-    record_size       = FT_GET_LONG();
+    hdmx->version = FT_GET_USHORT();
+    num_records   = FT_GET_SHORT();
+    record_size   = FT_GET_LONG();
 
     FT_FRAME_EXIT();
 
+    if ( record_size < 0 || num_records < 0 )
+      return SFNT_Err_Invalid_File_Format;
+
     /* Only recognize format 0 */
     if ( hdmx->version != 0 )
       goto Exit;
 
-    if ( FT_QNEW_ARRAY( hdmx->records, num_records ) )
+    /* we can't use FT_QNEW_ARRAY here; otherwise tt_face_free_hdmx */
+    /* could fail during deallocation                               */
+    if ( FT_NEW_ARRAY( hdmx->records, num_records ) )
       goto Exit;
 
     hdmx->num_records = num_records;
-    num_glyphs   = face->root.num_glyphs;
-    record_size -= num_glyphs + 2;
+    num_glyphs        = face->root.num_glyphs;
+    record_size      -= num_glyphs + 2;
 
     {
       TT_HdmxEntry  cur   = hdmx->records;
              FT_READ_BYTE( cur->max_width ) )
           goto Exit;
 
-        if ( FT_QALLOC( cur->widths, num_glyphs )       ||
+        if ( FT_QALLOC( cur->widths, num_glyphs )      ||
              FT_STREAM_READ( cur->widths, num_glyphs ) )
           goto Exit;
 
         /* skip padding bytes */
         if ( record_size > 0 && FT_STREAM_SKIP( record_size ) )
-            goto Exit;
+          goto Exit;
       }
     }
 
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    tt_face_free_hdmx                                                  */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Frees the horizontal device metrics table.                         */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face :: A handle to the target face object.                        */
-  /*                                                                       */
   FT_LOCAL_DEF( void )
   tt_face_free_hdmx( TT_Face  face )
   {
     }
   }
 
+#endif /* !OPTIMIZE_MEMORY */
+
 
 /* END */
index 27c41b5..d1a61ca 100644 (file)
@@ -5,7 +5,7 @@
 /*    Load the basic TrueType tables, i.e., tables that can be either in   */
 /*    TTF or OTF fonts (specification).                                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2005 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -111,11 +111,6 @@ FT_BEGIN_HEADER
   tt_face_free_hdmx ( TT_Face  face );
 
 
-  FT_LOCAL( FT_Error )
-  tt_face_load_kern( TT_Face    face,
-                     FT_Stream  stream );
-
-
   FT_LOCAL( FT_Error )
   tt_face_load_gasp( TT_Face    face,
                      FT_Stream  stream );
index 444c27a..610b63b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType and OpenType embedded bitmap support (body).                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 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_DEBUG_H
+#include FT_INTERNAL_STREAM_H
+#include FT_TRUETYPE_TAGS_H
+
+#ifdef FT_OPTIMIZE_MEMORY
+#include "ttsbit0.c"
+#else /* !OPTIMIZE_MEMORY */
 
 #include <ft2build.h>
 #include FT_INTERNAL_DEBUG_H
   }
 
 
-  const FT_Frame_Field  sbit_metrics_fields[] =
+  static const FT_Frame_Field  sbit_metrics_fields[] =
   {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_SBit_MetricsRec
         FT_Bool   large = FT_BOOL( range->index_format == 1 );
 
 
+
+        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 */
     FT_ULong   num_strikes;
     FT_ULong   table_base;
 
-    const FT_Frame_Field  sbit_line_metrics_fields[] =
+    static const FT_Frame_Field  sbit_line_metrics_fields[] =
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_SBit_LineMetricsRec
       FT_FRAME_END
     };
 
-    const FT_Frame_Field  strike_start_fields[] =
+    static const FT_Frame_Field  strike_start_fields[] =
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_SBit_StrikeRec
       FT_FRAME_END
     };
 
-    const FT_Frame_Field  strike_end_fields[] =
+    static const FT_Frame_Field  strike_end_fields[] =
     {
       /* no FT_FRAME_START */
         FT_FRAME_USHORT( start_glyph ),
         FT_ULong       count2 = strike->num_ranges;
 
 
-        if ( FT_NEW_ARRAY( strike->sbit_ranges, strike->num_ranges ) )
-          goto Exit;
-
         /* 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 )
         {
       }
     }
 
+    /* now set up the root fields to indicate the strikes */
+    if ( face->num_sbit_strikes )
+    {
+      FT_ULong  n;
+      FT_Face   root = FT_FACE( face );
+
+
+      if ( FT_NEW_ARRAY( root->available_sizes, face->num_sbit_strikes ) )
+        goto Exit;
+
+      for ( n = 0 ; n < face->num_sbit_strikes ; n++ )
+      {
+        FT_Bitmap_Size*  bsize  = root->available_sizes + n;
+        TT_SBit_Strike   strike = face->sbit_strikes + n;
+        FT_UShort        fupem  = face->header.Units_Per_EM;
+        FT_Short         height = (FT_Short)( face->horizontal.Ascender -
+                                              face->horizontal.Descender +
+                                              face->horizontal.Line_Gap );
+        FT_Short         avg    = face->os2.xAvgCharWidth;
+
+
+        /* assume 72dpi */
+        bsize->height =
+          (FT_Short)( ( height * strike->y_ppem + fupem / 2 ) / fupem );
+        bsize->width  =
+          (FT_Short)( ( avg * strike->y_ppem + fupem / 2 ) / fupem );
+        bsize->size   = strike->y_ppem << 6;
+        bsize->x_ppem = strike->x_ppem << 6;
+        bsize->y_ppem = strike->y_ppem << 6;
+      }
+
+      root->face_flags     |= FT_FACE_FLAG_FIXED_SIZES;
+      root->num_fixed_sizes = (FT_Int)face->num_sbit_strikes;
+    }
+
   Exit:
     return error;
   }
     error = face->goto_table( face, TTAG_EBDT, stream, 0 );
     if ( error )
       error = face->goto_table( face, TTAG_bdat, stream, 0 );
-    if (error)
+    if ( error )
       goto Exit;
 
     ebdt_pos = FT_STREAM_POS();
     return error;
   }
 
+#endif /* !OPTIMIZE_MEMORY */
+
 
 /* END */
index f1b63b7..d2734dd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType and OpenType embedded bitmap support (specification).       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -41,6 +41,7 @@ FT_BEGIN_HEADER
                            FT_UInt    y_ppem,
                            FT_ULong  *astrike_index );
 
+#ifndef FT_OPTIMIZE_MEMORY
   FT_LOCAL( FT_Error )
   tt_find_sbit_image( TT_Face          face,
                       FT_UInt          glyph_index,
@@ -53,6 +54,7 @@ FT_BEGIN_HEADER
   tt_load_sbit_metrics( FT_Stream        stream,
                         TT_SBit_Range    range,
                         TT_SBit_Metrics  metrics );
+#endif /* !FT_OPTIMIZE_MEMORY */
 
   FT_LOCAL( FT_Error )
   tt_face_load_sbit_image( TT_Face              face,
diff --git a/reactos/lib/freetype/src/sfnt/ttsbit0.c b/reactos/lib/freetype/src/sfnt/ttsbit0.c
new file mode 100644 (file)
index 0000000..c9ae530
--- /dev/null
@@ -0,0 +1,967 @@
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ttsbit0.c                                                              */\r
+/*                                                                         */\r
+/*    TrueType and OpenType embedded bitmap support (body).                */\r
+/*    This is a heap-optimized version.                                    */\r
+/*                                                                         */\r
+/*  Copyright 2005 by                                                      */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_INTERNAL_DEBUG_H\r
+#include FT_INTERNAL_STREAM_H\r
+#include FT_TRUETYPE_TAGS_H\r
+#include "ttsbit.h"\r
+\r
+#include "sferrors.h"\r
+\r
+\r
+  /*************************************************************************/\r
+  /*                                                                       */\r
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\r
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\r
+  /* messages during execution.                                            */\r
+  /*                                                                       */\r
+#undef  FT_COMPONENT\r
+#define FT_COMPONENT  trace_ttsbit\r
+\r
+\r
+    static const FT_Frame_Field  tt_sbit_line_metrics_fields[] =\r
+    {\r
+#undef  FT_STRUCTURE\r
+#define FT_STRUCTURE  TT_SBit_LineMetricsRec\r
+\r
+      /* no FT_FRAME_START */\r
+        FT_FRAME_CHAR( ascender ),\r
+        FT_FRAME_CHAR( descender ),\r
+        FT_FRAME_BYTE( max_width ),\r
+\r
+        FT_FRAME_CHAR( caret_slope_numerator ),\r
+        FT_FRAME_CHAR( caret_slope_denominator ),\r
+        FT_FRAME_CHAR( caret_offset ),\r
+\r
+        FT_FRAME_CHAR( min_origin_SB ),\r
+        FT_FRAME_CHAR( min_advance_SB ),\r
+        FT_FRAME_CHAR( max_before_BL ),\r
+        FT_FRAME_CHAR( min_after_BL ),\r
+        FT_FRAME_CHAR( pads[0] ),\r
+        FT_FRAME_CHAR( pads[1] ),\r
+      FT_FRAME_END\r
+    };\r
+\r
+    static const FT_Frame_Field  tt_strike_start_fields[] =\r
+    {\r
+#undef  FT_STRUCTURE\r
+#define FT_STRUCTURE  TT_SBit_StrikeRec\r
+\r
+      /* no FT_FRAME_START */\r
+        FT_FRAME_ULONG( ranges_offset ),\r
+        FT_FRAME_SKIP_LONG,\r
+        FT_FRAME_ULONG( num_ranges ),\r
+        FT_FRAME_ULONG( color_ref ),\r
+      FT_FRAME_END\r
+    };\r
+\r
+    static const FT_Frame_Field  tt_strike_end_fields[] =\r
+    {\r
+      /* no FT_FRAME_START */\r
+        FT_FRAME_USHORT( start_glyph ),\r
+        FT_FRAME_USHORT( end_glyph ),\r
+        FT_FRAME_BYTE  ( x_ppem ),\r
+        FT_FRAME_BYTE  ( y_ppem ),\r
+        FT_FRAME_BYTE  ( bit_depth ),\r
+        FT_FRAME_CHAR  ( flags ),\r
+      FT_FRAME_END\r
+    };\r
+\r
+\r
+  FT_LOCAL_DEF( FT_Error )\r
+  tt_face_load_sbit_strikes( TT_Face    face,\r
+                             FT_Stream  stream )\r
+  {\r
+    FT_Error   error  = SFNT_Err_Ok;\r
+    FT_Fixed   version;\r
+    FT_ULong   num_strikes, table_size;\r
+    FT_Byte*   p;\r
+    FT_Byte*   p_limit;\r
+    FT_UInt    nn, count;\r
+\r
+\r
+    face->sbit_num_strikes = 0;\r
+\r
+    /* this table is optional */\r
+    error = face->goto_table( face, TTAG_EBLC, stream, &table_size );\r
+    if ( error )\r
+      error = face->goto_table( face, TTAG_bloc, stream, &table_size );\r
+    if ( error )\r
+      goto Exit;\r
+\r
+    if ( table_size < 8 )\r
+    {\r
+      FT_ERROR(( "%s: table too short!\n", "tt_face_load_sbit_strikes" ));\r
+      error = SFNT_Err_Invalid_File_Format;\r
+      goto Exit;\r
+    }\r
+\r
+    if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) )\r
+      goto Exit;\r
+\r
+    face->sbit_table_size = table_size;\r
+\r
+    p       = face->sbit_table;\r
+    p_limit = p + table_size;\r
+\r
+    version     = FT_NEXT_ULONG( p );\r
+    num_strikes = FT_NEXT_ULONG( p );\r
+\r
+    if ( version != 0x00020000UL || num_strikes >= 0x10000UL )\r
+    {\r
+      FT_ERROR(( "%s: invalid table version!\n",\r
+                 "tt_face_load_sbit_strikes" ));\r
+      error = SFNT_Err_Invalid_File_Format;\r
+      goto Fail;\r
+    }\r
+\r
+    /*\r
+     *  Count the number of strikes available in the table.  We are a bit\r
+     *  paranoid there and don't trust the data.\r
+     */\r
+    count = (FT_UInt)num_strikes;\r
+    if ( 8 +48UL * count > table_size )\r
+      count = (FT_UInt)( ( p_limit - p ) / 48 );\r
+\r
+    face->sbit_num_strikes = count;\r
+\r
+    /*\r
+     *  Now allocate the root array of FT_Bitmap_Size records and\r
+     *  populate them.  Unfortunately, it isn't possible to indicate bit\r
+     *  depths in the FT_Bitmap_Size record.  This is a design error.\r
+     */\r
+    {\r
+      FT_Memory  memory  = face->root.stream->memory;\r
+      FT_UInt    em_size = (FT_UInt) face->header.Units_Per_EM;\r
+      FT_Short   height  = (FT_Short)( face->horizontal.Ascender -\r
+                                       face->horizontal.Descender +\r
+                                       face->horizontal.Line_Gap );\r
+\r
+      FT_Short   avgwidth = face->os2.xAvgCharWidth;\r
+\r
+\r
+      if ( FT_NEW_ARRAY( face->root.available_sizes, count ) )\r
+        goto Fail;\r
+\r
+      for ( nn = 0; nn < count; nn++ )\r
+      {\r
+        FT_Bitmap_Size*  bsize = face->root.available_sizes + nn;\r
+        FT_UInt          x_ppem, y_ppem;\r
+\r
+\r
+        x_ppem = p[44];\r
+        y_ppem = p[45];\r
+\r
+        bsize->x_ppem = (FT_Pos)(x_ppem << 6);\r
+        bsize->y_ppem = (FT_Pos)(y_ppem << 6);\r
+\r
+        bsize->height = (FT_Short)( height*y_ppem   + em_size / 2 ) / em_size;\r
+        bsize->width  = (FT_Short)( avgwidth*y_ppem + em_size / 2 ) / em_size;\r
+        bsize->size   = bsize->y_ppem;\r
+\r
+        p += 48;\r
+      }\r
+\r
+      face->root.face_flags     |= FT_FACE_FLAG_FIXED_SIZES;\r
+      face->root.num_fixed_sizes = count;\r
+    }\r
+\r
+  Exit:\r
+    return error;\r
+\r
+  Fail:\r
+    FT_FRAME_RELEASE( face->sbit_table );\r
+    face->sbit_table_size = 0;\r
+    goto Exit;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( void )\r
+  tt_face_free_sbit_strikes( TT_Face  face )\r
+  {\r
+    FT_Stream  stream = face->root.stream;\r
+\r
+\r
+    FT_FRAME_RELEASE( face->sbit_table );\r
+    face->sbit_table_size  = 0;\r
+    face->sbit_num_strikes = 0;\r
+  }\r
+\r
+\r
+  FT_LOCAL_DEF( FT_Error )\r
+  tt_face_set_sbit_strike( TT_Face    face,\r
+                           FT_UInt    x_ppem,\r
+                           FT_UInt    y_ppem,\r
+                           FT_ULong  *astrike_index )\r
+  {\r
+    FT_UInt   nn, count;\r
+    FT_Byte*  p;\r
+    FT_Byte*  p_limit;\r
+\r
+\r
+    if ( x_ppem > 255               ||\r
+         y_ppem < 1 || y_ppem > 255 )\r
+      return SFNT_Err_Invalid_PPem;\r
+\r
+    p       = face->sbit_table + 8;\r
+    p_limit = p + face->sbit_table_size;\r
+    count   = face->sbit_num_strikes;\r
+\r
+    for ( nn = 0; nn < count; nn++ )\r
+    {\r
+      if ( x_ppem == (FT_UInt)p[44] && y_ppem == (FT_UInt)p[45] )\r
+      {\r
+        *astrike_index = (FT_ULong)nn;\r
+        return SFNT_Err_Ok;\r
+      }\r
+      p += 48;\r
+    }\r
+\r
+    return SFNT_Err_Invalid_PPem;\r
+  }\r
+\r
+\r
+  typedef struct\r
+  {\r
+    TT_Face          face;\r
+    FT_Stream        stream;\r
+    FT_Bitmap*       bitmap;\r
+    TT_SBit_Metrics  metrics;\r
+    FT_Bool          metrics_loaded;\r
+    FT_Bool          bitmap_allocated;\r
+    FT_Byte          bit_depth;\r
+\r
+    FT_ULong         ebdt_start;\r
+    FT_ULong         ebdt_size;\r
+\r
+    FT_ULong         strike_index_array;\r
+    FT_ULong         strike_index_count;\r
+    FT_Byte*         eblc_base;\r
+    FT_Byte*         eblc_limit;\r
+\r
+  } TT_SBitDecoderRec, *TT_SBitDecoder;\r
+\r
+\r
+  static FT_Error\r
+  tt_sbit_decoder_init( TT_SBitDecoder       decoder,\r
+                        TT_Face              face,\r
+                        FT_ULong             strike_index,\r
+                        TT_SBit_MetricsRec*  metrics )\r
+  {\r
+    FT_Error   error;\r
+    FT_Stream  stream     = face->root.stream;\r
+    FT_ULong   ebdt_size;\r
+\r
+\r
+    error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size );\r
+    if ( error )\r
+      error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size );\r
+    if ( error )\r
+      goto Exit;\r
+\r
+    decoder->face    = face;\r
+    decoder->stream  = stream;\r
+    decoder->bitmap  = &face->root.glyph->bitmap;\r
+    decoder->metrics = metrics;\r
+\r
+    decoder->metrics_loaded   = 0;\r
+    decoder->bitmap_allocated = 0;\r
+\r
+    decoder->ebdt_start = FT_STREAM_POS();\r
+    decoder->ebdt_size  = ebdt_size;\r
+\r
+    decoder->eblc_base  = face->sbit_table;\r
+    decoder->eblc_limit = face->sbit_table + face->sbit_table_size;\r
+\r
+    /* now find the strike corresponding to the index */\r
+    {\r
+      FT_Byte*  p = decoder->eblc_base + 8 + 48 * strike_index;\r
+\r
+\r
+      decoder->strike_index_array = FT_NEXT_ULONG( p );\r
+      p                          += 4;\r
+      decoder->strike_index_count = FT_NEXT_ULONG( p );\r
+      p                          += 34;\r
+      decoder->bit_depth          = *p;\r
+    }\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+  static void\r
+  tt_sbit_decoder_done( TT_SBitDecoder  decoder )\r
+  {\r
+    FT_UNUSED( decoder );\r
+  }\r
+\r
+\r
+  static FT_Error\r
+  tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder  decoder )\r
+  {\r
+    FT_Error    error = SFNT_Err_Ok;\r
+    FT_UInt     width, height;\r
+    FT_Bitmap*  map = decoder->bitmap;\r
+    FT_Long     size;\r
+\r
+\r
+    if ( !decoder->metrics_loaded )\r
+    {\r
+      error = SFNT_Err_Invalid_Argument;\r
+      goto Exit;\r
+    }\r
+\r
+    width  = decoder->metrics->width;\r
+    height = decoder->metrics->height;\r
+\r
+    map->width = (int)width;\r
+    map->rows  = (int)height;\r
+\r
+    switch ( decoder->bit_depth )\r
+    {\r
+    case 1:\r
+      map->pixel_mode = FT_PIXEL_MODE_MONO;\r
+      map->pitch      = ( map->width + 7 ) >> 3;\r
+      break;\r
+\r
+    case 2:\r
+      map->pixel_mode = FT_PIXEL_MODE_GRAY2;\r
+      map->pitch      = ( map->width + 3 ) >> 2;\r
+      break;\r
+\r
+    case 4:\r
+      map->pixel_mode = FT_PIXEL_MODE_GRAY4;\r
+      map->pitch      = ( map->width + 1 ) >> 1;\r
+      break;\r
+\r
+    case 8:\r
+      map->pixel_mode = FT_PIXEL_MODE_GRAY;\r
+      map->pitch      = map->width;\r
+      break;\r
+\r
+    default:\r
+      error = SFNT_Err_Invalid_File_Format;\r
+      goto Exit;\r
+    }\r
+\r
+    size = map->rows * map->pitch;\r
+\r
+    /* check that there is no empty image */\r
+    if ( size == 0 )\r
+      goto Exit;     /* exit successfully! */\r
+\r
+    error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph, size );\r
+    if ( error )\r
+      goto Exit;\r
+\r
+    decoder->bitmap_allocated = 1;\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+  static FT_Error\r
+  tt_sbit_decoder_load_metrics( TT_SBitDecoder  decoder,\r
+                                FT_Byte*       *pp,\r
+                                FT_Byte*        limit,\r
+                                FT_Bool         big )\r
+  {\r
+    FT_Byte*         p       = *pp;\r
+    TT_SBit_Metrics  metrics = decoder->metrics;\r
+\r
+\r
+    if ( p + 5 > limit )\r
+      goto Fail;\r
+\r
+    if ( !decoder->metrics_loaded )\r
+    {\r
+      metrics->height       = p[0];\r
+      metrics->width        = p[1];\r
+      metrics->horiBearingX = (FT_Char)p[2];\r
+      metrics->horiBearingY = (FT_Char)p[3];\r
+      metrics->horiAdvance  = p[4];\r
+    }\r
+\r
+    p += 5;\r
+    if ( big )\r
+    {\r
+      if ( p + 3 > limit )\r
+        goto Fail;\r
+\r
+      if ( !decoder->metrics_loaded )\r
+      {\r
+        metrics->vertBearingX = (FT_Char)p[0];\r
+        metrics->vertBearingY = (FT_Char)p[1];\r
+        metrics->vertAdvance  = p[2];\r
+      }\r
+\r
+      p += 3;\r
+    }\r
+\r
+    decoder->metrics_loaded = 1;\r
+    *pp = p;\r
+    return 0;\r
+\r
+  Fail:\r
+    return SFNT_Err_Invalid_Argument;\r
+  }\r
+\r
+\r
+  /* forward declaration */\r
+  static FT_Error\r
+  tt_sbit_decoder_load_image( TT_SBitDecoder  decoder,\r
+                              FT_UInt         glyph_index,\r
+                              FT_Int          x_pos,\r
+                              FT_Int          y_pos );\r
+\r
+  typedef FT_Error  (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder  decoder,\r
+                                                FT_Byte*        p,\r
+                                                FT_Byte*        plimit,\r
+                                                FT_Int          x_pos,\r
+                                                FT_Int          y_pos );\r
+\r
+\r
+  static FT_Error\r
+  tt_sbit_decoder_load_byte_aligned( TT_SBitDecoder  decoder,\r
+                                     FT_Byte*        p,\r
+                                     FT_Byte*        limit,\r
+                                     FT_Int          x_pos,\r
+                                     FT_Int          y_pos )\r
+  {\r
+    FT_Error    error = SFNT_Err_Ok;\r
+    FT_Byte*    line;\r
+    FT_Int      bit_height, bit_width, pitch, width, height, h;\r
+    FT_Bitmap*  bitmap;\r
+\r
+\r
+    if ( !decoder->bitmap_allocated )\r
+    {\r
+      error = tt_sbit_decoder_alloc_bitmap( decoder );\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    /* check that we can write the glyph into the bitmap */\r
+    bitmap     = decoder->bitmap;\r
+    bit_width  = bitmap->width;\r
+    bit_height = bitmap->rows;\r
+    pitch      = bitmap->pitch;\r
+    line       = bitmap->buffer;\r
+\r
+    width  = decoder->metrics->width;\r
+    height = decoder->metrics->height;\r
+\r
+    if ( x_pos < 0 || x_pos + width > bit_width   ||\r
+         y_pos < 0 || y_pos + height > bit_height )\r
+    {\r
+      error = SFNT_Err_Invalid_File_Format;\r
+      goto Exit;\r
+    }\r
+\r
+    if ( p + ( ( width + 7 ) >> 3 ) * height > limit )\r
+    {\r
+      error = SFNT_Err_Invalid_File_Format;\r
+      goto Exit;\r
+    }\r
+\r
+    /* now do the blit */\r
+    line  += y_pos * pitch + ( x_pos >> 3 );\r
+    x_pos &= 7;\r
+\r
+    if ( x_pos == 0 )  /* the easy one */\r
+    {\r
+      for ( h = height; h > 0; h--, line += pitch )\r
+      {\r
+        FT_Byte*  write = line;\r
+        FT_Int    w;\r
+\r
+\r
+        for ( w = width; w >= 8; w -= 8 )\r
+        {\r
+          write[0] = (FT_Byte)( write[0] | *p++ );\r
+          write   += 1;\r
+        }\r
+\r
+        if ( w > 0 )\r
+          write[0] = (FT_Byte)( write[0] | ( *p++ & ( 0xFF00U >> w ) ) );\r
+      }\r
+    }\r
+    else  /* x_pos > 0 */\r
+    {\r
+      for ( h = height; h > 0; h--, line += pitch )\r
+      {\r
+        FT_Byte*  write = line;\r
+        FT_Int    w;\r
+        FT_UInt   wval = 0;\r
+\r
+\r
+        for ( w = width; w >= 8; w -= 8 )\r
+        {\r
+          wval      = (FT_UInt)( wval | *p++ );\r
+          write[0]  = (FT_Byte)( write[0] | ( wval >> x_pos ) );\r
+          write    += 1;\r
+          wval    <<= 8;\r
+        }\r
+\r
+        if ( w > 0 )\r
+          wval = (FT_UInt)(wval | ( *p++ & ( 0xFF00U >> w ) ) );\r
+\r
+        write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) );\r
+      }\r
+    }\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+  static FT_Error\r
+  tt_sbit_decoder_load_bit_aligned( TT_SBitDecoder  decoder,\r
+                                    FT_Byte*        p,\r
+                                    FT_Byte*        limit,\r
+                                    FT_Int          x_pos,\r
+                                    FT_Int          y_pos )\r
+  {\r
+    FT_Error    error = SFNT_Err_Ok;\r
+    FT_Byte*    line;\r
+    FT_Int      bit_height, bit_width, pitch, width, height, h;\r
+    FT_Bitmap*  bitmap;\r
+    FT_UInt32   rval;\r
+\r
+\r
+    if ( !decoder->bitmap_allocated )\r
+    {\r
+      error = tt_sbit_decoder_alloc_bitmap( decoder );\r
+      if ( error )\r
+        goto Exit;\r
+    }\r
+\r
+    /* check that we can write the glyph into the bitmap */\r
+    bitmap     = decoder->bitmap;\r
+    bit_width  = bitmap->width;\r
+    bit_height = bitmap->rows;\r
+    pitch      = bitmap->pitch;\r
+    line       = bitmap->buffer;\r
+\r
+    width  = decoder->metrics->width;\r
+    height = decoder->metrics->height;\r
+\r
+    if ( x_pos < 0 || x_pos + width  > bit_width  ||\r
+         y_pos < 0 || y_pos + height > bit_height )\r
+    {\r
+      error = SFNT_Err_Invalid_File_Format;\r
+      goto Exit;\r
+    }\r
+\r
+    if ( p + ( ( width + 7 ) >> 3 ) * height > limit )\r
+    {\r
+      error = SFNT_Err_Invalid_File_Format;\r
+      goto Exit;\r
+    }\r
+\r
+    /* now do the blit */\r
+    line  += y_pos * pitch + ( x_pos >> 3 );\r
+    x_pos &= 7;\r
+    rval   = 0x10000UL;\r
+\r
+    for ( h = height; h > 0; h--, line += pitch )\r
+    {\r
+      FT_Byte*   write = line;\r
+      FT_UInt32  wval  = 0x100 << x_pos;\r
+      FT_Int     w;\r
+\r
+\r
+      for ( w = width; w >= 8; w -= 8 )\r
+      {\r
+        if ( rval & 0x10000UL )\r
+          rval = 0x100 | *p++;\r
+\r
+        wval |= rval & 0x80;\r
+\r
+        wval <<= 1;\r
+        rval <<= 1;\r
+\r
+        if ( wval & 0x10000UL )\r
+        {\r
+          write[0] = (FT_Byte)( write[0] | ( wval >> 8 ) );\r
+          write   += 1;\r
+          wval     = 0x100;\r
+        }\r
+      }\r
+\r
+      if ( wval != 0x100 )\r
+      {\r
+        while ( wval > 0x1FF )\r
+          wval >>= 1;\r
+\r
+        write[0] = (FT_Byte)( write[0] | wval );\r
+      }\r
+    }\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+  static FT_Error\r
+  tt_sbit_decoder_load_compound( TT_SBitDecoder  decoder,\r
+                                 FT_Byte*        p,\r
+                                 FT_Byte*        limit,\r
+                                 FT_Int          x_pos,\r
+                                 FT_Int          y_pos )\r
+  {\r
+    FT_Error  error = SFNT_Err_Ok;\r
+    FT_UInt   num_components, nn;\r
+\r
+\r
+    if ( p + 2 > limit )\r
+      goto Fail;\r
+\r
+    num_components = FT_NEXT_USHORT( p );\r
+    if ( p + 4 * num_components > limit )\r
+      goto Fail;\r
+\r
+    for ( nn = 0; nn < num_components; nn++ )\r
+    {\r
+      FT_UInt   gindex = FT_NEXT_USHORT( p );\r
+      FT_Byte   dx     = FT_NEXT_BYTE( p );\r
+      FT_Byte   dy     = FT_NEXT_BYTE( p );\r
+\r
+\r
+      /* NB: a recursive call */\r
+      error = tt_sbit_decoder_load_image( decoder, gindex,\r
+                                          x_pos + dx, y_pos + dy );\r
+      if ( error )\r
+        break;\r
+    }\r
+\r
+  Exit:\r
+    return error;\r
+\r
+  Fail:\r
+    error = SFNT_Err_Invalid_File_Format;\r
+    goto Exit;\r
+  }\r
+\r
+\r
+  static FT_Error\r
+  tt_sbit_decoder_load_bitmap( TT_SBitDecoder  decoder,\r
+                               FT_UInt         glyph_format,\r
+                               FT_ULong        glyph_start,\r
+                               FT_ULong        glyph_size,\r
+                               FT_Int          x_pos,\r
+                               FT_Int          y_pos )\r
+  {\r
+    FT_Error   error;\r
+    FT_Stream  stream = decoder->stream;\r
+    FT_Byte*   p;\r
+    FT_Byte*   p_limit;\r
+    FT_Byte*   data;\r
+\r
+\r
+    /* seek into the EBDT table now */\r
+    if ( glyph_start + glyph_size > decoder->ebdt_size )\r
+    {\r
+      error = SFNT_Err_Invalid_Argument;\r
+      goto Exit;\r
+    }\r
+\r
+    if ( FT_STREAM_SEEK( decoder->ebdt_start + glyph_start ) ||\r
+         FT_FRAME_EXTRACT( glyph_size, data )                )\r
+      goto Exit;\r
+\r
+    p       = data;\r
+    p_limit = p + glyph_size;\r
+\r
+    /* read the data, depending on the glyph format */\r
+    switch ( glyph_format )\r
+    {\r
+    case 1:\r
+    case 2:\r
+    case 8:\r
+      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 0 );\r
+      break;\r
+\r
+    case 6:\r
+    case 7:\r
+    case 9:\r
+      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 );\r
+      break;\r
+\r
+    default:\r
+      error = SFNT_Err_Ok;\r
+    }\r
+\r
+    if ( error )\r
+      goto Fail;\r
+\r
+    {\r
+      TT_SBitDecoder_LoadFunc  loader;\r
+\r
+\r
+      switch ( glyph_format )\r
+      {\r
+      case 1:\r
+      case 6:\r
+        loader = tt_sbit_decoder_load_byte_aligned;\r
+        break;\r
+\r
+      case 2:\r
+      case 5:\r
+      case 7:\r
+        loader = tt_sbit_decoder_load_bit_aligned;\r
+        break;\r
+\r
+      case 8:\r
+        if ( p + 1 > p_limit )\r
+          goto Fail;\r
+\r
+        p += 1;  /* skip padding */\r
+        /* fall-through */\r
+\r
+      case 9:\r
+        loader = tt_sbit_decoder_load_compound;\r
+        break;\r
+\r
+      default:\r
+        goto Fail;\r
+      }\r
+\r
+      error = loader( decoder, p, p_limit, x_pos, y_pos );\r
+    }\r
+\r
+  Fail:\r
+    FT_FRAME_RELEASE( data );\r
+\r
+  Exit:\r
+    return error;\r
+  }\r
+\r
+\r
+  static FT_Error\r
+  tt_sbit_decoder_load_image( TT_SBitDecoder  decoder,\r
+                              FT_UInt         glyph_index,\r
+                              FT_Int          x_pos,\r
+                              FT_Int          y_pos )\r
+  {\r
+    /*\r
+     *  First, we find the correct strike range that applies to this\r
+     *  glyph index.\r
+     */\r
+\r
+    FT_Byte*  p          = decoder->eblc_base + decoder->strike_index_array;\r
+    FT_Byte*  p_limit    = decoder->eblc_limit;\r
+    FT_ULong  num_ranges = decoder->strike_index_count;\r
+    FT_UInt   start, end, index_format, image_format;\r
+    FT_ULong  image_start = 0, image_end = 0, image_offset;\r
+\r
+\r
+    if ( p + 8 * num_ranges > p_limit )\r
+      goto NoBitmap;\r
+\r
+    for ( ; num_ranges > 0; num_ranges-- )\r
+    {\r
+      start = FT_NEXT_USHORT( p );\r
+      end   = FT_NEXT_USHORT( p );\r
+\r
+      if ( glyph_index >= start && glyph_index <= end )\r
+        goto FoundRange;\r
+\r
+      p += 4;  /* ignore index offset */\r
+    }\r
+    goto NoBitmap;\r
+\r
+  FoundRange:\r
+    image_offset = FT_NEXT_ULONG( p );\r
+    p = decoder->eblc_base + decoder->strike_index_array + image_offset;\r
+    if ( p + 8 > p_limit )\r
+      goto NoBitmap;\r
+\r
+    /* now find the glyph's location and extend within the ebdt table */\r
+    index_format = FT_NEXT_USHORT( p );\r
+    image_format = FT_NEXT_USHORT( p );\r
+    image_offset = FT_NEXT_ULONG ( p );\r
+\r
+    switch ( index_format )\r
+    {\r
+    case 1: /* 4-byte offsets relative to `image_offset' */\r
+      {\r
+        p += 4 * ( glyph_index - start );\r
+        if ( p + 8 > p_limit )\r
+          goto NoBitmap;\r
+\r
+        image_start = FT_NEXT_ULONG( p );\r
+        image_end   = FT_NEXT_ULONG( p );\r
+\r
+        if ( image_start == image_end )  /* missing glyph */\r
+          goto NoBitmap;\r
+      }\r
+      break;\r
+\r
+    case 2: /* big metrics, constant image size */\r
+      {\r
+        FT_ULong  image_size;\r
+\r
+\r
+        if ( p + 12 > p_limit )\r
+          goto NoBitmap;\r
+\r
+        image_size = FT_NEXT_ULONG( p );\r
+\r
+        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )\r
+          goto NoBitmap;\r
+\r
+        image_start = image_offset + image_size * ( glyph_index - start );\r
+        image_end   = image_start  + image_size;\r
+      }\r
+      break;\r
+\r
+    case 3: /* 2-byte offsets relative to 'image_offset' */\r
+      {\r
+        p += 2 * ( glyph_index - start );\r
+        if ( p + 4 > p_limit )\r
+          goto NoBitmap;\r
+\r
+        image_start = FT_NEXT_USHORT( p );\r
+        image_end   = FT_NEXT_USHORT( p );\r
+\r
+        if ( image_start == image_end )  /* missing glyph */\r
+          goto NoBitmap;\r
+      }\r
+      break;\r
+\r
+    case 4: /* sparse glyph array with (glyph,offset) pairs */\r
+      {\r
+        FT_ULong  mm, num_glyphs;\r
+\r
+\r
+        if ( p + 4 > p_limit )\r
+          goto NoBitmap;\r
+\r
+        num_glyphs = FT_NEXT_ULONG( p );\r
+        if ( p + ( num_glyphs + 1 ) * 4 > p_limit )\r
+          goto NoBitmap;\r
+\r
+        for ( mm = 0; mm < num_glyphs; mm++ )\r
+        {\r
+          FT_UInt  gindex = FT_NEXT_USHORT( p );\r
+\r
+\r
+          if ( gindex == glyph_index )\r
+          {\r
+            image_start = FT_NEXT_USHORT( p );\r
+            p          += 2;\r
+            image_end   = FT_PEEK_USHORT( p );\r
+            break;\r
+          }\r
+          p += 2;\r
+        }\r
+\r
+        if ( mm >= num_glyphs )\r
+          goto NoBitmap;\r
+      }\r
+      break;\r
+\r
+    case 5: /* constant metrics with sparse glyph codes */\r
+      {\r
+        FT_ULong  image_size, mm, num_glyphs;\r
+\r
+\r
+        if ( p + 16 > p_limit )\r
+          goto NoBitmap;\r
+\r
+        image_size = FT_NEXT_ULONG( p );\r
+\r
+        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )\r
+          goto NoBitmap;\r
+\r
+        num_glyphs = FT_NEXT_ULONG( p );\r
+        if ( p + 2 * num_glyphs > p_limit )\r
+          goto NoBitmap;\r
+\r
+        for ( mm = 0; mm < num_glyphs; mm++ )\r
+        {\r
+          FT_UInt  gindex = FT_NEXT_USHORT( p );\r
+\r
+\r
+          if ( gindex == glyph_index )\r
+            break;\r
+        }\r
+\r
+        if ( mm >= num_glyphs )\r
+          goto NoBitmap;\r
+\r
+        image_start = image_offset + image_size*mm;\r
+        image_end   = image_start + image_size;\r
+      }\r
+      break;\r
+\r
+    default:\r
+      goto NoBitmap;\r
+    }\r
+\r
+    if ( image_start > image_end )\r
+      goto NoBitmap;\r
+\r
+    image_end  -= image_start;\r
+    image_start = image_offset + image_start;\r
+\r
+    return tt_sbit_decoder_load_bitmap( decoder,\r
+                                        image_format,\r
+                                        image_start,\r
+                                        image_end,\r
+                                        x_pos,\r
+                                        y_pos );\r
+\r
+  NoBitmap:\r
+    return SFNT_Err_Invalid_Argument;\r
+  }\r
+\r
+\r
+  FT_LOCAL( FT_Error )\r
+  tt_face_load_sbit_image( TT_Face              face,\r
+                           FT_ULong             strike_index,\r
+                           FT_UInt              glyph_index,\r
+                           FT_UInt              load_flags,\r
+                           FT_Stream            stream,\r
+                           FT_Bitmap           *map,\r
+                           TT_SBit_MetricsRec  *metrics )\r
+  {\r
+    TT_SBitDecoderRec  decoder[1];\r
+    FT_Error           error;\r
+\r
+    FT_UNUSED( load_flags );\r
+    FT_UNUSED( stream );\r
+    FT_UNUSED( map );\r
+\r
+\r
+    error = tt_sbit_decoder_init( decoder, face, strike_index, metrics );\r
+    if ( !error )\r
+    {\r
+      error = tt_sbit_decoder_load_image( decoder, glyph_index, 0, 0 );\r
+      tt_sbit_decoder_done( decoder );\r
+    }\r
+\r
+    return error;\r
+  }\r
+\r
+/* EOF */\r
diff --git a/reactos/lib/freetype/src/sfnt/ttsbit0.h b/reactos/lib/freetype/src/sfnt/ttsbit0.h
new file mode 100644 (file)
index 0000000..647db5f
--- /dev/null
@@ -0,0 +1,7 @@
+/*\r
+ *  ttsbit0.h\r
+ *\r
+ *  This is a dummy file, used to please the build system.  It is never\r
+ *  included by the sfnt sources.\r
+ *\r
+ */\r
index 5ab9b60..8a792df 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/smooth Jamfile (c) 2001 David Turner
+# FreeType 2 src/smooth Jamfile
 #
+# Copyright 2001 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) smooth ;
 
index 499cc8c..9911915 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    A new `perfect' anti-aliasing renderer (body).                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003 by                                     */
+/*  Copyright 2000-2001, 2002, 2003, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   typedef long  TPos;     /* sub-pixel coordinate              */
 
   /* determine the type used to store cell areas.  This normally takes at */
-  /* least PIXEL_BYTES*2 + 1.  On 16-bit systems, we need to use `long'   */
-  /* instead of `int', otherwise bad things happen                        */
+  /* least PIXEL_BITS*2 + 1 bits.  On 16-bit systems, we need to use      */
+  /* `long' instead of `int', otherwise bad things happen                 */
 
 #if PIXEL_BITS <= 7
 
     }
 
     /* record the previous cell if needed (i.e., if we changed the cell */
-    /* position, of changed the `invalid' flag)                         */
+    /* position, or changed the `invalid' flag)                         */
     if ( ras.invalid != invalid || record )
       gray_record_cell( RAS_VAR );
 
 
 
   static void
-  gray_render_conic( RAS_ARG_ FT_Vector*  control,
-                              FT_Vector*  to )
+  gray_render_conic( RAS_ARG_ const FT_Vector*  control,
+                              const FT_Vector*  to )
   {
     TPos        dx, dy;
     int         top, level;
 
 
   static void
-  gray_render_cubic( RAS_ARG_ FT_Vector*  control1,
-                              FT_Vector*  control2,
-                              FT_Vector*  to )
+  gray_render_cubic( RAS_ARG_ const FT_Vector*  control1,
+                              const FT_Vector*  control2,
+                              const FT_Vector*  to )
   {
     TPos        dx, dy, da, db;
     int         top, level;
 
 
   static int
-  gray_move_to( FT_Vector*  to,
-                FT_Raster   raster )
+  gray_move_to( const FT_Vector*  to,
+                FT_Raster         raster )
   {
     TPos  x, y;
 
 
 
   static int
-  gray_line_to( FT_Vector*  to,
-                FT_Raster   raster )
+  gray_line_to( const FT_Vector*  to,
+                FT_Raster         raster )
   {
     gray_render_line( (PRaster)raster,
                       UPSCALE( to->x ), UPSCALE( to->y ) );
 
 
   static int
-  gray_conic_to( FT_Vector*  control,
-                 FT_Vector*  to,
-                 FT_Raster   raster )
+  gray_conic_to( const FT_Vector*  control,
+                 const FT_Vector*  to,
+                 FT_Raster         raster )
   {
     gray_render_conic( (PRaster)raster, control, to );
     return 0;
 
 
   static int
-  gray_cubic_to( FT_Vector*  control1,
-                 FT_Vector*  control2,
-                 FT_Vector*  to,
-                 FT_Raster   raster )
+  gray_cubic_to( const FT_Vector*  control1,
+                 const FT_Vector*  control2,
+                 const FT_Vector*  to,
+                 FT_Raster         raster )
   {
     gray_render_cubic( (PRaster)raster, control1, control2, to );
     return 0;
 
 
   static void
-  gray_render_span( int       y,
-                    int       count,
-                    FT_Span*  spans,
-                    PRaster   raster )
+  gray_render_span( int             y,
+                    int             count,
+                    const FT_Span*  spans,
+                    PRaster         raster )
   {
     unsigned char*  p;
     FT_Bitmap*      map = &raster->target;
 
 
   static void
-  gray_sweep( RAS_ARG_ FT_Bitmap*  target )
+  gray_sweep( RAS_ARG_ const FT_Bitmap*  target )
   {
     TCoord  x, y, cover;
     TArea   area;
   /*    Error code.  0 means sucess.                                       */
   /*                                                                       */
   static
-  int  FT_Outline_Decompose( FT_Outline*              outline,
+  int  FT_Outline_Decompose( const FT_Outline*        outline,
                              const FT_Outline_Funcs*  func_interface,
                              void*                    user )
   {
 
 
   extern int
-  gray_raster_render( PRaster            raster,
-                      FT_Raster_Params*  params )
+  gray_raster_render( PRaster                  raster,
+                      const FT_Raster_Params*  params )
   {
-    FT_Outline*  outline = (FT_Outline*)params->source;
-    FT_Bitmap*   target_map = params->target;
+    const FT_Outline*  outline    = (const FT_Outline*)params->source;
+    const FT_Bitmap*   target_map = params->target;
 
 
     if ( !raster || !raster->cells || !raster->max_cells )
 
   static void
   gray_raster_reset( FT_Raster    raster,
-                     const char*  pool_base,
+                     char*        pool_base,
                      long         pool_size )
   {
     PRaster  rast = (PRaster)raster;
index af8783e..54bf9e7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Anti-aliasing renderer interface (body).                             */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
   /* transform a given glyph image */
   static FT_Error
-  ft_smooth_transform( FT_Renderer   render,
-                       FT_GlyphSlot  slot,
-                       FT_Matrix*    matrix,
-                       FT_Vector*    delta )
+  ft_smooth_transform( FT_Renderer       render,
+                       FT_GlyphSlot      slot,
+                       const FT_Matrix*  matrix,
+                       const FT_Vector*  delta )
   {
     FT_Error  error = Smooth_Err_Ok;
 
 
   /* convert a slot's glyph image into a bitmap */
   static FT_Error
-  ft_smooth_render_generic( FT_Renderer     render,
-                            FT_GlyphSlot    slot,
-                            FT_Render_Mode  mode,
-                            FT_Vector*      origin,
-                            FT_Render_Mode  required_mode,
-                            FT_Int          hmul,
-                            FT_Int          vmul )
+  ft_smooth_render_generic( FT_Renderer       render,
+                            FT_GlyphSlot      slot,
+                            FT_Render_Mode    mode,
+                            const FT_Vector*  origin,
+                            FT_Render_Mode    required_mode,
+                            FT_Int            hmul,
+                            FT_Int            vmul )
   {
     FT_Error     error;
     FT_Outline*  outline = NULL;
 
   /* convert a slot's glyph image into a bitmap */
   static FT_Error
-  ft_smooth_render( FT_Renderer     render,
-                    FT_GlyphSlot    slot,
-                    FT_Render_Mode  mode,
-                    FT_Vector*      origin )
+  ft_smooth_render( FT_Renderer       render,
+                    FT_GlyphSlot      slot,
+                    FT_Render_Mode    mode,
+                    const FT_Vector*  origin )
   {
     if ( mode == FT_RENDER_MODE_LIGHT )
       mode = FT_RENDER_MODE_NORMAL;
 
   /* convert a slot's glyph image into a horizontal LCD bitmap */
   static FT_Error
-  ft_smooth_render_lcd( FT_Renderer     render,
-                        FT_GlyphSlot    slot,
-                        FT_Render_Mode  mode,
-                        FT_Vector*      origin )
+  ft_smooth_render_lcd( FT_Renderer       render,
+                        FT_GlyphSlot      slot,
+                        FT_Render_Mode    mode,
+                        const FT_Vector*  origin )
   {
     FT_Error  error;
 
 
   /* convert a slot's glyph image into a vertical LCD bitmap */
   static FT_Error
-  ft_smooth_render_lcd_v( FT_Renderer     render,
-                          FT_GlyphSlot    slot,
-                          FT_Render_Mode  mode,
-                          FT_Vector*      origin )
+  ft_smooth_render_lcd_v( FT_Renderer       render,
+                          FT_GlyphSlot      slot,
+                          FT_Render_Mode    mode,
+                          const FT_Vector*  origin )
   {
     FT_Error  error;
 
index 4923005..1928ae1 100644 (file)
@@ -93,7 +93,7 @@ start = r'''
 
 column = r'''
   \s*         # any number of whitespace
-  \*{1}       # followed by precisely one asterisk
+  \*{1}(?!/)  # followed by precisely one asterisk not followed by `/'
   (.*)        # then anything (group1)
 '''
 
index e8e80ec..6131098 100644 (file)
@@ -6,7 +6,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2005 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 
 usage: %s <output-file>
 
-  This very simple python script is used to generate the glyph names
-  tables defined in the PSNames module.
+  This python script generates the glyph names tables defined in the
+  PSNames module.
 
   Its single argument is the name of the header file to be created.
 """
 
 
-import sys, string
+import sys, string, struct, re, os.path
 
 
-# This table is used to name the glyphs according to the Macintosh
-# specification.  It is used by the TrueType Postscript names table.
+# This table lists the glyphs according to the Macintosh specification.
+# It is used by the TrueType Postscript names table.
+#
+# See
+#
+#   http://fonts.apple.com/TTRefMan/RM06/Chap6post.html
 #
-# See http://fonts.apple.com/TTRefMan/RM06/Chap6post.html
 # for the official list.
 #
 mac_standard_names = \
@@ -145,9 +148,10 @@ mac_standard_names = \
 ]
 
 
-# The list of standard "SID" glyph names.  For the official list,
+# The list of standard `SID' glyph names.  For the official list,
 # see Annex A of document at
-# http://partners.adobe.com/asn/developer/pdfs/tn/5176.CFF.pdf.
+#
+#   http://partners.adobe.com/asn/developer/pdfs/tn/5176.CFF.pdf.
 #
 sid_standard_names = \
 [
@@ -412,6 +416,7 @@ t1_expert_encoding = \
 # version 2.0, 22 Sept 2002.  It is available from
 #
 #   http://partners.adobe.com/asn/developer/typeforum/unicodegn.html
+#   http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
 #
 adobe_glyph_list = """\
 A;0041
@@ -4698,23 +4703,250 @@ zukatakana;30BA
 """
 
 
-t1_bias    = 0
-glyph_list = []
+# string table management
+#
+class StringTable:
+  def __init__( self, name_list, master_table_name ):
+    self.names        = name_list
+    self.master_table = master_table_name
+    self.indices      = {}
+    index             = 0
+
+    for name in name_list:
+      self.indices[name] = index
+      index += len( name ) + 1
+
+    self.total = index
+
+  def dump( self, file ):
+    write = file.write
+    write( "  static const char  " + self.master_table +
+           "[" + repr( self.total ) + "] =\n" )
+    write( "  {\n" )
+
+    line = ""
+    for name in self.names:
+      line += "    '"
+      line += string.join( ( re.findall( ".", name ) ), "','" )
+      line += "', 0,\n"
+
+    write( line + "  };\n\n\n" )
+
+  def dump_sublist( self, file, table_name, macro_name, sublist ):
+    write = file.write
+    write( "#define " + macro_name + "  " + repr( len( sublist ) ) + "\n\n" )
+
+    write( "  /* Values are offsets into the `" +
+           self.master_table + "' table */\n\n" )
+    write( "  static const short  " + table_name +
+           "[" + macro_name + "] =\n" )
+    write( "  {\n" )
+
+    line  = "    "
+    comma = ""
+    col   = 0
+
+    for name in sublist:
+      line += comma
+      line += "%4d" % self.indices[name]
+      col  += 1
+      comma = ","
+      if col == 14:
+        col   = 0
+        comma = ",\n    "
+
+    write( line + "\n  };\n\n\n" )
+
+
+# We now store the Adobe Glyph List in compressed form.  The list is put
+# into a data structure called `trie' (because it has a tree-like
+# appearance).  Consider, for example, that you want to store the
+# following name mapping:
+#
+#   A        => 1
+#   Aacute   => 6
+#   Abalon   => 2
+#   Abstract => 4
+#
+# It is possible to store the entries as follows.
+#
+#   A => 1
+#   |
+#   +-acute => 6
+#   |
+#   +-b
+#     |
+#     +-alon => 2
+#     |
+#     +-stract => 4
+#
+# We see that each node in the trie has:
+#
+# - one or more `letters'
+# - an optional value
+# - zero or more child nodes
+#
+# The first step is to call
+#
+#   root = StringNode( "", 0 )
+#   for word in map.values():
+#     root.add( word, map[word] )
+#
+# which creates a large trie where each node has only one children.
+#
+# Executing
+#
+#   root = root.optimize()
+#
+# optimizes the trie by merging the letters of successive nodes whenever
+# possible.
+#
+# Each node of the trie is stored as follows.
+#
+# - First the node's letter, according to the following scheme.  We
+#   use the fact that in the AGL no name contains character codes > 127.
+#
+#     name         bitsize     description
+#     ----------------------------------------------------------------
+#     notlast            1     Set to 1 if this is not the last letter
+#                              in the word.
+#     ascii              7     The letter's ASCII value.
+#
+# - The letter is followed by a children count and the value of the
+#   current key (if any).  Again we can do some optimization because all
+#   AGL entries are from the BMP; this means that 16 bits are sufficient
+#   to store its Unicode values.  Additionally, no node has more than
+#   127 children.
+#
+#     name         bitsize     description
+#     -----------------------------------------
+#     hasvalue           1     Set to 1 if a 16-bit Unicode value follows.
+#     num_children       7     Number of childrens.  Can be 0 only if
+#                              `hasvalue' is set to 1.
+#     value             16     Optional Unicode value.
+#
+# - A node is finished by a list of 16bit absolute offsets to the
+#   children, which must be sorted in increasing order of their first
+#   letter.
+#
+# For simplicity, all 16bit quantities are stored in big-endian order.
+#
+# The root node has first letter = 0, and no value.
+#
+class StringNode:
+  def __init__( self, letter, value ):
+    self.letter   = letter
+    self.value    = value
+    self.children = {}
+
+  def __cmp__( self, other ):
+    return ord( self.letter[0] ) - ord( other.letter[0] )
+
+  def add( self, word, value ):
+    if len( word ) == 0:
+      self.value = value
+      return
+
+    letter = word[0]
+    word   = word[1:]
 
+    if self.children.has_key( letter ):
+      child = self.children[letter]
+    else:
+      child = StringNode( letter, 0 )
+      self.children[letter] = child
 
-def adobe_glyph_names():
-  """return the list of glyph names from the adobe list"""
+    child.add( word, value )
 
-  lines  = string.split( adobe_glyph_list, '\n' )
-  glyphs = []
+  def optimize( self ):
+    # optimize all children first
+    children      = self.children.values()
+    self.children = {}
 
-  for line in lines:
-    if line:
-      fields = string.split( line, ';' )
-#     print fields[1] + ' - ' + fields[0]
-      glyphs.append( fields[0] )
+    for child in children:
+      self.children[child.letter[0]] = child.optimize()
+
+    # don't optimize if there's a value,
+    # if we don't have any child or if we
+    # have more than one child
+    if ( self.value != 0 ) or ( not children ) or len( children ) > 1:
+      return self
+
+    child = children[0]
+
+    self.letter  += child.letter
+    self.value    = child.value
+    self.children = child.children
+
+    return self
+
+  def dump_debug( self, write, margin ):
+    # this is used during debugging
+    line = margin + "+-"
+    if len( self.letter ) == 0:
+      line += "<NOLETTER>"
+    else:
+      line += self.letter
+
+    if self.value:
+      line += " => " + repr( self.value )
+
+    write( line + "\n" )
+
+    if self.children:
+      margin += "| "
+      for child in self.children.values():
+        child.dump_debug( write, margin )
+
+  def locate( self, index ):
+    self.index = index
+    if len( self.letter ) > 0:
+      index += len( self.letter ) + 1
+    else:
+      index += 2
+
+    if self.value != 0:
+      index += 2
+
+    children = self.children.values()
+    children.sort()
 
-  return glyphs
+    index += 2 * len( children )
+    for child in children:
+      index = child.locate( index )
+
+    return index
+
+  def store( self, storage ):
+    # write the letters
+    l = len( self.letter )
+    if l == 0:
+      storage += struct.pack( "B", 0 )
+    else:
+      for n in range( l ):
+        val = ord( self.letter[n] )
+        if n < l - 1:
+          val += 128
+        storage += struct.pack( "B", val )
+
+    # write the count
+    children = self.children.values()
+    children.sort()
+
+    count = len( children )
+
+    if self.value != 0:
+      storage += struct.pack( "!BH", count + 128, self.value )
+    else:
+      storage += struct.pack( "B", count )
+
+    for child in children:
+      storage += struct.pack( "!H", child.index )
+
+    for child in children:
+      storage = child.store( storage )
+
+    return storage
 
 
 def adobe_glyph_values():
@@ -4737,7 +4969,7 @@ def adobe_glyph_values():
 
 
 def filter_glyph_names( alist, filter ):
-  """filter 'alist' by taking _out_ all glyph names that are in 'filter'"""
+  """filter `alist' by taking _out_ all glyph names that are in `filter'"""
 
   count  = 0
   extras = []
@@ -4751,107 +4983,56 @@ def filter_glyph_names( alist, filter ):
   return extras
 
 
-def dump_mac_indices( file, all_glyphs ):
-  write = file.write
-
-  write( "  static const unsigned short  mac_standard_names[" + \
-         repr( len( mac_standard_names ) + 1 ) + "] =\n" )
-  write( "  {\n" )
-
-  for name in mac_standard_names:
-    write( "    " + repr( all_glyphs.index( name ) ) + ",\n" )
-
-  write( "    0\n" )
-  write( "  };\n" )
-  write( "\n" )
-  write( "\n" )
-
+def dump_encoding( file, encoding_name, encoding_list ):
+  """dump a given encoding"""
 
-def dump_glyph_list( file, base_list, adobe_list ):
   write = file.write
-
-  name_list = []
-
-  write( "  static const char* const  ps_glyph_names[] =\n" )
+  write( "  /* the following are indices into the SID name table */\n" )
+  write( "  static const unsigned short  " + encoding_name +
+         "[" + repr( len( encoding_list ) ) + "] =\n" )
   write( "  {\n" )
 
-  for name in base_list:
-    write( '    "' + name + '",\n' )
-    name_list.append( name )
-
-  write( "\n" )
-  write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" )
-  write( "\n" )
-
-  for name in adobe_list:
-    write( '    "' + name + '",\n' )
-    name_list.append( name )
-
-  write( "\n" )
-  write( "#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n" )
-  write( "\n" )
-  write( "    NULL\n" )
-  write( "  };\n" )
-  write( "\n" )
-  write( "\n" )
-
-  return name_list
+  line  = "    "
+  comma = ""
+  col   = 0
+  for value in encoding_list:
+    line += comma
+    line += "%3d" % value
+    comma = ","
+    col  += 1
+    if col == 16:
+      col = 0
+      comma = ",\n    "
 
+  write( line + "\n  };\n\n\n" )
 
-def dump_unicode_values( file, sid_list, adobe_list ):
-  """build the glyph names to unicode values table"""
 
-  write = file.write
-
-  agl_names, agl_unicodes = adobe_glyph_values()
+def dump_array( the_array, write, array_name ):
+  """dumps a given encoding"""
 
-  write( "\n" )
-  write( "  static const unsigned short  ps_names_to_unicode[" + \
-          repr( len( sid_list ) + len( adobe_list ) + 1 ) + "] =\n" )
+  write( "  static const unsigned char  " + array_name +
+         "[" + repr( len( the_array ) ) + "] =\n" )
   write( "  {\n" )
 
-  for name in sid_list:
-    try:
-      index = agl_names.index( name )
-      write( "    0x" + agl_unicodes[index] + "U,\n" )
-    except:
-      write( "    0,\n" )
-
-  write( "\n" )
-  write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" )
-  write( "\n" )
-
-  for name in adobe_list:
-    try:
-      index = agl_names.index( name )
-      write( "    0x" + agl_unicodes[index] + "U,\n" )
-    except:
-      write( "    0,\n" )
-
-  write( "\n" )
-  write( "#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n" )
-  write( "    0\n" )
-  write( "  };\n" )
-  write( "\n" )
-  write( "\n" )
-  write( "\n" )
+  line  = ""
+  comma = "    "
+  col   = 0
 
+  for value in the_array:
+    line += comma
+    line += "%3d" % ord( value )
+    comma = ","
+    col  += 1
 
-def dump_encoding( file, encoding_name, encoding_list ):
-  """dumps a given encoding"""
+    if col == 16:
+      col   = 0
+      comma = ",\n    "
 
-  write = file.write
+    if len( line ) > 1024:
+      write( line )
+      line = ""
 
-  write( "  static const unsigned short  " + encoding_name + "[" + \
-          repr( len( encoding_list ) + 1 ) + "] =\n" )
-  write( "  {\n" )
-
-  for value in encoding_list:
-    write( "    " + repr( value ) + ",\n" )
-  write( "    0\n" )
-  write( "  };\n" )
-  write( "\n" )
-  write( "\n" )
+  write( line + "\n  };\n\n\n" )
 
 
 def main():
@@ -4866,37 +5047,27 @@ def main():
 
   count_sid = len( sid_standard_names )
 
-  # 'mac_extras' contains the list of glyph names in the Macintosh standard
-  # encoding which are not in either the Adobe Glyph List or the SID
-  # Standard Names.
+  # `mac_extras' contains the list of glyph names in the Macintosh standard
+  # encoding which are not in the SID Standard Names.
   #
-  mac_extras = filter_glyph_names( mac_standard_names, adobe_glyph_names() )
-  mac_extras = filter_glyph_names( mac_extras, sid_standard_names )
+  mac_extras = filter_glyph_names( mac_standard_names, sid_standard_names )
 
-  # 'base_list' contains the first names of our final glyph names table.
-  # It consists of the 'mac_extras' glyph names, followed by the SID
-  # Standard names.
+  # `base_list' contains the names of our final glyph names table.
+  # It consists of the `mac_extras' glyph names, followed by the SID
+  # standard names.
   #
   mac_extras_count = len( mac_extras )
-  t1_bias          = mac_extras_count
   base_list        = mac_extras + sid_standard_names
 
-  # 'adobe_list' contains the glyph names that are in the AGL, but not in
-  # the base_list; they will be placed after base_list glyph names in
-  # our final table.
-  #
-  adobe_list  = filter_glyph_names( adobe_glyph_names(), base_list )
-  adobe_count = len( adobe_list )
-
   write( "/***************************************************************************/\n" )
   write( "/*                                                                         */\n" )
 
-  write( "/*  %-71s*/\n" % sys.argv[1] )
+  write( "/*  %-71s*/\n" % os.path.basename( sys.argv[1] ) )
 
   write( "/*                                                                         */\n" )
-  write( "/*    PostScript glyph names (specification only).                         */\n" )
+  write( "/*    PostScript glyph names.                                              */\n" )
   write( "/*                                                                         */\n" )
-  write( "/*  Copyright 2000-2001, 2003 by                                           */\n" )
+  write( "/*  Copyright 2005 by                                                      */\n" )
   write( "/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n" )
   write( "/*                                                                         */\n" )
   write( "/*  This file is part of the FreeType project, and may only be used,       */\n" )
@@ -4908,42 +5079,199 @@ def main():
   write( "/***************************************************************************/\n" )
   write( "\n" )
   write( "\n" )
-  write( "  /* this file has been generated automatically -- do not edit! */\n" )
+  write( "  /* This file has been generated automatically -- do not edit! */\n" )
   write( "\n" )
   write( "\n" )
 
-  # dump final glyph list (mac extras + sid standard names + AGL glyph names)
+  # dump final glyph list (mac extras + sid standard names)
   #
-  name_list = dump_glyph_list( file, base_list, adobe_list )
+  st = StringTable( base_list, "ft_standard_glyph_names" )
 
-  # dump t1_standard_list
-  write( "  static const char* const * const  sid_standard_names = " \
-          + "ps_glyph_names + " + repr( t1_bias ) + ";\n" )
-  write( "\n" )
-  write( "\n" )
-
-  write( "#define NUM_SID_GLYPHS " + repr( len( sid_standard_names ) ) + "\n" )
-  write( "\n" )
-  write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" )
-  write( "#define NUM_ADOBE_GLYPHS " + \
-          repr( len( base_list ) + len( adobe_list ) - t1_bias ) + "\n" )
-  write( "#else\n" )
-  write( "#define NUM_ADOBE_GLYPHS " + \
-          repr( len( base_list ) - t1_bias )  + "\n" )
-  write( "#endif\n" )
-  write( "\n" )
-  write( "\n" )
-
-  # dump mac indices table
-  dump_mac_indices( file, name_list )
-
-  # dump unicode values table
-  dump_unicode_values( file, sid_standard_names, adobe_list )
+  st.dump( file )
+  st.dump_sublist( file, "ft_mac_names",
+                   "FT_NUM_MAC_NAMES", mac_standard_names )
+  st.dump_sublist( file, "ft_sid_names",
+                   "FT_NUM_SID_NAMES", sid_standard_names )
 
   dump_encoding( file, "t1_standard_encoding", t1_standard_encoding )
   dump_encoding( file, "t1_expert_encoding", t1_expert_encoding )
 
-  write( "/* END */\n" )
+  # dump the AGL in its compressed form
+  #
+  agl_glyphs, agl_values = adobe_glyph_values()
+  dict = StringNode( "", 0 )
+
+  for g in range( len( agl_glyphs ) ):
+    dict.add( agl_glyphs[g], eval( "0x" + agl_values[g] ) )
+
+  dict       = dict.optimize()
+  dict_len   = dict.locate( 0 )
+  dict_array = dict.store( "" )
+
+  write( """\
+  /*
+   *  This table is a compressed version of the Adobe Glyph List (AGL),
+   *  optimized for efficient searching.  It has been generated by the
+   *  `glnames.py' python script located in the `src/tools' directory.
+   *
+   *  The lookup function to get the Unicode value for a given string
+   *  is defined below the table.
+   */
+""" )
+
+  dump_array( dict_array, write, "ft_adobe_glyph_list" )
+
+  # write the lookup routine now
+  #
+  write( """\
+  /*
+   *  This function searches the compressed table efficiently.
+   */
+  static unsigned long
+  ft_get_adobe_glyph_index( const char*  name,
+                            const char*  limit )
+  {
+    int                   c = 0;
+    int                   count, min, max;
+    const unsigned char*  p = ft_adobe_glyph_list;
+
+
+    if ( name == 0 || name >= limit )
+      goto NotFound;
+
+    c     = *name++;
+    count = p[1];
+    p    += 2;
+
+    min = 0;
+    max = count;
+
+    while ( min < max )
+    {
+      int                   mid = ( min + max ) >> 1;
+      const unsigned char*  q   = p + mid * 2;
+      int                   c2;
+
+
+      q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] );
+
+      c2 = q[0] & 127;
+      if ( c2 == c )
+      {
+        p = q;
+        goto Found;
+      }
+      if ( c2 < c )
+        min = mid + 1;
+      else
+        max = mid;
+    }
+    goto NotFound;
+
+  Found:
+    for (;;)
+    {
+      /* assert (*p & 127) == c */
+
+      if ( name >= limit )
+      {
+        if ( (p[0] & 128) == 0 &&
+             (p[1] & 128) != 0 )
+          return (unsigned long)( ( (int)p[2] << 8 ) | p[3] );
+
+        goto NotFound;
+      }
+      c = *name++;
+      if ( p[0] & 128 )
+      {
+        p++;
+        if ( c != (p[0] & 127) )
+          goto NotFound;
+
+        continue;
+      }
+
+      p++;
+      count = p[0] & 127;
+      if ( p[0] & 128 )
+        p += 2;
+
+      p++;
+
+      for ( ; count > 0; count--, p += 2 )
+      {
+        int                   offset = ( (int)p[0] << 8 ) | p[1];
+        const unsigned char*  q      = ft_adobe_glyph_list + offset;
+
+        if ( c == ( q[0] & 127 ) )
+        {
+          p = q;
+          goto NextIter;
+        }
+      }
+      goto NotFound;
+
+    NextIter:
+      ;
+    }
+
+  NotFound:
+    return 0;
+  }
+
+""" )
+
+  if 0:  # generate unit test, or don't
+    #
+    # now write the unit test to check that everything works OK
+    #
+    write( "#ifdef TEST\n\n" )
+
+    write( "static const char* const  the_names[] = {\n" )
+    for name in agl_glyphs:
+      write( '  "' + name + '",\n' )
+    write( "  0\n};\n" )
+
+    write( "static const unsigned long  the_values[] = {\n" )
+    for val in agl_values:
+      write( '  0x' + val + ',\n' )
+    write( "  0\n};\n" )
+
+    write( """
+#include <stdlib.h>
+#include <stdio.h>
+
+  int
+  main( void )
+  {
+    int                   result = 0;
+    const char* const*    names  = the_names;
+    const unsigned long*  values = the_values;
+
+
+    for ( ; *names; names++, values++ )
+    {
+      const char*    name      = *names;
+      unsigned long  reference = *values;
+      unsigned long  value;
+
+
+      value = ft_get_adobe_glyph_index( name, name + strlen( name ) );
+      if ( value != reference )
+      {
+        result = 1;
+        fprintf( stderr, "name '%s' => %04x instead of %04x\\n",
+                         name, value, reference );
+      }
+    }
+
+    return result;
+  }
+""" )
+
+    write( "#endif /* TEST */\n" )
+
+  write("\n/* END */\n")
 
 
 # Now run the main routine
index bb7e05e..a166909 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/truetype Jamfile (c) 2001, 2004 David Turner
+# FreeType 2 src/truetype Jamfile
 #
+# Copyright 2001, 2004 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) truetype ;
 
index 2594883..c981dfd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -69,7 +69,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    Get_Kerning                                                        */
+  /*    tt_get_kerning                                                     */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A driver method used to return the kerning vector between two      */
   /*    They can be implemented by format-specific interfaces.             */
   /*                                                                       */
   static FT_Error
-  Get_Kerning( FT_Face     ttface,          /* TT_Face */
-               FT_UInt     left_glyph,
-               FT_UInt     right_glyph,
-               FT_Vector*  kerning )
+  tt_get_kerning( FT_Face     ttface,          /* TT_Face */
+                  FT_UInt     left_glyph,
+                  FT_UInt     right_glyph,
+                  FT_Vector*  kerning )
   {
-    TT_Face        face = (TT_Face)ttface;
-    TT_Kern0_Pair  pair;
+    TT_Face       face = (TT_Face)ttface;
+    SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
 
 
-    if ( !face )
-      return TT_Err_Invalid_Face_Handle;
-
     kerning->x = 0;
     kerning->y = 0;
 
-    if ( face->kern_pairs )
-    {
-      /* there are some kerning pairs in this font file! */
-      FT_ULong  search_tag = PAIR_TAG( left_glyph, right_glyph );
-      FT_Long   left, right;
-
-
-      left  = 0;
-      right = face->num_kern_pairs - 1;
-
-      while ( left <= right )
-      {
-        FT_Long   middle = left + ( ( right - left ) >> 1 );
-        FT_ULong  cur_pair;
-
-
-        pair     = face->kern_pairs + middle;
-        cur_pair = PAIR_TAG( pair->left, pair->right );
-
-        if ( cur_pair == search_tag )
-          goto Found;
-
-        if ( cur_pair < search_tag )
-          left = middle + 1;
-        else
-          right = middle - 1;
-      }
-    }
-
-  Exit:
-    return TT_Err_Ok;
-
-  Found:
-    kerning->x = pair->value;
-    goto Exit;
+    if ( sfnt )
+      kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );
+      
+    return 0;
   }
 
 
     Set_Pixel_Sizes,
     Load_Glyph,
 
-    Get_Kerning,
+    tt_get_kerning,
     0,                      /* FT_Face_AttachFunc      */
     0                       /* FT_Face_GetAdvancesFunc */
   };
index 9fc2d03..d1ad181 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType Glyph Loader (body).                                        */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -25,6 +25,7 @@
 #include FT_OUTLINE_H
 
 #include "ttgload.h"
+#include "ttpload.h"
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
 #include "ttgxvar.h"
@@ -74,7 +75,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    TT_Get_Metrics                                                     */
+  /*    tt_face_get_metrics                                                */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Returns the horizontal or vertical metrics in font units for a     */
   /*    This function will much probably move to another component in the  */
   /*    near future, but I haven't decided which yet.                      */
   /*                                                                       */
-  FT_LOCAL_DEF( void )
-  TT_Get_Metrics( TT_HoriHeader*  header,
-                  FT_UInt         idx,
-                  FT_Short*       bearing,
-                  FT_UShort*      advance )
+#ifdef FT_OPTIMIZE_MEMORY
+
+  static void
+  tt_face_get_metrics( TT_Face     face,
+                       FT_Bool     vertical,
+                       FT_UInt     idx,
+                       FT_Short   *abearing,
+                       FT_UShort  *aadvance )
+  {
+    TT_HoriHeader*  header;
+    FT_Byte*        p;
+    FT_Byte*        limit;
+    FT_UShort       k;
+
+
+    if ( vertical )
+    {
+      header = (TT_HoriHeader*)&face->vertical;
+      p      = face->vert_metrics;
+      limit  = p + face->vert_metrics_size;
+    }
+    else
+    {
+      header = &face->horizontal;
+      p      = face->horz_metrics;
+      limit  = p + face->horz_metrics_size;
+    }
+    
+    k = header->number_Of_HMetrics;
+    
+    if ( k > 0 )
+    {
+      if ( idx < (FT_UInt)k )
+      {
+        p += 4 * idx;
+        if ( p + 4 > limit )
+          goto NoData;
+          
+        *aadvance = FT_NEXT_USHORT( p );
+        *abearing = FT_NEXT_SHORT( p );
+      }
+      else
+      {
+        p += 4 * ( k - 1 );
+        if ( p + 4 > limit )
+          goto NoData;
+          
+        *aadvance = FT_NEXT_USHORT( p );
+        p += 2 + 2 * ( idx - k );
+        if ( p + 2 > limit )
+          *abearing = 0;
+        else
+          *abearing = FT_PEEK_SHORT( p );
+      }
+    }
+    else
+    {
+    NoData:
+      *abearing = 0;
+      *aadvance = 0;
+    }
+  }
+
+#else /* !FT_OPTIMIZE_MEMORY */
+
+  static void
+  tt_face_get_metrics( TT_Face     face,
+                       FT_Bool     vertical,
+                       FT_UInt     idx,
+                       FT_Short   *abearing,
+                       FT_UShort  *aadvance )
   {
+    TT_HoriHeader*  header = vertical ? (TT_HoriHeader*)&face->vertical
+                                      :                 &face->horizontal;
     TT_LongMetrics  longs_m;
-    FT_UShort       k = header->number_Of_HMetrics;
+    FT_UShort       k      = header->number_Of_HMetrics;
 
 
     if ( k == 0 )
     {
-      *bearing = *advance = 0;
+      *abearing = *aadvance = 0;
       return;
     }
 
     if ( idx < (FT_UInt)k )
     {
-      longs_m  = (TT_LongMetrics )header->long_metrics + idx;
-      *bearing = longs_m->bearing;
-      *advance = longs_m->advance;
+      longs_m   = (TT_LongMetrics)header->long_metrics + idx;
+      *abearing = longs_m->bearing;
+      *aadvance = longs_m->advance;
     }
     else
     {
-      *bearing = ((TT_ShortMetrics*)header->short_metrics)[idx - k];
-      *advance = ((TT_LongMetrics )header->long_metrics)[k - 1].advance;
+      *abearing = ((TT_ShortMetrics*)header->short_metrics)[idx - k];
+      *aadvance = ((TT_LongMetrics)header->long_metrics)[k - 1].advance;
     }
   }
 
+#endif /* !FT_OPTIMIZE_MEMORY */
+
 
   /*************************************************************************/
   /*                                                                       */
                 FT_Short*   lsb,
                 FT_UShort*  aw )
   {
-    TT_Get_Metrics( &face->horizontal, idx, lsb, aw );
+    tt_face_get_metrics( face, 0, idx, lsb, aw );
 
     if ( check && face->postscript.isFixedPitch )
       *aw = face->horizontal.advance_Width_Max;
   /* in the font's `hdmx' table (if any).                                  */
   /*                                                                       */
   static FT_Byte*
-  Get_Advance_Widths( TT_Face    face,
-                      FT_UShort  ppem )
+  Get_Advance_WidthPtr( TT_Face  face,
+                        FT_Int   ppem,
+                        FT_UInt  gindex )
   {
+#ifdef FT_OPTIMIZE_MEMORY
+
+    FT_UInt   nn;
+    FT_Byte*  result      = NULL;
+    FT_ULong  record_size = face->hdmx_record_size;
+    FT_Byte*  record      = face->hdmx_table + 8;
+    
+
+    for ( nn = 0; nn < face->hdmx_record_count; nn++ )
+      if ( face->hdmx_record_sizes[nn] == ppem )
+      {
+        gindex += 2;
+        if ( gindex < record_size )
+          result = record + gindex;
+        break;
+      }
+
+    return result;
+
+#else
+
     FT_UShort  n;
 
 
     for ( n = 0; n < face->hdmx.num_records; n++ )
       if ( face->hdmx.records[n].ppem == ppem )
-        return face->hdmx.records[n].widths;
+        return &face->hdmx.records[n].widths[gindex];
 
     return NULL;
+
+#endif
   }
 
 
     FT_UNUSED( check );
 
     if ( face->vertical_info )
-      TT_Get_Metrics( (TT_HoriHeader *)&face->vertical, idx, tsb, ah );
+      tt_face_get_metrics( face, 1, idx, tsb, ah );
 
 #if 1             /* Emperically determined, at variance with what MS said */
 
     flag       = (FT_Byte*)outline->tags;
     flag_limit = flag + n_points;
 
+    FT_ASSERT( flag != NULL );
+
     while ( flag < flag_limit )
     {
       if ( --byte_len < 0 )
     if ( IS_HINTED( load->load_flags ) )
     {
       FT_Pos  x = zone->org[n_points-4].x;
-      FT_Pos  y = zone->org[n_points-2].y;
 
 
       x = FT_PIX_ROUND( x ) - x;
-      y = FT_PIX_ROUND( y ) - y;
-      translate_array( n_points, zone->org, x, y );
+      translate_array( n_points, zone->org, x, 0 );
 
       org_to_cur( n_points, zone );
 
           goto Exit;
 
         load->exec->is_composite     = FALSE;
-        load->exec->pedantic_hinting = (FT_Bool)( load->load_flags &
-                                                  FT_LOAD_PEDANTIC );
         load->exec->pts              = *zone;
         load->exec->pts.n_points    += 4;
 
 
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
 
-    {
-      offset = face->glyph_locations[glyph_index];
-      count  = 0;
-
-      if ( glyph_index < (FT_UInt)face->num_locations - 1 )
-        count = (FT_UInt)( face->glyph_locations[glyph_index + 1] - offset );
-    }
+    offset = tt_face_get_location( face, glyph_index, &count );
 
     if ( count == 0 )
     {
         FT_Memory  memory = loader->face->memory;
 
 
-        if ( (error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
-                                                glyph_index,
-                                                &deltas,
-                                                4 ) ) )
+        error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
+                                          glyph_index, &deltas, 4 );
+        if ( error )
           goto Exit;
 
         loader->pp1.x += deltas[0].x; loader->pp1.y += deltas[0].y;
                         face,
                         glyph_index,
                         &deltas,
-                        gloader->current.num_subglyphs + 4 ) ) )
+                        gloader->current.num_subglyphs + 4 )) != 0 )
           goto Exit;
 
         /* Note: No subglyph reallocation here, our pointers are stable. */
           if ( IS_HINTED( loader->load_flags ) && n_ins > 0 )
           {
             exec->is_composite     = TRUE;
-            exec->pedantic_hinting =
-              (FT_Bool)( loader->load_flags & FT_LOAD_PEDANTIC );
             error = TT_Run_Context( exec, ((TT_Size)loader->size)->debug );
             if ( error && exec->pedantic_hinting )
               goto Fail;
            face->root.internal->incremental_interface->funcs->get_glyph_metrics )
       {
         FT_Incremental_MetricsRec  metrics;
-        FT_Error                   error = 0;
+        FT_Error                   error = TT_Err_Ok;
 
 
         metrics.bearing_x = 0;
     if ( !face->postscript.isFixedPitch && size &&
          IS_HINTED( loader->load_flags )        )
     {
-      FT_Byte*  widths = Get_Advance_Widths( face,
-                                             size->root.metrics.x_ppem );
+      FT_Byte*  widthp = Get_Advance_WidthPtr( face,
+                                               size->root.metrics.x_ppem,
+                                               glyph_index );
 
 
-      if ( widths )
-        glyph->metrics.horiAdvance = widths[glyph_index] << 6;
+      if ( widthp )
+        glyph->metrics.horiAdvance = *widthp << 6;
     }
 
     /* set glyph dimensions */
     face   = (TT_Face)glyph->face;
     sfnt   = (SFNT_Service)face->sfnt;
     stream = face->root.stream;
-    error  = 0;
+    error  = TT_Err_Ok;
 
     if ( !size || ( load_flags & FT_LOAD_NO_SCALE )   ||
                   ( load_flags & FT_LOAD_NO_RECURSE ) )
 
     /* update the glyph zone bounds */
     {
-      FT_GlyphLoader  gloader = FT_FACE_DRIVER(face)->glyph_loader;
+      FT_GlyphLoader  gloader = FT_FACE_DRIVER( face )->glyph_loader;
 
 
       loader.gloader = gloader;
       /* load default graphics state - if needed */
       if ( size->GS.instruct_control & 2 )
         loader.exec->GS = tt_default_graphics_state;
+
+      loader.exec->pedantic_hinting =
+         FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
+
+      loader.exec->grayscale =
+         FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != FT_LOAD_TARGET_MONO );
     }
 
 #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
index dfa2a60..665c224 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType Glyph Loader (specification).                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 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( void )
-  TT_Get_Metrics( TT_HoriHeader*  header,
-                  FT_UInt         idx,
-                  FT_Short*       bearing,
-                  FT_UShort*      advance );
-
   FT_LOCAL( void )
   TT_Init_Glyph_Loading( TT_Face  face );
 
index e48bb50..fe5eaa3 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType GX Font Variation loader                                    */
 /*                                                                         */
-/*  Copyright 2004 by                                                      */
+/*  Copyright 2004, 2005 by                                                */
 /*  David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -92,7 +92,7 @@
   /* indicates that there is a delta for every point without needing to    */
   /* enumerate all of them.                                                */
   /*                                                                       */
-#define ALL_POINTS  (FT_UShort*)(-1)
+#define ALL_POINTS  (FT_UShort*)( -1 )
 
 
   enum
     FT_Int     j;
     FT_Int     first;
     FT_Memory  memory = stream->memory;
-    FT_Error   error;
+    FT_Error   error = TT_Err_Ok;
+
+    FT_UNUSED( error );
 
 
     *point_cnt = n = FT_GET_BYTE();
       if ( runcnt & GX_PT_POINTS_ARE_WORDS )
       {
         runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK;
-        points[i++] = first = FT_GET_USHORT();
+        first  = points[i++] = FT_GET_USHORT();
 
         /* first point not included in runcount */
         for ( j = 0; j < runcnt; ++j )
-          points[i++] = ( first += FT_GET_USHORT() );
+          points[i++] = (FT_UShort)( first += FT_GET_USHORT() );
       }
       else
       {
-        points[i++] = first = FT_GET_BYTE();
+        first = points[i++] = FT_GET_BYTE();
 
         for ( j = 0; j < runcnt; ++j )
-          points[i++] = ( first += FT_GET_BYTE() );
+          points[i++] = (FT_UShort)( first += FT_GET_BYTE() );
       }
     }
 
     FT_Int     i;
     FT_Int     j;
     FT_Memory  memory = stream->memory;
-    FT_Error   error;
+    FT_Error   error = TT_Err_Ok;
+
+    FT_UNUSED( error );
 
 
     if ( FT_NEW_ARRAY( deltas, delta_cnt ) )
     FT_Memory       memory = stream->memory;
     GX_Blend        blend  = face->blend;
     GX_AVarSegment  segment;
-    FT_Error        error;
+    FT_Error        error = TT_Err_Ok;
     FT_ULong        version;
     FT_Long         axisCount;
     FT_Int          i, j;
     FT_ULong        table_len;
 
+    FT_UNUSED( error );
+
 
     blend->avar_checked = TRUE;
-    if ( ( error = face->goto_table( face, TTAG_avar, stream, &table_len ) ) )
+    if ( (error = face->goto_table( face, TTAG_avar, stream, &table_len )) != 0 )
       return;
+
     if ( FT_FRAME_ENTER( table_len ) )
       return;
 
       FT_FRAME_END
     };
 
-    if ( ( error = face->goto_table( face, TTAG_gvar, stream, &table_len ) ) )
+    if ( (error = face->goto_table( face, TTAG_gvar, stream, &table_len )) != 0 )
       goto Exit;
 
     gvar_start = FT_STREAM_POS( );
     blend->gv_glyphcnt = gvar_head.glyphCount;
     offsetToData       = gvar_start + gvar_head.offsetToData;
 
-    if ( gvar_head.version != 0x00010000L              ||
-         gvar_head.axisCount != blend->mmvar->num_axis )
+    if ( gvar_head.version   != (FT_Long)0x00010000L              ||
+         gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis )
     {
       error = TT_Err_Invalid_Table;
       goto Exit;
         goto Exit;
 
       for ( i = 0; i < blend->tuplecount; ++i )
-        for ( j = 0 ; j < gvar_head.axisCount; ++j )
+        for ( j = 0 ; j < (FT_UInt)gvar_head.axisCount; ++j )
           blend->tuplecoords[i * gvar_head.axisCount + j] =
             FT_GET_SHORT() << 2;                /* convert to FT_Fixed */
 
     if ( face->blend == NULL )
     {
       /* both `fvar' and `gvar' must be present */
-      if ( ( error = face->goto_table( face, TTAG_gvar,
-                                       stream, &table_len ) ) )
+      if ( (error = face->goto_table( face, TTAG_gvar,
+                                      stream, &table_len )) != 0 )
         goto Exit;
-      if ( ( error = face->goto_table( face, TTAG_fvar,
-                                       stream, &table_len ) ) )
+
+      if ( (error = face->goto_table( face, TTAG_fvar,
+                                      stream, &table_len )) != 0 )
         goto Exit;
 
       fvar_start = FT_STREAM_POS( );
       if ( FT_STREAM_READ_FIELDS( fvar_fields, &fvar_head ) )
         goto Exit;
 
-      if ( fvar_head.version != 0x00010000UL                              ||
+      if ( fvar_head.version != (FT_Long)0x00010000L                      ||
            fvar_head.countSizePairs != 2                                  ||
            fvar_head.axisSize != 20                                       ||
            fvar_head.instanceSize != 4 + 4 * fvar_head.axisCount          ||
         a->maximum = axis_rec.maxValue;     /* A Fixed */
         a->strid   = axis_rec.nameID;
 
-        a->name[0] =   a->tag >> 24;
-        a->name[1] = ( a->tag >> 16 ) & 0xFF;
-        a->name[2] = ( a->tag >>  8 ) & 0xFF;
-        a->name[3] = ( a->tag       ) & 0xFF;
+        a->name[0] = (FT_String)(   a->tag >> 24 );
+        a->name[1] = (FT_String)( ( a->tag >> 16 ) & 0xFF );
+        a->name[2] = (FT_String)( ( a->tag >>  8 ) & 0xFF );
+        a->name[3] = (FT_String)( ( a->tag       ) & 0xFF );
         a->name[4] = 0;
 
         ++a;
 
     if ( face->blend == NULL )
     {
-      if ( ( error = TT_Get_MM_Var( face, NULL) ) )
+      if ( (error = TT_Get_MM_Var( face, NULL)) != 0 )
         goto Exit;
     }
 
       }
 
     if ( blend->glyphoffsets == NULL )
-      if ( ( error = ft_var_load_gvar( face ) ) )
+      if ( (error = ft_var_load_gvar( face )) != 0 )
         goto Exit;
 
     if ( blend->normalizedcoords == NULL )
 
     if ( face->blend == NULL )
     {
-      if ( ( error = TT_Get_MM_Var( face, NULL ) ) )
+      if ( (error = TT_Get_MM_Var( face, NULL )) != 0 )
         goto Exit;
     }
 
       av = blend->avar_segment;
       for ( i = 0; i < mmvar->num_axis; ++i, ++av )
       {
-        for ( j = 1; j < av->pairCount; ++j )
+        for ( j = 1; j < (FT_UInt)av->pairCount; ++j )
           if ( normalized[i] < av->correspondence[j].fromCoord )
           {
             normalized[i] =
       }
 
       apply = ft_var_apply_tuple( blend,
-                                  tupleIndex,
+                                  (FT_UShort)tupleIndex,
                                   tuple_coords,
                                   im_start_coords,
                                   im_end_coords );
       {
         /* this means that there are deltas for every entry in cvt */
         for ( j = 0; j < face->cvt_size; ++j )
-          face->cvt[j] += FT_MulFix( deltas[j], apply );
+          face->cvt[j] = (FT_Short)( face->cvt[j] +
+                                     FT_MulFix( deltas[j], apply ) );
       }
 
       else
       {
         for ( j = 0; j < point_count; ++j )
-          face->cvt[localpoints[j]] += FT_MulFix( deltas[j], apply );
+        {
+          int  pindex = localpoints[j];
+          
+          face->cvt[pindex] = (FT_Short)( face->cvt[pindex] +
+                                          FT_MulFix( deltas[j], apply ) );
+        }
       }
 
       if ( localpoints != ALL_POINTS )
     FT_Fixed*   im_end_coords   = NULL;
     FT_UInt     point_count, spoint_count = 0;
     FT_UShort*  sharedpoints = NULL;
-    FT_UShort*  localpoints;
+    FT_UShort*  localpoints  = NULL;
     FT_UShort*  points;
     FT_Short    *deltas_x, *deltas_y;
 
       return TT_Err_Invalid_Argument;
 
     /* to be freed by the caller */
-    if ( ( error = FT_NEW_ARRAY( delta_xy, n_points ) ) )
+    if ( FT_NEW_ARRAY( delta_xy, n_points ) )
       goto Exit;
     *deltas = delta_xy;
 
       }
 
       apply = ft_var_apply_tuple( blend,
-                                  tupleIndex,
+                                  (FT_UShort)tupleIndex,
                                   tuple_coords,
                                   im_start_coords,
                                   im_end_coords );
index 889ebbf..ec8daae 100644 (file)
   /*************************************************************************/
   /*                                                                       */
   /* Before an opcode is executed, the interpreter verifies that there are */
-  /* enough arguments on the stack, with the help of the Pop_Push_Count    */
+  /* enough arguments on the stack, with the help of the `Pop_Push_Count'  */
   /* table.                                                                */
   /*                                                                       */
   /* For each opcode, the first column gives the number of arguments that  */
   /* are popped from the stack; the second one gives the number of those   */
   /* that are pushed in result.                                            */
   /*                                                                       */
-  /* Note that for opcodes with a varying number of parameters, either 0   */
-  /* or 1 arg is verified before execution, depending on the nature of the */
-  /* instruction:                                                          */
-  /*                                                                       */
-  /* - if the number of arguments is given by the bytecode stream or the   */
-  /*   loop variable, 0 is chosen.                                         */
-  /*                                                                       */
-  /* - if the first argument is a count n that is followed by arguments    */
-  /*   a1 .. an, then 1 is chosen.                                         */
+  /* Opcodes which have a varying number of parameters in the data stream  */
+  /* (NPUSHB, NPUSHW) are handled specially; they have a negative value in */
+  /* the `opcode_length' table, and the value in `Pop_Push_Count' is set   */
+  /* to zero.                                                              */
   /*                                                                       */
   /*************************************************************************/
 
     1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
     1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
 
-   -1,-1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
+   -1,-2, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
     1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
     1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
     1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
     W = Vx * Vx + Vy * Vy;
 
     /* Now, we want that Sqrt( W ) = 0x4000 */
-    /* Or 0x1000000 <= W < 0x1004000        */
+    /* Or 0x10000000 <= W < 0x10004000        */
 
     if ( Vx < 0 )
     {
     else
       S2 = FALSE;
 
-    while ( W < 0x1000000L )
+    while ( W < 0x10000000L )
     {
       /* We need to increase W by a minimal amount */
       if ( Vx < Vy )
       W = Vx * Vx + Vy * Vy;
     }
 
-    while ( W >= 0x1004000L )
+    while ( W >= 0x10004000L )
     {
       /* We need to decrease W by a minimal amount */
       if ( Vx < Vy )
       {
         if ( CUR.IP + 1 > CUR.codeSize )
           goto Fail_Overflow;
-        CUR.length = CUR.code[CUR.IP + 1] + 2;
+        CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
       }
 
       if ( CUR.IP + CUR.length <= CUR.codeSize )
   /* Opcode range: 0x88                                                    */
   /* Stack:        uint32 --> uint32                                       */
   /*                                                                       */
-  /* XXX: According to Apple specs, bits 1 & 2 of the argument ought to be */
-  /*      consulted before rotated/stretched info is returned.             */
   static void
   Ins_GETINFO( INS_ARG )
   {
 
     K = 0;
 
-    /* We return then Windows 3.1 version number */
-    /* for the font scaler                       */
+    /* We return MS rasterizer version 1.7 for the font scaler. */
     if ( ( args[0] & 1 ) != 0 )
-      K = 3;
+      K = 35;
 
-    /* Has the glyph been rotated ? */
-    if ( CUR.tt_metrics.rotated )
+    /* Has the glyph been rotated? */
+    if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated )
       K |= 0x80;
 
-    /* Has the glyph been stretched ? */
-    if ( CUR.tt_metrics.stretched )
-      K |= 0x100;
+    /* Has the glyph been stretched? */
+    if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched )
+      K |= 1 << 8;
+
+    /* Are we hinting for grayscale? */
+    if ( ( args[0] & 32 ) != 0 && CUR.grayscale )
+      K |= (1 << 12);
 
     args[0] = K;
   }
         if ( CUR.IP + 1 > CUR.codeSize )
           goto LErrorCodeOverflow_;
 
-        CUR.length = CUR.code[CUR.IP + 1] + 2;
+        CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
       }
 
       if ( CUR.IP + CUR.length > CUR.codeSize )
index eb0bb0b..43f662c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType bytecode interpreter (specification).                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  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,       */
@@ -27,7 +27,7 @@
 FT_BEGIN_HEADER
 
 
-#ifndef TT_CONFIG_OPTION_STATIC_INTEPRETER  /* indirect implementation */
+#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */
 
 #define EXEC_OP_   TT_ExecContext  exc,
 #define EXEC_OP    TT_ExecContext  exc
@@ -219,6 +219,8 @@ FT_BEGIN_HEADER
     FT_ULong           loadSize;
     TT_SubGlyph_Stack  loadStack;      /* loading subglyph stack */
 
+    FT_Bool            grayscale;      /* are we hinting for grayscale? */
+
   } TT_ExecContextRec;
 
 
index 3914ba5..05e673d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Objects manager (body).                                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     if ( error )
       goto Exit;
 
-    /* We must also be able to accept Mac/GX fonts, as well as OT ones */
+    /* We must also be able to accept Mac/GX fonts, as well as OT ones. */
+    /* The 0x00020000 tag is completely undocumented; some fonts from   */
+    /* Arphic made for Chinese Windows 3.1 have this.                   */
     if ( face->format_tag != 0x00010000L &&    /* MS fonts  */
+         face->format_tag != 0x00020000L &&    /* CJK fonts for Win 3.1 */
          face->format_tag != TTAG_true   )     /* Mac fonts */
     {
       FT_TRACE2(( "[not a valid TTF font]\n" ));
       if ( !face->root.internal->incremental_interface )
         error = tt_face_load_loca( face, stream );
       if ( !error )
-        error = tt_face_load_cvt( face, stream ) ||
-                tt_face_load_fpgm( face, stream );
+      {
+        error = tt_face_load_cvt( face, stream );
+        if ( !error )
+          error = tt_face_load_fpgm( face, stream );
+      }
 
 #else
 
       sfnt->done_face( face );
 
     /* freeing the locations table */
-    FT_FREE( face->glyph_locations );
-    face->num_locations = 0;
+    tt_face_done_loca( face );
 
     /* freeing the CVT */
     FT_FREE( face->cvt );
 
     if ( !error )
     {
-      TT_SBit_Strike  strike = face->sbit_strikes + strike_index;
+      /* XXX: TODO: move this code to the SFNT module where it belongs */
 
+#ifdef FT_OPTIMIZE_MEMORY
+      FT_Byte*    strike = face->sbit_table + 8 + strike_index*48;
+
+      sbit_metrics->ascender  = (FT_Char)strike[16] << 6;  /* hori.ascender  */
+      sbit_metrics->descender = (FT_Char)strike[17] << 6;  /* hori.descender */
+
+      /* XXX: Is this correct? */
+      sbit_metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB  */
+                                             strike[18] + /* max_width      */
+                                    (FT_Char)strike[23]   /* min_advance_SB */
+                                                        ) << 6;
+
+#else /* !FT_OPTIMIZE_MEMORY */
+
+      TT_SBit_Strike  strike = face->sbit_strikes + strike_index;
 
-      sbit_metrics->x_ppem = metrics->x_ppem;
-      sbit_metrics->y_ppem = metrics->y_ppem;
-#if 0
-      /*
-       * sbit_metrics->?_scale
-       * are not used now.
-       */
-      sbit_metrics->x_scale = 1 << 16;
-      sbit_metrics->y_scale = 1 << 16;
-#endif
 
       sbit_metrics->ascender  = strike->hori.ascender << 6;
       sbit_metrics->descender = strike->hori.descender << 6;
 
-      /* XXX: Is this correct? */
-      sbit_metrics->height = sbit_metrics->ascender -
-                             sbit_metrics->descender;
-
       /* XXX: Is this correct? */
       sbit_metrics->max_advance = ( strike->hori.min_origin_SB  +
                                     strike->hori.max_width      +
                                     strike->hori.min_advance_SB ) << 6;
 
-      size->strike_index = (FT_UInt)strike_index;
+#endif /* !FT_OPTIMIZE_MEMORY */
+
+      /* XXX: Is this correct? */
+      sbit_metrics->height = sbit_metrics->ascender -
+                             sbit_metrics->descender;
+
+      sbit_metrics->x_ppem = metrics->x_ppem;
+      sbit_metrics->y_ppem = metrics->y_ppem;
+      size->strike_index   = (FT_UInt)strike_index;
     }
     else
     {
index 9cae477..b9c83e1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType glyph data/program tables loader (body).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004 by                                     */
+/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
+#ifdef FT_OPTIMIZE_MEMORY
+
+  FT_LOCAL_DEF( FT_Error )
+  tt_face_load_loca( TT_Face    face,
+                     FT_Stream  stream )
+  {
+    FT_Error  error;
+    FT_ULong  table_len;
+
+
+    /* we need the size of the `glyf' table for malformed `loca' tables */
+    error = face->goto_table( face, TTAG_glyf, stream, &face->glyf_len );
+    if ( error )
+      goto Exit;
+
+    FT_TRACE2(( "Locations " ));
+    error = face->goto_table( face, TTAG_loca, stream, &table_len );
+    if ( error )
+    {
+      error = TT_Err_Locations_Missing;
+      goto Exit;
+    }
+
+    if ( face->header.Index_To_Loc_Format != 0 )
+    {
+      if ( table_len >= 0x40000 )
+      {
+        FT_TRACE2(( "table too large!\n" ));
+        error = TT_Err_Invalid_Table;
+        goto Exit;
+      }
+      face->num_locations = (FT_UInt)( table_len >> 2 );
+    }
+    else
+    {
+      if ( table_len >= 0x20000 )
+      {
+        FT_TRACE2(( "table too large!\n" ));
+        error = TT_Err_Invalid_Table;
+        goto Exit;
+      }
+      face->num_locations = (FT_UInt)( table_len >> 1 );
+    }
+
+    /*
+     * Extract the frame.  We don't need to decompress it since
+     * we are able to parse it directly.
+     */
+    if ( FT_FRAME_EXTRACT( table_len, face->glyph_locations ) )
+      goto Exit;
+
+    FT_TRACE2(( "loaded\n" ));
+
+  Exit:
+    return error;
+  }
+
+
+  FT_LOCAL_DEF( FT_ULong )
+  tt_face_get_location( TT_Face   face,
+                        FT_UInt   gindex,
+                        FT_UInt  *asize )
+  {
+    FT_ULong  pos1, pos2;
+    FT_Byte*  p;
+    FT_Byte*  p_limit;
+
+
+    pos1 = pos2 = 0;
+
+    if ( gindex < face->num_locations )
+    {
+      if ( face->header.Index_To_Loc_Format != 0 )
+      {
+        p       = face->glyph_locations + gindex * 4;
+        p_limit = face->glyph_locations + face->num_locations * 4;
+
+        pos1 = FT_NEXT_ULONG( p );
+        pos2 = pos1;
+
+        if ( p + 4 <= p_limit )
+          pos2 = FT_NEXT_ULONG( p );
+      }
+      else
+      {
+        p       = face->glyph_locations + gindex * 2;
+        p_limit = face->glyph_locations + face->num_locations * 2;
+
+        pos1 = FT_NEXT_USHORT( p );
+        pos2 = pos1;
+
+        if ( p + 2 <= p_limit )
+          pos2 = FT_NEXT_USHORT( p );
+
+        pos1 <<= 1;
+        pos2 <<= 1;
+      }
+    }
+
+    /* It isn't mentioned explicitly that the `loca' table must be  */
+    /* ordered, but implicitly it refers to the length of an entry  */
+    /* as the difference between the current and the next position. */
+    /* Anyway, there do exist (malformed) fonts which don't obey    */
+    /* this rule, so we are only able to provide an upper bound for */
+    /* the size.                                                    */
+    if ( pos2 >= pos1 )
+      *asize = (FT_UInt)( pos2 - pos1 );
+    else
+      *asize = (FT_UInt)( face->glyf_len - pos1 );
+
+    return pos1;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  tt_face_done_loca( TT_Face  face )
+  {
+    FT_Stream  stream = face->root.stream;
+
+
+    FT_FRAME_RELEASE( face->glyph_locations );
+    face->num_locations = 0;
+  }
+
+
+#else /* !FT_OPTIMIZE_MEMORY */
+
+
   FT_LOCAL_DEF( FT_Error )
   tt_face_load_loca( TT_Face    face,
                      FT_Stream  stream )
     FT_ULong   table_len;
 
 
+    /* we need the size of the `glyf' table for malformed `loca' tables */
+    error = face->goto_table( face, TTAG_glyf, stream, &face->glyf_len );
+    if ( error )
+      goto Exit;
+
     FT_TRACE2(( "Locations " ));
     LongOffsets = face->header.Index_To_Loc_Format;
 
 
       if ( FT_FRAME_ENTER( face->num_locations * 2L ) )
         goto Exit;
+
       {
         FT_Long*  loc   = face->glyph_locations;
         FT_Long*  limit = loc + face->num_locations;
         for ( ; loc < limit; loc++ )
           *loc = (FT_Long)( (FT_ULong)FT_GET_USHORT() * 2 );
       }
+
       FT_FRAME_EXIT();
     }
 
   }
 
 
+  FT_LOCAL_DEF( FT_ULong )
+  tt_face_get_location( TT_Face   face,
+                        FT_UInt   gindex,
+                        FT_UInt  *asize )
+  {
+    FT_ULong  offset;
+    FT_UInt   count;
+
+
+    offset = face->glyph_locations[gindex];
+    count  = 0;
+
+    if ( gindex < (FT_UInt)face->num_locations - 1 )
+    {
+      FT_ULong  offset1 = face->glyph_locations[gindex + 1];
+
+
+      /* It isn't mentioned explicitly that the `loca' table must be  */
+      /* ordered, but implicitly it refers to the length of an entry  */
+      /* as the difference between the current and the next position. */
+      /* Anyway, there do exist (malformed) fonts which don't obey    */
+      /* this rule, so we are only able to provide an upper bound for */
+      /* the size.                                                    */
+      if ( offset1 >= offset )
+        count = (FT_UInt)( offset1 - offset );
+      else
+        count = (FT_UInt)( face->glyf_len - offset );
+    }
+
+    *asize = count;
+    return offset;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  tt_face_done_loca( TT_Face  face )
+  {
+    FT_Memory  memory = face->root.memory;
+
+
+    FT_FREE( face->glyph_locations );
+    face->num_locations = 0;
+  }
+
+
+#endif /* !FT_OPTIMIZE_MEMORY */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   tt_face_load_cvt( TT_Face    face,
                     FT_Stream  stream )
   {
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+
     FT_Error   error;
     FT_Memory  memory = stream->memory;
     FT_ULong   table_len;
 
   Exit:
     return error;
+
+#else /* !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+
+    FT_UNUSED( face   );
+    FT_UNUSED( stream );
+
+    return TT_Err_Ok;
+
+#endif
   }
 
 
   tt_face_load_fpgm( TT_Face    face,
                      FT_Stream  stream )
   {
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+
     FT_Error   error;
     FT_ULong   table_len;
 
 
   Exit:
     return error;
+
+#else /* !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+
+    FT_UNUSED( face   );
+    FT_UNUSED( stream );
+
+    return TT_Err_Ok;
+
+#endif
   }
 
 
index 3f8cd64..2acb4b3 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType glyph data/program tables loader (specification).           */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2005 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -31,6 +31,14 @@ FT_BEGIN_HEADER
   tt_face_load_loca( TT_Face    face,
                      FT_Stream  stream );
 
+  FT_LOCAL( FT_ULong )
+  tt_face_get_location( TT_Face   face,
+                        FT_UInt   gindex,
+                        FT_UInt  *asize );
+
+  FT_LOCAL( void )
+  tt_face_done_loca( TT_Face  face );
+
   FT_LOCAL( FT_Error )
   tt_face_load_cvt( TT_Face    face,
                     FT_Stream  stream );
index 4d966f3..8e366ba 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/type1 Jamfile (c) 2001 David Turner
+# FreeType 2 src/type1 Jamfile
 #
+# Copyright 2001 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) type1 ;
 
index 9945ebd..bef8251 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM support for Type 1 fonts (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  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,       */
@@ -18,6 +18,7 @@
 
 #include <ft2build.h>
 #include "t1afm.h"
+#include "t1errors.h"
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_TYPE1_TYPES_H
 
@@ -33,8 +34,8 @@
 
 
   FT_LOCAL_DEF( void )
-  T1_Done_AFM( FT_Memory  memory,
-               T1_AFM*    afm )
+  T1_Done_Metrics( FT_Memory  memory,
+                   T1_AFM*    afm )
   {
     FT_FREE( afm->kern_pairs );
     afm->num_pairs = 0;
 
 
     /* skip whitespace */
-    while ( ( *p == ' ' || *p == '\t' || *p == ':' || *p == ';' ) &&
-            p < limit                                             )
+    while ( p < limit                                             &&
+            ( *p == ' ' || *p == '\t' || *p == ':' || *p == ';' ) )
       p++;
     *start = p;
 
     /* now, read glyph name */
-    while ( IS_ALPHANUM( *p ) && p < limit )
+    while ( p < limit && IS_ALPHANUM( *p ) )
       p++;
 
     len = p - *start;
 
 
   /* parse an AFM file -- for now, only read the kerning pairs */
-  FT_LOCAL_DEF( FT_Error )
+  static FT_Error
   T1_Read_AFM( FT_Face    t1_face,
                FT_Stream  stream )
   {
-    FT_Error       error;
+    FT_Error       error = T1_Err_Ok;
     FT_Memory      memory = stream->memory;
     FT_Byte*       start;
     FT_Byte*       limit;
     T1_AFM*        afm   = 0;
 
 
-    if ( FT_FRAME_ENTER( stream->size ) )
-      return error;
-
     start = (FT_Byte*)stream->cursor;
     limit = (FT_Byte*)stream->limit;
     p     = start;
     if ( error )
       FT_FREE( afm );
 
+    return error;
+  }
+
+
+#define LITTLE_ENDIAN_USHORT( p )  (FT_UShort)( ( (p)[0]       ) | \
+                                                ( (p)[1] <<  8 ) )
+
+#define LITTLE_ENDIAN_UINT( p )  (FT_UInt)( ( (p)[0]       ) | \
+                                            ( (p)[1] <<  8 ) | \
+                                            ( (p)[2] << 16 ) | \
+                                            ( (p)[3] << 24 ) )
+
+
+  /* parse a PFM file -- for now, only read the kerning pairs */
+  static FT_Error
+  T1_Read_PFM( FT_Face    t1_face,
+               FT_Stream  stream )
+  {
+    FT_Error       error = T1_Err_Ok;
+    FT_Memory      memory = stream->memory;
+    FT_Byte*       start;
+    FT_Byte*       limit;
+    FT_Byte*       p;
+    FT_Int         kern_count = 0;
+    T1_Kern_Pair*  pair;
+    T1_AFM*        afm = 0;
+    FT_Int         width_table_length;
+    FT_CharMap     oldcharmap;
+    FT_CharMap     charmap;
+    FT_Int         n;
+
+
+    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;
+      goto Exit;
+    }
+    width_table_length = LITTLE_ENDIAN_USHORT( p );
+
+    p += 18 + width_table_length;
+    if ( p + 0x12 > limit || LITTLE_ENDIAN_USHORT( p ) < 0x12 )
+      /* extension table is probably optional */
+      goto Exit;
+
+    /* Kerning offset is 14 bytes from start of extensions table. */
+    p += 14;
+    p = start + LITTLE_ENDIAN_UINT( p );
+    if ( p + 2 > limit )
+    {
+      error = T1_Err_Unknown_File_Format;
+      goto Exit;
+    }
+
+    kern_count = LITTLE_ENDIAN_USHORT( p );
+    p += 2;
+    if ( p + 4 * kern_count > limit )
+    {
+      error = T1_Err_Unknown_File_Format;
+      goto Exit;
+    }
+
+    /* Actually, kerning pairs are simply optional! */
+    if ( kern_count == 0 )
+      goto Exit;
+
+    /* allocate the pairs */
+    if ( FT_NEW( afm ) || FT_NEW_ARRAY( afm->kern_pairs, kern_count ) )
+      goto Exit;
+
+    /* save in face object */
+    ((T1_Face)t1_face)->afm_data = afm;
+
+    t1_face->face_flags |= FT_FACE_FLAG_KERNING;
+
+    /* now, read each kern pair */
+    pair           = afm->kern_pairs;
+    afm->num_pairs = kern_count;
+    limit          = p + 4 * kern_count;
+
+    /* PFM kerning data are stored by encoding rather than glyph index, */
+    /* so find the PostScript charmap of this font and install it       */
+    /* temporarily.  If we find no PostScript charmap, then just use    */
+    /* the default and hope it is the right one.                        */
+    oldcharmap = t1_face->charmap;
+    charmap    = NULL;
+
+    for ( n = 0; n < t1_face->num_charmaps; n++ )
+    {
+      charmap = t1_face->charmaps[n];
+      /* check against PostScript pseudo platform */
+      if ( charmap->platform_id == 7 )
+      {
+        error = FT_Set_Charmap( t1_face, charmap );
+        if ( error )
+          goto Exit;
+        break;
+      }
+    }
+
+    /* Kerning info is stored as:             */
+    /*                                        */
+    /*   encoding of first glyph (1 byte)     */
+    /*   encoding of second glyph (1 byte)    */
+    /*   offset (little-endian short)         */
+    for ( ; p < limit ; p+=4 )
+    {
+      pair->glyph1 = FT_Get_Char_Index( t1_face, p[0] );
+      pair->glyph2 = FT_Get_Char_Index( t1_face, p[1] );
+
+      pair->kerning.x = (FT_Short)LITTLE_ENDIAN_USHORT(p + 2);
+      pair->kerning.y = 0;
+
+      pair++;
+    }
+
+    if ( oldcharmap != NULL )
+      error = FT_Set_Charmap( t1_face, oldcharmap );
+    if ( error )
+      goto Exit;
+
+    /* now, sort the kern pairs according to their glyph indices */
+    ft_qsort( afm->kern_pairs, kern_count, sizeof ( T1_Kern_Pair ),
+              compare_kern_pairs );
+
+  Exit:
+    if ( error )
+      FT_FREE( afm );
+
+    return error;
+  }
+
+
+  /* parse a metrics file -- either AFM or PFM depending on what */
+  /* it turns out to be                                          */
+  FT_LOCAL_DEF( FT_Error )
+  T1_Read_Metrics( FT_Face    t1_face,
+                   FT_Stream  stream )
+  {
+    FT_Error  error;
+    FT_Byte*  start;
+
+
+    if ( FT_FRAME_ENTER( stream->size ) )
+      return error;
+
+    start = (FT_Byte*)stream->cursor;
+
+    if ( stream->size >= ft_strlen( "StartFontMetrics" )    &&
+         ft_strncmp( (const char*)start, "StartFontMetrics",
+                     ft_strlen( "StartFontMetrics" ) ) == 0 )
+      error = T1_Read_AFM( t1_face, stream );
+
+    else if ( stream->size > 6                                &&
+              start[0] == 0x00 && start[1] == 0x01            &&
+              LITTLE_ENDIAN_UINT( start + 2 ) == stream->size )
+      error = T1_Read_PFM( t1_face, stream );
+
+    else
+      error = T1_Err_Unknown_File_Format;
+
     FT_FRAME_EXIT();
 
     return error;
index 77cc6a6..5aaeb67 100644 (file)
@@ -44,12 +44,12 @@ FT_BEGIN_HEADER
 
 
   FT_LOCAL( FT_Error )
-  T1_Read_AFM( FT_Face    face,
-               FT_Stream  stream );
+  T1_Read_Metrics( FT_Face    face,
+                   FT_Stream  stream );
 
   FT_LOCAL( void )
-  T1_Done_AFM( FT_Memory  memory,
-               T1_AFM*    afm );
+  T1_Done_Metrics( FT_Memory  memory,
+                   T1_AFM*    afm );
 
   FT_LOCAL( void )
   T1_Get_Kerning( T1_AFM*     afm,
index b37ae77..dbcdb2a 100644 (file)
   }
 
 
+  static FT_Error
+  t1_ps_get_font_private( FT_Face         face,
+                          PS_PrivateRec*  afont_private )
+  {
+    *afont_private = ((T1_Face)face)->type1.private_dict;
+    return 0;
+  }
+
+
   static const FT_Service_PsInfoRec  t1_service_ps_info =
   {
-    (PS_GetFontInfoFunc)  t1_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)t1_ps_has_glyph_names
+    (PS_GetFontInfoFunc)   t1_ps_get_font_info,
+    (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names,
+    (PS_GetFontPrivateFunc)t1_ps_get_font_private,
   };
 
 
     (FT_Face_AttachFunc)      0,
 #else
     (FT_Face_GetKerningFunc)  Get_Kerning,
-    (FT_Face_AttachFunc)      T1_Read_AFM,
+    (FT_Face_AttachFunc)      T1_Read_Metrics,
 #endif
     (FT_Face_GetAdvancesFunc) 0
   };
index 7ec163a..2080a76 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 font loader (body).                                           */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
       *base = parser->root.cursor + 1;
 
       parser->root.cursor += *size + 1;
-      return 1;
+      return !parser->root.error;
     }
 
     FT_ERROR(( "read_binary_data: invalid size field\n" ));
 
             parser->root.cursor = cur;
             T1_Skip_PS_Token( parser );
+            if ( parser->root.error )
+              return;
 
             len = parser->root.cursor - cur;
 
 
     /* position the parser right before the `dup' of the first subr */
     T1_Skip_PS_Token( parser );         /* `array' */
-    T1_Skip_Spaces  ( parser );
+    if ( parser->root.error )
+      return;
+    T1_Skip_Spaces( parser );
 
     /* initialize subrs array -- with synthetic fonts it is possible */
     /* we get here twice                                             */
       /* `noaccess' & `put'.  We position the parser right     */
       /* before the next `dup', if any.                        */
       T1_Skip_PS_Token( parser );   /* `NP' or `|' or `noaccess' */
+      if ( parser->root.error )
+        return;
       T1_Skip_Spaces  ( parser );
 
       if ( ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 )
         if ( cur[0] == 'd' &&
              cur[1] == 'e' &&
              cur[2] == 'f' )
-          break;
+        {
+          /* There are fonts which have this: */
+          /*                                  */
+          /*   /CharStrings 118 dict def      */
+          /*   Private begin                  */
+          /*   CharStrings begin              */
+          /*   ...                            */
+          /*                                  */
+          /* To catch this we ignore `def' if */
+          /* no charstring has actually been  */
+          /* seen.                            */
+          if ( n )
+            break;
+        }
 
         if ( cur[0] == 'e' &&
              cur[1] == 'n' &&
       }
 
       T1_Skip_PS_Token( parser );
+      if ( parser->root.error )
+        return;
 
       if ( *cur == '/' )
       {
             break;
 
           T1_Skip_PS_Token( parser );
-          T1_Skip_Spaces  ( parser );
+          if ( parser->root.error )
+            goto Exit;
+          T1_Skip_Spaces( parser );
           cur = parser->root.cursor;
         }
 
       {
         start_binary = cur;
         T1_Skip_PS_Token( parser );
+        if ( parser->root.error )
+          goto Exit;
         have_integer = 1;
       }
 
 
         parser->root.cursor = cur;
         T1_Skip_PS_Token( parser );
+        if ( parser->root.error )
+          goto Exit;
 
         len = parser->root.cursor - cur;
 
             if ( !name )
               break;
 
-            if ( cur[0] == name[0]                      &&
-                 len == ft_strlen( (const char *)name ) &&
-                 ft_memcmp( cur, name, len ) == 0       )
+            if ( cur[0] == name[0]                                  &&
+                 len == (FT_PtrDist)ft_strlen( (const char *)name ) &&
+                 ft_memcmp( cur, name, len ) == 0                   )
             {
               /* We found it -- run the parsing callback! */
               /* We only record the first instance of any */
index a832ee0..519fa08 100644 (file)
 #ifndef T1_CONFIG_OPTION_NO_AFM
       /* release afm data if present */
       if ( face->afm_data )
-        T1_Done_AFM( memory, (T1_AFM*)face->afm_data );
+        T1_Done_Metrics( memory, (T1_AFM*)face->afm_data );
 #endif
 
       /* release unicode map, if any */
index 544aa09..db1a613 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 parser (body).                                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   }
 
 
+  static FT_Error
+  check_type1_format( FT_Stream    stream,
+                      const char*  header_string,
+                      size_t       header_length )
+  {
+    FT_Error   error;
+    FT_UShort  tag;
+    FT_Long    size;
+
+
+    if ( FT_STREAM_SEEK( 0 ) )
+      goto Exit;
+      
+    error = read_pfb_tag( stream, &tag, &size );
+    if ( error )
+      goto Exit;
+      
+    if ( tag != 0x8001U && FT_STREAM_SEEK( 0 ) )
+      goto Exit;
+      
+    if ( !FT_FRAME_ENTER( header_length ) )
+    {
+      error = 0;
+      
+      if ( ft_memcmp( stream->cursor, header_string, header_length ) != 0 )
+        error = T1_Err_Unknown_File_Format;
+
+      FT_FRAME_EXIT();
+    }
+
+  Exit:
+    return error;
+  }
+
+
   FT_LOCAL_DEF( FT_Error )
   T1_New_Parser( T1_Parser      parser,
                  FT_Stream      stream,
     parser->in_memory    = 0;
     parser->single_block = 0;
 
+    /* check the header format */
+    error = check_type1_format( stream, "%!PS-AdobeFont", 14 );
+    if ( error )
+    {
+      if ( error != T1_Err_Unknown_File_Format )
+        goto Exit;
+
+      error = check_type1_format( stream, "%!FontType", 10 );
+      if ( error )
+      {
+        FT_TRACE2(( "[not a Type1 font]\n" ));
+        goto Exit;
+      }
+    }
+
     /******************************************************************/
     /*                                                                */
     /* Here a short summary of what is going on:                      */
     }
     else
     {
-      /* read segment in memory */
-      if ( FT_ALLOC( parser->base_dict, size )     ||
+      /* read segment in memory - this is clumsy, but so does the format */
+      if ( FT_ALLOC( parser->base_dict, size )       ||
            FT_STREAM_READ( parser->base_dict, size ) )
         goto Exit;
       parser->base_len = size;
     }
 
-    /* Now check font format; we must see `%!PS-AdobeFont-1' */
-    /* or `%!FontType'                                       */
-    {
-      if ( size <= 16                                       ||
-           ( ft_strncmp( (const char*)parser->base_dict,
-                         "%!PS-AdobeFont-1", 16 )        &&
-             ft_strncmp( (const char*)parser->base_dict,
-                         "%!FontType", 10 )              )  )
-      {
-        FT_TRACE2(( "[not a Type1 font]\n" ));
-        error = T1_Err_Unknown_File_Format;
-      }
-      else
-      {
-        parser->root.base   = parser->base_dict;
-        parser->root.cursor = parser->base_dict;
-        parser->root.limit  = parser->root.cursor + parser->base_len;
-      }
-    }
+    parser->root.base   = parser->base_dict;
+    parser->root.cursor = parser->base_dict;
+    parser->root.limit  = parser->root.cursor + parser->base_len;
 
   Exit:
     if ( error && !parser->in_memory )
           goto Found;
 
         T1_Skip_PS_Token( parser );
+        if ( parser->root.error )
+          break;
         T1_Skip_Spaces  ( parser );
         cur = parser->root.cursor;
       }
index 032ac71..00371d5 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/type42 Jamfile (c) 2002 David Turner
+# FreeType 2 src/type42 Jamfile
 #
+# Copyright 2002 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) type42 ;
 
index 2afe2db..c87c3f2 100644 (file)
                         PS_FontInfoRec*  afont_info )
   {
     *afont_info = ((T42_Face)face)->type1.font_info;
-    return 0;
+    return T42_Err_Ok;
   }
 
 
   }
 
 
+  static FT_Error
+  t42_ps_get_font_private( FT_Face         face,
+                           PS_PrivateRec*  afont_private )
+  {
+    *afont_private = ((T42_Face)face)->type1.private_dict;
+    return T42_Err_Ok;
+  }
+
+
   static const FT_Service_PsInfoRec  t42_service_ps_info =
   {
-    (PS_GetFontInfoFunc)  t42_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)t42_ps_has_glyph_names
+    (PS_GetFontInfoFunc)   t42_ps_get_font_info,
+    (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names,
+    (PS_GetFontPrivateFunc)t42_ps_get_font_private
   };
 
 
index 8837136..d51a91c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 objects manager (body).                                      */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by Roberto Alameda.                         */
+/*  Copyright 2002, 2003, 2004, 2005 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      */
   FT_LOCAL_DEF( void )
   T42_GlyphSlot_Done( T42_GlyphSlot slot )
   {
-    FT_Face       face    = slot->root.face;
-    T42_Face      t42face = (T42_Face)face;
-    FT_GlyphSlot  cur     = t42face->ttf_face->glyph;
-
-
-    while ( cur )
-    {
-      if ( cur == slot->ttslot )
-      {
-        FT_Done_GlyphSlot( slot->ttslot );
-        break;
-      }
-
-      cur = cur->next;
-    }
+    FT_Done_GlyphSlot( slot->ttslot );
   }
 
 
index ff53a3e..80e7547 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 font parser (body).                                          */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by Roberto Alameda.                         */
+/*  Copyright 2002, 2003, 2004, 2005 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      */
     /*   parser->in_memory is set if we have a memory stream.          */
     /*                                                                 */
 
-    if ( FT_STREAM_SEEK( 0L ) )
+    if ( FT_STREAM_SEEK( 0L ) ||
+         FT_FRAME_ENTER( 17 ) )
+      goto Exit;
+
+    if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 )
+    {
+      FT_TRACE2(( "not a Type42 font\n" ));
+      error = T42_Err_Unknown_File_Format;
+    }
+
+    FT_FRAME_EXIT();
+
+    if ( error || FT_STREAM_SEEK( 0 ) )
       goto Exit;
 
     size = stream->size;
       parser->base_len = size;
     }
 
-    /* Now check font format; we must see `%!PS-TrueTypeFont' */
-    if ( size <= 17                                    ||
-         ( ft_strncmp( (const char*)parser->base_dict,
-                       "%!PS-TrueTypeFont", 17 ) )     )
-      error = T42_Err_Unknown_File_Format;
-    else
-    {
-      parser->root.base   = parser->base_dict;
-      parser->root.cursor = parser->base_dict;
-      parser->root.limit  = parser->root.cursor + parser->base_len;
-    }
+    parser->root.base   = parser->base_dict;
+    parser->root.cursor = parser->base_dict;
+    parser->root.limit  = parser->root.cursor + parser->base_len;
 
   Exit:
     if ( error && !parser->in_memory )
 
             parser->root.cursor = cur;
             T1_Skip_PS_Token( parser );
+            if ( parser->root.error )
+              return;
 
             len = parser->root.cursor - cur;
 
             parser->root.error = T1_Add_Table( char_table, charcode,
                                                cur, len + 1 );
-            char_table->elements[charcode][len] = '\0';
             if ( parser->root.error )
               return;
+            char_table->elements[charcode][len] = '\0';
 
             n++;
           }
         string_size = T1_ToInt( parser );
 
         T1_Skip_PS_Token( parser );             /* `RD' */
+        if ( parser->root.error )
+          return;
 
         string_buf = parser->root.cursor + 1;   /* one space after `RD' */
 
 
 
       T1_Skip_PS_Token( parser );
+      if ( parser->root.error )
+        return;
       T1_Skip_Spaces( parser );
       cur = parser->root.cursor;
 
           break;
         }
         T1_Skip_PS_Token( parser );
+        if ( parser->root.error )
+          return;
         T1_Skip_Spaces( parser );
       }
     }
         break;
 
       T1_Skip_PS_Token( parser );
+      if ( parser->root.error )
+        return;
 
       if ( *cur == '/' )
       {
             break;
 
           T1_Skip_PS_Token( parser );
+          if ( parser->root.error )
+            goto Exit;
           T1_Skip_Spaces  ( parser );
           cur = parser->root.cursor;
         }
 
         parser->root.cursor = cur;
         T1_Skip_PS_Token( parser );
+        if ( parser->root.error )
+          goto Exit;
 
         len = parser->root.cursor - cur;
 
             if ( !name )
               continue;
 
-            if ( cur[0] == name[0]                      && 
-                 len == ft_strlen( (const char *)name ) &&
-                 ft_memcmp( cur, name, len ) == 0       )
+            if ( cur[0] == name[0]                                  && 
+                 len == (FT_PtrDist)ft_strlen( (const char *)name ) &&
+                 ft_memcmp( cur, name, len ) == 0                   )
             {
               /* we found it -- run the parsing callback! */
               parser->root.error = t42_load_keyword( face,
         }
       }
       else
+      {
         T1_Skip_PS_Token( parser );
+        if ( parser->root.error )
+          goto Exit;
+      }
 
       T1_Skip_Spaces( parser );
     }
 
+  Exit:
     return parser->root.error;
   }
 
index a903f89..71cf567 100644 (file)
@@ -1,5 +1,13 @@
-# FreeType 2 src/winfonts Jamfile (c) 2001 David Turner
+# FreeType 2 src/winfonts Jamfile
 #
+# Copyright 2001 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) winfonts ;