From 36310414d96ec7a31da019866e586f8266ea6728 Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Thu, 24 Jul 2003 18:52:56 +0000 Subject: [PATCH] upgrading to 2.1.4 git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4058 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../freetype2/autohint/CatharonLicense.txt | 2 +- src/libs/freetype2/autohint/Jamfile | 2 +- src/libs/freetype2/autohint/ahangles.c | 2 +- src/libs/freetype2/autohint/ahangles.h | 2 +- src/libs/freetype2/autohint/aherrors.h | 2 +- src/libs/freetype2/autohint/ahglobal.c | 6 +- src/libs/freetype2/autohint/ahglobal.h | 14 +- src/libs/freetype2/autohint/ahglyph.c | 25 +- src/libs/freetype2/autohint/ahglyph.h | 4 +- src/libs/freetype2/autohint/ahhint.c | 388 +- src/libs/freetype2/autohint/ahhint.h | 2 +- src/libs/freetype2/autohint/ahloader.h | 2 +- src/libs/freetype2/autohint/ahmodule.c | 2 +- src/libs/freetype2/autohint/ahmodule.h | 2 +- src/libs/freetype2/autohint/ahoptim.c | 2 +- src/libs/freetype2/autohint/ahoptim.h | 2 +- src/libs/freetype2/autohint/ahtypes.h | 38 +- src/libs/freetype2/autohint/autohint.c | 2 +- src/libs/freetype2/autohint/descrip.mms | 2 +- src/libs/freetype2/autohint/mather.py | 2 +- src/libs/freetype2/autohint/module.mk | 2 +- src/libs/freetype2/autohint/rules.mk | 2 +- src/libs/freetype2/base/Jamfile | 8 +- src/libs/freetype2/base/descrip.mms | 4 +- src/libs/freetype2/base/ftapi.c | 2 +- src/libs/freetype2/base/ftbase.c | 2 +- src/libs/freetype2/base/ftbbox.c | 2 +- src/libs/freetype2/base/ftbdf.c | 71 +- src/libs/freetype2/base/ftcalc.c | 2 +- src/libs/freetype2/base/ftdbgmem.c | 50 +- src/libs/freetype2/base/ftdebug.c | 2 +- src/libs/freetype2/base/ftgloadr.c | 2 +- src/libs/freetype2/base/ftglyph.c | 4 +- src/libs/freetype2/base/fthash.c | 2 +- src/libs/freetype2/base/ftinit.c | 2 +- src/libs/freetype2/base/ftlist.c | 2 +- src/libs/freetype2/base/ftmac.c | 2 +- src/libs/freetype2/base/ftmm.c | 2 +- src/libs/freetype2/base/ftnames.c | 2 +- src/libs/freetype2/base/ftobject.c | 2 +- src/libs/freetype2/base/ftobjs.c | 249 +- src/libs/freetype2/base/ftoutln.c | 2 +- src/libs/freetype2/base/ftpfr.c | 2 +- src/libs/freetype2/base/ftstream.c | 2 +- src/libs/freetype2/base/ftstroker.c | 223 +- src/libs/freetype2/base/ftsynth.c | 2 +- src/libs/freetype2/base/ftsysio.c | 2 +- src/libs/freetype2/base/ftsysmem.c | 2 +- src/libs/freetype2/base/ftsystem.c | 2 +- src/libs/freetype2/base/fttrigon.c | 4 +- src/libs/freetype2/base/fttype1.c | 2 +- src/libs/freetype2/base/ftutil.c | 2 +- src/libs/freetype2/base/ftwinfnt.c | 55 + src/libs/freetype2/base/ftxf86.c | 2 +- src/libs/freetype2/base/rules.mk | 16 +- src/libs/freetype2/bdf/Jamfile | 2 +- src/libs/freetype2/bdf/README | 2 +- src/libs/freetype2/bdf/bdf.c | 2 +- src/libs/freetype2/bdf/bdf.h | 2 +- src/libs/freetype2/bdf/bdfdrivr.c | 69 +- src/libs/freetype2/bdf/bdfdrivr.h | 2 +- src/libs/freetype2/bdf/bdferror.h | 2 +- src/libs/freetype2/bdf/bdflib.c | 2 +- src/libs/freetype2/bdf/descrip.mms | 2 +- src/libs/freetype2/bdf/module.mk | 2 +- src/libs/freetype2/bdf/rules.mk | 2 +- src/libs/freetype2/cache/Jamfile | 4 +- src/libs/freetype2/cache/descrip.mms | 2 +- src/libs/freetype2/cache/ftcache.c | 2 +- src/libs/freetype2/cache/ftccache.c | 349 +- src/libs/freetype2/cache/ftccache.i | 2 +- src/libs/freetype2/cache/ftccmap.c | 60 +- src/libs/freetype2/cache/ftcerror.h | 2 +- src/libs/freetype2/cache/ftcglyph.c | 2 +- src/libs/freetype2/cache/ftcimage.c | 2 +- src/libs/freetype2/cache/ftcmanag.c | 2 +- src/libs/freetype2/cache/ftcsbits.c | 4 +- src/libs/freetype2/cache/ftlru.c | 158 +- src/libs/freetype2/cache/rules.mk | 2 +- src/libs/freetype2/cff/Jamfile | 2 +- src/libs/freetype2/cff/cff.c | 2 +- src/libs/freetype2/cff/cffcmap.c | 2 +- src/libs/freetype2/cff/cffcmap.h | 2 +- src/libs/freetype2/cff/cffdrivr.c | 2 +- src/libs/freetype2/cff/cffdrivr.h | 2 +- src/libs/freetype2/cff/cfferrs.h | 2 +- src/libs/freetype2/cff/cffgload.c | 25 +- src/libs/freetype2/cff/cffgload.h | 2 +- src/libs/freetype2/cff/cffload.c | 58 +- src/libs/freetype2/cff/cffload.h | 2 +- src/libs/freetype2/cff/cffobjs.c | 2 +- src/libs/freetype2/cff/cffobjs.h | 2 +- src/libs/freetype2/cff/cffparse.c | 2 +- src/libs/freetype2/cff/cffparse.h | 2 +- src/libs/freetype2/cff/cfftoken.h | 2 +- src/libs/freetype2/cff/descrip.mms | 2 +- src/libs/freetype2/cff/module.mk | 2 +- src/libs/freetype2/cff/rules.mk | 2 +- src/libs/freetype2/cid/Jamfile | 2 +- src/libs/freetype2/cid/ciderrs.h | 2 +- src/libs/freetype2/cid/cidgload.c | 24 +- src/libs/freetype2/cid/cidgload.h | 2 +- src/libs/freetype2/cid/cidload.c | 2 +- src/libs/freetype2/cid/cidload.h | 2 +- src/libs/freetype2/cid/cidobjs.c | 2 +- src/libs/freetype2/cid/cidobjs.h | 2 +- src/libs/freetype2/cid/cidparse.c | 2 +- src/libs/freetype2/cid/cidparse.h | 2 +- src/libs/freetype2/cid/cidriver.c | 2 +- src/libs/freetype2/cid/cidriver.h | 2 +- src/libs/freetype2/cid/cidtoken.h | 2 +- src/libs/freetype2/cid/descrip.mms | 2 +- src/libs/freetype2/cid/module.mk | 2 +- src/libs/freetype2/cid/rules.mk | 2 +- src/libs/freetype2/cid/type1cid.c | 2 +- src/libs/freetype2/gzip/Jamfile | 2 +- src/libs/freetype2/gzip/adler32.c | 12 +- src/libs/freetype2/gzip/descrip.mms | 2 +- src/libs/freetype2/gzip/ftgzip.c | 19 +- src/libs/freetype2/gzip/infblock.c | 35 +- src/libs/freetype2/gzip/infblock.h | 2 +- src/libs/freetype2/gzip/infcodes.c | 26 +- src/libs/freetype2/gzip/infcodes.h | 2 +- src/libs/freetype2/gzip/inffixed.h | 2 +- src/libs/freetype2/gzip/inflate.c | 26 +- src/libs/freetype2/gzip/inftrees.c | 75 +- src/libs/freetype2/gzip/inftrees.h | 2 +- src/libs/freetype2/gzip/infutil.c | 10 +- src/libs/freetype2/gzip/infutil.h | 2 +- src/libs/freetype2/gzip/rules.mk | 18 +- src/libs/freetype2/gzip/zconf.h | 31 +- src/libs/freetype2/gzip/zlib.h | 20 +- src/libs/freetype2/gzip/zutil.c | 4 +- src/libs/freetype2/gzip/zutil.h | 6 +- src/libs/freetype2/otlayout/otlayout.h | 2 +- src/libs/freetype2/otlayout/otlbase.h | 2 +- src/libs/freetype2/otlayout/otlcommn.c | 2 +- src/libs/freetype2/otlayout/otlcommn.h | 2 +- src/libs/freetype2/otlayout/otlconf.h | 2 +- src/libs/freetype2/otlayout/otlgdef.c | 2 +- src/libs/freetype2/otlayout/otlgdef.h | 2 +- src/libs/freetype2/otlayout/otlgpos.h | 2 +- src/libs/freetype2/otlayout/otlgsub.c | 2 +- src/libs/freetype2/otlayout/otlgsub.h | 2 +- src/libs/freetype2/otlayout/otlparse.c | 2 +- src/libs/freetype2/otlayout/otlparse.h | 2 +- src/libs/freetype2/otlayout/otltable.h | 2 +- src/libs/freetype2/otlayout/otltags.h | 8 +- src/libs/freetype2/otlayout/otlutils.h | 2 +- src/libs/freetype2/pcf/Jamfile | 2 +- src/libs/freetype2/pcf/descrip.mms | 2 +- src/libs/freetype2/pcf/module.mk | 2 +- src/libs/freetype2/pcf/pcf.c | 2 +- src/libs/freetype2/pcf/pcf.h | 3 +- src/libs/freetype2/pcf/pcfdriver.c | 54 +- src/libs/freetype2/pcf/pcfdriver.h | 2 +- src/libs/freetype2/pcf/pcferror.h | 2 +- src/libs/freetype2/pcf/pcfread.c | 5 +- src/libs/freetype2/pcf/pcfutil.c | 2 +- src/libs/freetype2/pcf/pcfutil.h | 2 +- src/libs/freetype2/pcf/readme | 2 +- src/libs/freetype2/pcf/rules.mk | 2 +- src/libs/freetype2/pfr/descrip.mms | 2 +- src/libs/freetype2/pfr/module.mk | 2 +- src/libs/freetype2/pfr/pfr.c | 2 +- src/libs/freetype2/pfr/pfrcmap.c | 2 +- src/libs/freetype2/pfr/pfrcmap.h | 2 +- src/libs/freetype2/pfr/pfrdrivr.c | 2 +- src/libs/freetype2/pfr/pfrdrivr.h | 2 +- src/libs/freetype2/pfr/pfrerror.h | 2 +- src/libs/freetype2/pfr/pfrgload.c | 2 +- src/libs/freetype2/pfr/pfrgload.h | 2 +- src/libs/freetype2/pfr/pfrload.c | 134 +- src/libs/freetype2/pfr/pfrload.h | 2 +- src/libs/freetype2/pfr/pfrobjs.c | 50 +- src/libs/freetype2/pfr/pfrobjs.h | 2 +- src/libs/freetype2/pfr/pfrsbit.c | 25 +- src/libs/freetype2/pfr/pfrsbit.h | 2 +- src/libs/freetype2/pfr/pfrtypes.h | 8 +- src/libs/freetype2/pfr/rules.mk | 2 +- src/libs/freetype2/psaux/descrip.mms | 2 +- src/libs/freetype2/psaux/module.mk | 2 +- src/libs/freetype2/psaux/psaux.c | 2 +- src/libs/freetype2/psaux/psauxerr.h | 2 +- src/libs/freetype2/psaux/psauxmod.c | 2 +- src/libs/freetype2/psaux/psauxmod.h | 2 +- src/libs/freetype2/psaux/psobjs.c | 5 +- src/libs/freetype2/psaux/psobjs.h | 2 +- src/libs/freetype2/psaux/rules.mk | 2 +- src/libs/freetype2/psaux/t1cmap.c | 2 +- src/libs/freetype2/psaux/t1cmap.h | 2 +- src/libs/freetype2/psaux/t1decode.c | 2 +- src/libs/freetype2/psaux/t1decode.h | 2 +- src/libs/freetype2/pshinter/descrip.mms | 2 +- src/libs/freetype2/pshinter/module.mk | 2 +- src/libs/freetype2/pshinter/pshalgo.h | 2 +- src/libs/freetype2/pshinter/pshalgo1.c | 2 +- src/libs/freetype2/pshinter/pshalgo1.h | 2 +- src/libs/freetype2/pshinter/pshalgo2.c | 2 +- src/libs/freetype2/pshinter/pshalgo2.h | 2 +- src/libs/freetype2/pshinter/pshalgo3.c | 225 +- src/libs/freetype2/pshinter/pshalgo3.h | 3 +- src/libs/freetype2/pshinter/pshglob.c | 2 +- src/libs/freetype2/pshinter/pshglob.h | 2 +- src/libs/freetype2/pshinter/pshinter.c | 2 +- src/libs/freetype2/pshinter/pshmod.c | 2 +- src/libs/freetype2/pshinter/pshmod.h | 2 +- src/libs/freetype2/pshinter/pshrec.c | 2 +- src/libs/freetype2/pshinter/pshrec.h | 2 +- src/libs/freetype2/pshinter/rules.mk | 2 +- src/libs/freetype2/psnames/descrip.mms | 2 +- src/libs/freetype2/psnames/module.mk | 2 +- src/libs/freetype2/psnames/psmodule.c | 2 +- src/libs/freetype2/psnames/psmodule.h | 2 +- src/libs/freetype2/psnames/psnamerr.h | 2 +- src/libs/freetype2/psnames/psnames.c | 2 +- src/libs/freetype2/psnames/pstables.h | 2 +- src/libs/freetype2/psnames/rules.mk | 2 +- src/libs/freetype2/raster/descrip.mms | 2 +- src/libs/freetype2/raster/ftraster.c | 2 +- src/libs/freetype2/raster/ftraster.h | 2 +- src/libs/freetype2/raster/ftrend1.c | 2 +- src/libs/freetype2/raster/ftrend1.h | 2 +- src/libs/freetype2/raster/module.mk | 2 +- src/libs/freetype2/raster/raster.c | 2 +- src/libs/freetype2/raster/rasterrs.h | 2 +- src/libs/freetype2/raster/rules.mk | 2 +- src/libs/freetype2/sfnt/descrip.mms | 2 +- src/libs/freetype2/sfnt/module.mk | 2 +- src/libs/freetype2/sfnt/rules.mk | 2 +- src/libs/freetype2/sfnt/sfdriver.c | 5 +- src/libs/freetype2/sfnt/sfdriver.h | 2 +- src/libs/freetype2/sfnt/sferrors.h | 2 +- src/libs/freetype2/sfnt/sfnt.c | 2 +- src/libs/freetype2/sfnt/sfobjs.c | 2 +- src/libs/freetype2/sfnt/sfobjs.h | 2 +- src/libs/freetype2/sfnt/ttcmap.c | 2 +- src/libs/freetype2/sfnt/ttcmap.h | 2 +- src/libs/freetype2/sfnt/ttcmap0.c | 2 +- src/libs/freetype2/sfnt/ttcmap0.h | 2 +- src/libs/freetype2/sfnt/ttload.c | 27 +- src/libs/freetype2/sfnt/ttload.h | 2 +- src/libs/freetype2/sfnt/ttpost.c | 2 +- src/libs/freetype2/sfnt/ttpost.h | 2 +- src/libs/freetype2/sfnt/ttsbit.c | 41 +- src/libs/freetype2/sfnt/ttsbit.h | 2 +- src/libs/freetype2/smooth/descrip.mms | 2 +- src/libs/freetype2/smooth/ftgrays.c | 10 +- src/libs/freetype2/smooth/ftgrays.h | 2 +- src/libs/freetype2/smooth/ftsmerrs.h | 2 +- src/libs/freetype2/smooth/ftsmooth.c | 2 +- src/libs/freetype2/smooth/ftsmooth.h | 2 +- src/libs/freetype2/smooth/module.mk | 2 +- src/libs/freetype2/smooth/rules.mk | 2 +- src/libs/freetype2/smooth/smooth.c | 2 +- src/libs/freetype2/tools/docmaker/content.py | 1092 +++--- src/libs/freetype2/tools/docmaker/docmaker.py | 298 +- .../freetype2/tools/docmaker/formatter.py | 388 +- src/libs/freetype2/tools/docmaker/sources.py | 710 ++-- src/libs/freetype2/tools/docmaker/tohtml.py | 950 ++--- src/libs/freetype2/tools/docmaker/utils.py | 174 +- src/libs/freetype2/tools/glnames.py | 3444 ++++++++--------- src/libs/freetype2/tools/test_bbox.c | 320 +- src/libs/freetype2/tools/test_trig.c | 472 +-- src/libs/freetype2/truetype/descrip.mms | 2 +- src/libs/freetype2/truetype/module.mk | 2 +- src/libs/freetype2/truetype/rules.mk | 2 +- src/libs/freetype2/truetype/truetype.c | 2 +- src/libs/freetype2/truetype/ttdriver.c | 44 +- src/libs/freetype2/truetype/ttdriver.h | 2 +- src/libs/freetype2/truetype/tterrors.h | 2 +- src/libs/freetype2/truetype/ttgload.c | 123 +- src/libs/freetype2/truetype/ttgload.h | 2 +- src/libs/freetype2/truetype/ttinterp.c | 4 +- src/libs/freetype2/truetype/ttinterp.h | 2 +- src/libs/freetype2/truetype/ttobjs.c | 34 +- src/libs/freetype2/truetype/ttobjs.h | 3 +- src/libs/freetype2/truetype/ttpload.c | 2 +- src/libs/freetype2/truetype/ttpload.h | 2 +- src/libs/freetype2/type1/descrip.mms | 2 +- src/libs/freetype2/type1/module.mk | 2 +- src/libs/freetype2/type1/rules.mk | 2 +- src/libs/freetype2/type1/t1afm.c | 2 +- src/libs/freetype2/type1/t1afm.h | 2 +- src/libs/freetype2/type1/t1driver.c | 2 +- src/libs/freetype2/type1/t1driver.h | 2 +- src/libs/freetype2/type1/t1errors.h | 2 +- src/libs/freetype2/type1/t1gload.c | 26 +- src/libs/freetype2/type1/t1gload.h | 2 +- src/libs/freetype2/type1/t1load.c | 50 +- src/libs/freetype2/type1/t1load.h | 2 +- src/libs/freetype2/type1/t1objs.c | 2 +- src/libs/freetype2/type1/t1objs.h | 2 +- src/libs/freetype2/type1/t1parse.c | 2 +- src/libs/freetype2/type1/t1parse.h | 2 +- src/libs/freetype2/type1/t1tokens.h | 2 +- src/libs/freetype2/type1/type1.c | 2 +- src/libs/freetype2/type42/descrip.mms | 2 +- src/libs/freetype2/type42/module.mk | 2 +- src/libs/freetype2/type42/rules.mk | 2 +- src/libs/freetype2/type42/t42drivr.c | 2 +- src/libs/freetype2/type42/t42drivr.h | 2 +- src/libs/freetype2/type42/t42error.h | 2 +- src/libs/freetype2/type42/t42objs.c | 15 +- src/libs/freetype2/type42/t42objs.h | 2 +- src/libs/freetype2/type42/t42parse.c | 2 +- src/libs/freetype2/type42/t42parse.h | 2 +- src/libs/freetype2/type42/type42.c | 2 +- src/libs/freetype2/winfonts/descrip.mms | 2 +- src/libs/freetype2/winfonts/fnterrs.h | 2 +- src/libs/freetype2/winfonts/module.mk | 2 +- src/libs/freetype2/winfonts/rules.mk | 2 +- src/libs/freetype2/winfonts/winfnt.c | 46 +- src/libs/freetype2/winfonts/winfnt.h | 2 +- 314 files changed, 6457 insertions(+), 5019 deletions(-) create mode 100644 src/libs/freetype2/base/ftwinfnt.c diff --git a/src/libs/freetype2/autohint/CatharonLicense.txt b/src/libs/freetype2/autohint/CatharonLicense.txt index 789c8c9fec..d0d38ccf42 100644 --- a/src/libs/freetype2/autohint/CatharonLicense.txt +++ b/src/libs/freetype2/autohint/CatharonLicense.txt @@ -120,4 +120,4 @@ Legal Terms Packages, you indicate that you understand and accept all the terms of this license. ---- end of license.txt --- +--- end of license.txt --- diff --git a/src/libs/freetype2/autohint/Jamfile b/src/libs/freetype2/autohint/Jamfile index b23f7eb7fa..1ba9cc0287 100644 --- a/src/libs/freetype2/autohint/Jamfile +++ b/src/libs/freetype2/autohint/Jamfile @@ -20,4 +20,4 @@ UseFreeTypeHeaders ; FT2_Library $(FT2_LIB) : $(_sources).c ; } -# end of src/autohint Jamfile +# end of src/autohint Jamfile diff --git a/src/libs/freetype2/autohint/ahangles.c b/src/libs/freetype2/autohint/ahangles.c index ef5a88ee66..647334108a 100644 --- a/src/libs/freetype2/autohint/ahangles.c +++ b/src/libs/freetype2/autohint/ahangles.c @@ -144,4 +144,4 @@ return delta; } -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahangles.h b/src/libs/freetype2/autohint/ahangles.h index f46bfaad78..0105e393f2 100644 --- a/src/libs/freetype2/autohint/ahangles.h +++ b/src/libs/freetype2/autohint/ahangles.h @@ -61,4 +61,4 @@ FT_END_HEADER #endif /* __AHANGLES_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/aherrors.h b/src/libs/freetype2/autohint/aherrors.h index bce6107d39..c3951dc2fc 100644 --- a/src/libs/freetype2/autohint/aherrors.h +++ b/src/libs/freetype2/autohint/aherrors.h @@ -37,4 +37,4 @@ #endif /* __AHERRORS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahglobal.c b/src/libs/freetype2/autohint/ahglobal.c index 1da1abcf29..0184d37d24 100644 --- a/src/libs/freetype2/autohint/ahglobal.c +++ b/src/libs/freetype2/autohint/ahglobal.c @@ -32,7 +32,9 @@ { "THEZOCQS", "HEZLOCUS", +#ifdef FT_CONFIG_CHESTER_SMALL_F "fijkdbh", +#endif "xzroesc", "xzroesc", "pqgjy" @@ -321,7 +323,7 @@ if ( error ) goto Exit; - error = ah_outline_load( hinter->glyph, hinter->face ); + error = ah_outline_load( hinter->glyph, 0x10000L, 0x10000L, hinter->face ); if ( error ) goto Exit; @@ -393,4 +395,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahglobal.h b/src/libs/freetype2/autohint/ahglobal.h index b9ac8fc79c..9de961e7c0 100644 --- a/src/libs/freetype2/autohint/ahglobal.h +++ b/src/libs/freetype2/autohint/ahglobal.h @@ -32,9 +32,15 @@ FT_BEGIN_HEADER -#define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \ - (b) == AH_BLUE_SMALL_TOP || \ - (b) == AH_BLUE_SMALL_F_TOP ) +#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 /* !CHESTER_SMALL_F */ + +# define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || (b) == AH_BLUE_SMALL_TOP ) + +#endif /* !CHESTER_SMALL_F */ /* compute global metrics automatically */ @@ -47,4 +53,4 @@ FT_END_HEADER #endif /* __AHGLOBAL_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahglyph.c b/src/libs/freetype2/autohint/ahglyph.c index cf50431f95..68f762bc04 100644 --- a/src/libs/freetype2/autohint/ahglyph.c +++ b/src/libs/freetype2/autohint/ahglyph.c @@ -389,6 +389,8 @@ /* */ 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; @@ -461,8 +463,8 @@ outline->horz_major_dir = AH_DIR_RIGHT; } - outline->x_scale = face->size->metrics.x_scale; - outline->y_scale = face->size->metrics.y_scale; + outline->x_scale = x_scale; + outline->y_scale = y_scale; points = outline->points; if ( outline->num_points == 0 ) @@ -478,8 +480,6 @@ /* compute coordinates */ { FT_Vector* vec = source->points; - FT_Fixed x_scale = outline->x_scale; - FT_Fixed y_scale = outline->y_scale; for ( point = points; point < point_limit; vec++, point++ ) @@ -1350,13 +1350,20 @@ else edge2 = seg2->edge; +#ifdef FT_CONFIG_CHESTER_SERIF if ( is_serif ) { - edge->serif = edge2; + edge->serif = edge2; edge2->flags |= AH_EDGE_SERIF; } else edge->link = edge2; +#else /* !CHESTER_SERIF */ + if ( is_serif ) + edge->serif = edge2; + else + edge->link = edge2; +#endif } seg = seg->edge_next; @@ -1480,8 +1487,14 @@ /* 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++ ) { @@ -1579,4 +1592,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahglyph.h b/src/libs/freetype2/autohint/ahglyph.h index b116ed988d..c0f2abd1b4 100644 --- a/src/libs/freetype2/autohint/ahglyph.h +++ b/src/libs/freetype2/autohint/ahglyph.h @@ -58,6 +58,8 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) ah_outline_load( AH_Outline outline, + FT_Fixed x_scale, + FT_Fixed y_scale, FT_Face face ); FT_LOCAL( void ) @@ -90,4 +92,4 @@ FT_END_HEADER #endif /* __AHGLYPH_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahhint.c b/src/libs/freetype2/autohint/ahhint.c index e0eefd5073..3cd37b0b88 100644 --- a/src/libs/freetype2/autohint/ahhint.c +++ b/src/libs/freetype2/autohint/ahhint.c @@ -28,9 +28,7 @@ #define FACE_GLOBALS( face ) ((AH_Face_Globals)(face)->autohint.data) -#define ABSVAL( x ) ( ( ( x ) < 0 ) ? -( x ) : ( x )) -#define SMOOTH_DEFAULT #define AH_USE_IUP #define OPTIM_STEM_SNAP @@ -90,12 +88,13 @@ /* 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_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; @@ -108,21 +107,26 @@ sign = 1; } - if ( ( vertical && !hinter->do_vert_snapping ) || - ( !vertical && !hinter->do_horz_snapping ) ) + 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 < 96 ) + else if ( ( base_flags & AH_EDGE_ROUND ) ) + { + if ( dist < 80 ) dist = 64; } - else if ( dist < 56 ) dist = 56; @@ -138,7 +142,123 @@ dist = globals->stds[vertical]; if ( dist < 48 ) dist = 48; - goto Done_Width; + + 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 ) & -64; + } + } + 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 ) & -64; + 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 ) & -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; + + else if ( dist < 128 ) + dist = ( dist + 22 ) & -64; + else + /* XXX: round otherwise, prevent color fringes in LCD mode */ + dist = ( dist + 32 ) & -64; + } + } + } + + Done_Width: + if ( sign ) + dist = -dist; + + return dist; + } +#else /* !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 ) @@ -205,9 +325,6 @@ dist = ( dist + 32 ) & -64; } } - - Done_Width: - } if ( sign ) @@ -215,6 +332,7 @@ return dist; } +#endif /* !CHESTER_SERIF */ /* align one stem edge relative to the previous stem edge */ @@ -226,6 +344,7 @@ { 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, @@ -233,6 +352,10 @@ 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 } @@ -246,7 +369,7 @@ FT_Pos sign = 1; FT_UNUSED( hinter ); - + FT_UNUSED( vertical ); dist = serif->opos - base->opos; if ( dist < 0 ) @@ -386,8 +509,9 @@ if ( !anchor ) { +#ifdef FT_CONFIG_CHESTER_STEM FT_Pos org_len, org_center, cur_len; - FT_Pos cur_pos1, delta1, u_off, d_off; + 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, @@ -401,16 +525,21 @@ d_off = 26; } - if ( cur_len < 96 ) { - + if ( cur_len < 96 ) + { org_center = edge->opos + ( org_len >> 1 ); cur_pos1 = ( org_center + 32 ) & -64; - delta1 = ABSVAL( org_center - ( cur_pos1 - u_off ) ) - - ABSVAL( ( org_center - ( cur_pos1 + d_off ) ) ); + error1 = org_center - ( cur_pos1 - u_off ); + if ( error1 < 0 ) + error1 = -error1; - if ( delta1 < 0 ) + error2 = org_center - ( cur_pos1 + d_off ); + if ( error2 < 0 ) + error2 = -error2; + + if ( error1 < error2 ) cur_pos1 -= u_off; else cur_pos1 += d_off; @@ -427,25 +556,40 @@ edge->flags |= AH_EDGE_DONE; ah_align_linked_edge( hinter, edge, edge2, dimension ); +#else /* !CHESTER_STEM */ + edge->pos = ( edge->opos + 32 ) & -64; + anchor = edge; + + edge->flags |= AH_EDGE_DONE; + + ah_align_linked_edge( hinter, edge, edge2, dimension ); +#endif /* !CHESTER_STEM */ } - else { FT_Pos org_pos, org_len, org_center, cur_len; - FT_Pos cur_pos1, cur_pos2, delta1, delta2, u_off, d_off; - + 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 /* !CHESTER_SERIF */ + cur_len = ah_compute_stem_width( hinter, dimension, org_len ); +#endif /* !CHESTER_SERIF */ +#ifdef FT_CONFIG_CHESTER_STEM if ( cur_len < 96 ) { - cur_pos1 = ( org_center + 32 ) & -64; + FT_Pos u_off, d_off; + cur_pos1 = ( org_center + 32 ) & -64; + if (cur_len <= 64 ) u_off = d_off = 32; else @@ -454,24 +598,22 @@ d_off = 26; } - delta1 = ABSVAL( org_center - ( cur_pos1 - u_off ) ) - - ABSVAL( ( org_center - ( cur_pos1 + d_off ) ) ); - + 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; - - edge->flags |= AH_EDGE_DONE; - edge2->flags |= AH_EDGE_DONE; - - if ( edge > edges && edge->pos < edge[-1].pos ) - edge->pos = edge[-1].pos; } - else { @@ -479,7 +621,8 @@ 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_len = ah_compute_stem_width( hinter, dimension, org_len, + edge->flags, edge2->flags ); cur_pos1 = ( org_pos + 32 ) & -64; delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center ); @@ -493,13 +636,30 @@ edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2; edge2->pos = edge->pos + cur_len; - - edge->flags |= AH_EDGE_DONE; - edge2->flags |= AH_EDGE_DONE; - - if ( edge > edges && edge->pos < edge[-1].pos ) - edge->pos = edge[-1].pos; } + +#else /* !CHESTER_STEM */ + + cur_pos1 = ( org_pos + 32 ) & -64; + delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center ); + if ( delta1 < 0 ) + delta1 = -delta1; + + cur_pos2 = ( ( org_pos + org_len + 32 ) & -64 ) - 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 /* !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; } } @@ -1150,71 +1310,12 @@ FT_Face face = hinter->face; FT_GlyphSlot slot = face->glyph; FT_Slot_Internal internal = slot->internal; - FT_Fixed x_scale = face->size->metrics.x_scale; - FT_Fixed y_scale = face->size->metrics.y_scale; + 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; - { - /* Scale the glyph so that, even before grid-fitting, if it has an edge */ - /* which corresponds to AH_BLUE_SMALL_TOP, then that edge is already */ - /* aligned on a pixel boundry. This helps to preserve the original */ - /* shape of the glyph. */ - - AH_Globals globals_scaled = &hinter->globals->scaled; - AH_Globals globals_design = &hinter->globals->design; - - FT_Int opt_height, opt_width; /* optimal h/w to send */ - FT_Int pointSize; - FT_Int reset_dim_x, reset_dim_y; - FT_Fixed reset_x_scale, reset_y_scale; - FT_Pos fitted_blue, active_blue; - - y_scale = face->internal->orig_y_scale; - - globals_scaled = &hinter->globals->scaled; - globals_design = &hinter->globals->design; - - active_blue = FT_MulFix( globals_design->blue_shoots[AH_BLUE_SMALL_TOP], - face->internal->orig_y_scale ); - - fitted_blue = ( active_blue + 32 ) & -64; - - opt_height = ((float)fitted_blue/(float)active_blue) * - (float)face->internal->orig_height; - - reset_dim_x = face->internal->orig_width; - reset_dim_y = face->internal->orig_height; - - reset_x_scale = face->internal->orig_x_scale; - reset_y_scale = face->internal->orig_y_scale; - - pointSize = (int) face->internal->orig_width; - - if(opt_height > face->internal->orig_height) - opt_width = 0.98 * opt_height; - else - opt_width = opt_height; - - error = FT_Set_Char_Size( face, - opt_width, - opt_height, - face->internal->orig_horz_res, - face->internal->orig_vert_res ); - - ah_hinter_scale_globals( hinter, - face->size->metrics.x_scale, - face->size->metrics.y_scale ); - - face->internal->orig_height = reset_dim_y; - face->internal->orig_width = reset_dim_x; - - face->internal->orig_x_scale = reset_x_scale; - face->internal->orig_y_scale = reset_y_scale; - - } - /* load the glyph */ error = FT_Load_Glyph( face, glyph_index, load_flags ); @@ -1290,7 +1391,7 @@ /* now, load the slot image into the auto-outline, and run the */ /* automatic hinting process */ - error = ah_outline_load( outline, face ); /* XXX: change to slot */ + error = ah_outline_load( outline, x_scale, y_scale, face ); if ( error ) goto Exit; @@ -1318,26 +1419,20 @@ AH_Edge edge2 = edge1 + outline->num_vedges - 1; /* rightmost edge */ - /* fit_shift is used to center the glyph in the fitted advance */ - - FT_Pos fit_shift = ( ( hinter->pp2.x + 32 ) & -64 ) - - hinter->pp2.x; old_advance = hinter->pp2.x; old_rsb = old_advance - edge2->opos; old_lsb = edge1->opos; new_lsb = edge1->pos; - if ( hinter->do_horz_hints ) - { - hinter->pp1.x = ( ( new_lsb - old_lsb - fit_shift/2 ) + 32 ) & -64; - hinter->pp2.x = ( ( edge2->pos + old_rsb - fit_shift/2 ) + 32 ) & -64; - } - else - { - hinter->pp1.x -= fit_shift / 2; - hinter->pp2.x -= fit_shift / 2; - } + hinter->pp1.x = ( ( new_lsb - old_lsb ) + 32 ) & -64; + hinter->pp2.x = ( ( edge2->pos + old_rsb ) + 32 ) & -64; + +#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 } /* good, we simply add the glyph to our loader's base */ @@ -1566,6 +1661,36 @@ } +#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 = ( scaled + 32 ) & -64; + + 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 || @@ -1574,15 +1699,9 @@ ah_loader_rewind( hinter->loader ); -#ifdef SMOOTH_DEFAULT - hint_mode = FT_RENDER_MODE_SMOOTH; -#endif - /* reset hinting flags according to load flags and current render target */ - hinter->do_horz_hints = !FT_BOOL( ( load_flags & FT_LOAD_NO_AUTOHINT ) || - hint_mode == FT_RENDER_MODE_SMOOTH ); - - hinter->do_vert_hints = !FT_BOOL( load_flags & FT_LOAD_NO_AUTOHINT ); + 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 */ @@ -1591,15 +1710,16 @@ /* 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 || - hint_mode == FT_RENDER_MODE_SMOOTH ); + 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 ); + #if 1 load_flags = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM ; @@ -1663,4 +1783,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahhint.h b/src/libs/freetype2/autohint/ahhint.h index 2c352d0c99..a0c015dab7 100644 --- a/src/libs/freetype2/autohint/ahhint.h +++ b/src/libs/freetype2/autohint/ahhint.h @@ -72,4 +72,4 @@ FT_END_HEADER #endif /* __AHHINT_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahloader.h b/src/libs/freetype2/autohint/ahloader.h index c8e42ef225..e4cb73c8db 100644 --- a/src/libs/freetype2/autohint/ahloader.h +++ b/src/libs/freetype2/autohint/ahloader.h @@ -58,4 +58,4 @@ FT_END_HEADER #endif /* __AHLOADER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahmodule.c b/src/libs/freetype2/autohint/ahmodule.c index 1819e9ef92..0004fa259d 100644 --- a/src/libs/freetype2/autohint/ahmodule.c +++ b/src/libs/freetype2/autohint/ahmodule.c @@ -134,4 +134,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahmodule.h b/src/libs/freetype2/autohint/ahmodule.h index 43b1dbe983..627763af8c 100644 --- a/src/libs/freetype2/autohint/ahmodule.h +++ b/src/libs/freetype2/autohint/ahmodule.h @@ -39,4 +39,4 @@ FT_END_HEADER #endif /* __AHMODULE_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahoptim.c b/src/libs/freetype2/autohint/ahoptim.c index 8d10f4a4db..323289ba80 100644 --- a/src/libs/freetype2/autohint/ahoptim.c +++ b/src/libs/freetype2/autohint/ahoptim.c @@ -879,4 +879,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahoptim.h b/src/libs/freetype2/autohint/ahoptim.h index d7862ba965..49cd528c58 100644 --- a/src/libs/freetype2/autohint/ahoptim.h +++ b/src/libs/freetype2/autohint/ahoptim.h @@ -134,4 +134,4 @@ FT_END_HEADER #endif /* __AHOPTIM_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/ahtypes.h b/src/libs/freetype2/autohint/ahtypes.h index a42f992995..04d7484ab6 100644 --- a/src/libs/freetype2/autohint/ahtypes.h +++ b/src/libs/freetype2/autohint/ahtypes.h @@ -385,13 +385,26 @@ FT_BEGIN_HEADER } AH_OutlineRec, *AH_Outline; -#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 ) +#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 /* !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 /* !CHESTER_SMALL_F */ typedef FT_Int AH_Blue; @@ -463,12 +476,12 @@ FT_BEGIN_HEADER /* */ typedef struct AH_Face_GlobalsRec_ { - FT_Face face; + FT_Face face; AH_GlobalsRec design; AH_GlobalsRec scaled; - FT_Fixed x_scale; - FT_Fixed y_scale; - FT_Bool control_overshoot; + FT_Fixed x_scale; + FT_Fixed y_scale; + FT_Bool control_overshoot; } AH_Face_GlobalsRec, *AH_Face_Globals; @@ -497,6 +510,7 @@ FT_BEGIN_HEADER 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; @@ -516,4 +530,4 @@ FT_END_HEADER #endif /* __AHTYPES_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/autohint.c b/src/libs/freetype2/autohint/autohint.c index 3783a82d96..44a44797cb 100644 --- a/src/libs/freetype2/autohint/autohint.c +++ b/src/libs/freetype2/autohint/autohint.c @@ -29,4 +29,4 @@ #include "ahmodule.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/autohint/descrip.mms b/src/libs/freetype2/autohint/descrip.mms index 72039cc68c..e528a898b0 100644 --- a/src/libs/freetype2/autohint/descrip.mms +++ b/src/libs/freetype2/autohint/descrip.mms @@ -22,4 +22,4 @@ OBJS=autohint.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/autohint/mather.py b/src/libs/freetype2/autohint/mather.py index 8ad8b55359..abae0a224a 100644 --- a/src/libs/freetype2/autohint/mather.py +++ b/src/libs/freetype2/autohint/mather.py @@ -75,4 +75,4 @@ print_arctan( 8 ) print -# END +# END diff --git a/src/libs/freetype2/autohint/module.mk b/src/libs/freetype2/autohint/module.mk index edc9f4e1af..930dfcbfb0 100644 --- a/src/libs/freetype2/autohint/module.mk +++ b/src/libs/freetype2/autohint/module.mk @@ -22,4 +22,4 @@ add_autohint_module: $(OPEN_DRIVER)autohint_module_class$(CLOSE_DRIVER) $(ECHO_DRIVER)autohint $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/autohint/rules.mk b/src/libs/freetype2/autohint/rules.mk index 6dcaa20d0f..2cbf6c1710 100644 --- a/src/libs/freetype2/autohint/rules.mk +++ b/src/libs/freetype2/autohint/rules.mk @@ -75,4 +75,4 @@ DRV_OBJS_S += $(AUTO_DRV_OBJ_S) DRV_OBJS_M += $(AUTO_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/base/Jamfile b/src/libs/freetype2/base/Jamfile index 5e388e570b..51b300b768 100644 --- a/src/libs/freetype2/base/Jamfile +++ b/src/libs/freetype2/base/Jamfile @@ -23,8 +23,10 @@ UseFreeTypeHeaders ; # Add the optional/replaceable files. # -FT2_Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c ftbdf.c - ftbbox.c ftdebug.c ftxf86.c fttype1.c ftpfr.c ; +FT2_Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c ftbdf.c + ftbbox.c ftdebug.c ftxf86.c fttype1.c ftpfr.c + ftstroker.c ftwinfnt.c + ; # Add Macintosh-specific file to the library when necessary. # @@ -33,4 +35,4 @@ if $(MAC) FT2_Library $(FT2_LIB) : ftmac.c ; } -# end of src/base Jamfile +# end of src/base Jamfile diff --git a/src/libs/freetype2/base/descrip.mms b/src/libs/freetype2/base/descrip.mms index ac304d0aa8..5926830d0f 100644 --- a/src/libs/freetype2/base/descrip.mms +++ b/src/libs/freetype2/base/descrip.mms @@ -15,9 +15,9 @@ CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.builds.vms],[--.include],[--.src.base]) -OBJS=ftbase.obj,ftinit.obj,ftglyph.obj,ftdebug.obj,ftbdf.obj,ftmm.obj,fttype1.obj,ftxf86.obj,ftpfr.obj +OBJS=ftbase.obj,ftinit.obj,ftglyph.obj,ftdebug.obj,ftbdf.obj,ftmm.obj,fttype1.obj,ftxf86.obj,ftpfr.obj,ftstroker.obj,ftwinfnt.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/base/ftapi.c b/src/libs/freetype2/base/ftapi.c index 1ef3005e28..c6a9d522be 100644 --- a/src/libs/freetype2/base/ftapi.c +++ b/src/libs/freetype2/base/ftapi.c @@ -118,4 +118,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftbase.c b/src/libs/freetype2/base/ftbase.c index 4ea846dc8c..4f564fcace 100644 --- a/src/libs/freetype2/base/ftbase.c +++ b/src/libs/freetype2/base/ftbase.c @@ -31,4 +31,4 @@ #include "ftnames.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftbbox.c b/src/libs/freetype2/base/ftbbox.c index dd445d810d..3f15848d1a 100644 --- a/src/libs/freetype2/base/ftbbox.c +++ b/src/libs/freetype2/base/ftbbox.c @@ -650,4 +650,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftbdf.c b/src/libs/freetype2/base/ftbdf.c index 04579554b2..8557ef7343 100644 --- a/src/libs/freetype2/base/ftbdf.c +++ b/src/libs/freetype2/base/ftbdf.c @@ -20,6 +20,22 @@ #include FT_INTERNAL_BDF_TYPES_H #include FT_INTERNAL_OBJECTS_H + static FT_Bool + test_font_type( FT_Face face, const char* name ) + { + if ( face && face->driver ) + { + FT_Module driver = (FT_Module)face->driver; + + if ( driver->clazz && driver->clazz->module_name ) + { + if ( ft_strcmp( driver->clazz->module_name, name ) == 0 ) + return 1; + } + } + return 0; + } + FT_EXPORT_DEF( FT_Error ) FT_Get_BDF_Charset_ID( FT_Face face, @@ -29,35 +45,52 @@ FT_Error error; const char* encoding = NULL; const char* registry = NULL; - + error = FT_Err_Invalid_Argument; - - if ( face != NULL && face->driver != NULL ) + + if ( test_font_type( face, "bdf" ) ) { - FT_Module driver = (FT_Module) face->driver; - + BDF_Public_Face bdf_face = (BDF_Public_Face)face; - if ( driver->clazz && driver->clazz->module_name && - ft_strcmp( driver->clazz->module_name, "bdf" ) == 0 ) - { - BDF_Public_Face bdf_face = (BDF_Public_Face)face; - - encoding = (const char*) bdf_face->charset_encoding; - registry = (const char*) bdf_face->charset_registry; - error = 0; - } + encoding = (const char*) bdf_face->charset_encoding; + registry = (const char*) bdf_face->charset_registry; + error = 0; } - + if ( acharset_encoding ) *acharset_encoding = encoding; - + if ( acharset_registry ) *acharset_registry = registry; - + return error; - } + } -/* END */ + FT_EXPORT( FT_Error ) + FT_Get_BDF_Property( FT_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ) + { + FT_Error error; + + error = FT_Err_Invalid_Argument; + + aproperty->type = BDF_PROPERTY_TYPE_NONE; + + if ( face != NULL && face->driver != NULL ) + { + FT_Driver driver = face->driver; + BDF_GetPropertyFunc func; + + func = (BDF_GetPropertyFunc) driver->root.clazz->get_interface( + FT_MODULE( driver ), "get_bdf_property" ); + if ( func ) + error = func( face, prop_name, aproperty ); + } + return error; + } + +/* END */ diff --git a/src/libs/freetype2/base/ftcalc.c b/src/libs/freetype2/base/ftcalc.c index 6b78bc3e55..b964a7e969 100644 --- a/src/libs/freetype2/base/ftcalc.c +++ b/src/libs/freetype2/base/ftcalc.c @@ -558,4 +558,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftdbgmem.c b/src/libs/freetype2/base/ftdbgmem.c index 125b5b70af..1cf4798252 100644 --- a/src/libs/freetype2/base/ftdbgmem.c +++ b/src/libs/freetype2/base/ftdbgmem.c @@ -62,6 +62,13 @@ FT_ULong alloc_total; FT_ULong alloc_current; FT_ULong alloc_max; + FT_ULong alloc_count; + + FT_Bool bound_total; + FT_ULong alloc_total_max; + + FT_Bool bound_count; + FT_ULong alloc_count_max; const char* file_name; FT_Long line_no; @@ -476,10 +483,22 @@ if ( size <= 0 ) ft_mem_debug_panic( "negative block size allocation (%ld)", size ); + /* return NULL if the maximum number of allocations was reached */ + 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 && + table->alloc_current + (FT_ULong)size > table->alloc_total_max ) + return NULL; + block = (FT_Byte *)ft_mem_table_alloc( table, size ); if ( block ) ft_mem_table_set( table, block, (FT_ULong)size ); + table->alloc_count++; + table->file_name = NULL; table->line_no = 0; @@ -570,15 +589,42 @@ FT_Int result = 0; - if ( getenv( "FT_DEBUG_MEMORY" ) ) + if ( getenv( "FT2_DEBUG_MEMORY" ) ) { table = ft_mem_table_new( memory ); 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 = atol(p); + + if ( total_max > 0 ) + { + table->bound_total = 1; + table->alloc_total_max = (FT_ULong) total_max; + } + } + + p = getenv( "FT2_ALLOC_COUNT_MAX" ); + if ( p != NULL ) + { + FT_Long total_count = atol(p); + + if ( total_count > 0 ) + { + table->bound_count = 1; + table->alloc_count_max = (FT_ULong) total_count; + } + } + result = 1; } } @@ -669,4 +715,4 @@ #endif /* !FT_DEBUG_MEMORY */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftdebug.c b/src/libs/freetype2/base/ftdebug.c index 48a214380f..8bad5d5f8e 100644 --- a/src/libs/freetype2/base/ftdebug.c +++ b/src/libs/freetype2/base/ftdebug.c @@ -194,4 +194,4 @@ #endif /* !FT_DEBUG_LEVEL_TRACE */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftgloadr.c b/src/libs/freetype2/base/ftgloadr.c index 5a2eb51606..ecee77f4a7 100644 --- a/src/libs/freetype2/base/ftgloadr.c +++ b/src/libs/freetype2/base/ftgloadr.c @@ -358,4 +358,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftglyph.c b/src/libs/freetype2/base/ftglyph.c index 9f3d6fd4b0..4615fe0de4 100644 --- a/src/libs/freetype2/base/ftglyph.c +++ b/src/libs/freetype2/base/ftglyph.c @@ -56,7 +56,7 @@ /* documentation is in ftglyph.h */ FT_EXPORT_DEF( void ) - FT_Matrix_Multiply( FT_Matrix* a, + FT_Matrix_Multiply( const FT_Matrix* a, FT_Matrix* b ) { FT_Fixed xx, xy, yx, yy; @@ -681,4 +681,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/fthash.c b/src/libs/freetype2/base/fthash.c index c42b1dcf4b..7108098201 100644 --- a/src/libs/freetype2/base/fthash.c +++ b/src/libs/freetype2/base/fthash.c @@ -243,4 +243,4 @@ } Exit: return error; - } + } diff --git a/src/libs/freetype2/base/ftinit.c b/src/libs/freetype2/base/ftinit.c index 79ba9f0bd2..12b1234dbf 100644 --- a/src/libs/freetype2/base/ftinit.c +++ b/src/libs/freetype2/base/ftinit.c @@ -158,4 +158,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftlist.c b/src/libs/freetype2/base/ftlist.c index 52687b361d..110746528f 100644 --- a/src/libs/freetype2/base/ftlist.c +++ b/src/libs/freetype2/base/ftlist.c @@ -214,4 +214,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftmac.c b/src/libs/freetype2/base/ftmac.c index 2d37d397e0..59fabcd478 100644 --- a/src/libs/freetype2/base/ftmac.c +++ b/src/libs/freetype2/base/ftmac.c @@ -916,4 +916,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftmm.c b/src/libs/freetype2/base/ftmm.c index 229a043165..9bb7065d4b 100644 --- a/src/libs/freetype2/base/ftmm.c +++ b/src/libs/freetype2/base/ftmm.c @@ -123,4 +123,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftnames.c b/src/libs/freetype2/base/ftnames.c index 7fde5c40bf..38098fb2af 100644 --- a/src/libs/freetype2/base/ftnames.c +++ b/src/libs/freetype2/base/ftnames.c @@ -91,4 +91,4 @@ #endif /* TT_CONFIG_OPTION_SFNT_NAMES */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftobject.c b/src/libs/freetype2/base/ftobject.c index 34e41e943f..b54b433f50 100644 --- a/src/libs/freetype2/base/ftobject.c +++ b/src/libs/freetype2/base/ftobject.c @@ -393,4 +393,4 @@ } return error; - } + } diff --git a/src/libs/freetype2/base/ftobjs.c b/src/libs/freetype2/base/ftobjs.c index e28f8a8e92..4f8f4d1c0e 100644 --- a/src/libs/freetype2/base/ftobjs.c +++ b/src/libs/freetype2/base/ftobjs.c @@ -22,7 +22,9 @@ #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H /* for SFNT_Load_Table_Func */ #include FT_TRUETYPE_TABLES_H +#include FT_TRUETYPE_IDS_H #include FT_OUTLINE_H @@ -196,19 +198,59 @@ return error; } + FT_BASE_DEF( void ) + ft_glyphslot_free_bitmap( FT_GlyphSlot slot ) + { + if ( slot->flags & FT_GLYPH_OWN_BITMAP ) + { + FT_Memory memory = FT_FACE_MEMORY( slot->face ); + + + FT_FREE( slot->bitmap.buffer ); + slot->flags &= ~FT_GLYPH_OWN_BITMAP; + } + else + { + /* assume that the bitmap buffer was stolen or not */ + /* allocated from the heap */ + slot->bitmap.buffer = NULL; + } + } + + + FT_BASE_DEF( void ) + ft_glyphslot_set_bitmap( FT_GlyphSlot slot, + FT_Pointer buffer ) + { + ft_glyphslot_free_bitmap( slot ); + + slot->bitmap.buffer = buffer; + + FT_ASSERT( (slot->flags & FT_GLYPH_OWN_BITMAP) == 0 ); + } + + + FT_BASE_DEF( FT_Error ) + ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot, + FT_ULong size ) + { + FT_Memory memory = FT_FACE_MEMORY( slot->face ); + + + if ( slot->flags & FT_GLYPH_OWN_BITMAP ) + FT_FREE( slot->bitmap.buffer ); + else + slot->flags |= FT_GLYPH_OWN_BITMAP; + + return FT_MEM_ALLOC( slot->bitmap.buffer, size ); + } + static void ft_glyphslot_clear( FT_GlyphSlot slot ) { /* free bitmap if needed */ - if ( slot->flags & FT_GLYPH_OWN_BITMAP ) - { - FT_Memory memory = FT_FACE_MEMORY( slot->face ); - - - FT_FREE( slot->bitmap.buffer ); - slot->flags &= ~FT_GLYPH_OWN_BITMAP; - } + ft_glyphslot_free_bitmap( slot ); /* clear all public fields in the glyph slot */ FT_ZERO( &slot->metrics ); @@ -246,8 +288,7 @@ clazz->done_slot( slot ); /* free bitmap buffer if needed */ - if ( slot->flags & FT_GLYPH_OWN_BITMAP ) - FT_FREE( slot->bitmap.buffer ); + ft_glyphslot_free_bitmap( slot ); /* free glyph loader */ if ( FT_DRIVER_USES_OUTLINES( driver ) ) @@ -699,6 +740,100 @@ } + /*************************************************************************/ + /* */ + /* */ + /* find_unicode_charmap */ + /* */ + /* */ + /* This function finds a Unicode charmap, if there is one. */ + /* And if there is more than one, it tries to favour the more */ + /* extensive one, i.e. one that supports UCS-4 against those which */ + /* are limited to the BMP (said UCS-2 encoding.) */ + /* */ + /* This function is called from open_face() (just below), and also */ + /* from FT_Select_Charmap( , FT_ENCODING_UNICODE). */ + /* */ + static FT_Error + find_unicode_charmap( FT_Face face ) + { + FT_CharMap* first; + FT_CharMap* cur; + FT_CharMap* unicmap = NULL; /* some UCS-2 map, if we found it */ + + + /* caller should have already checked that `face' is valid */ + FT_ASSERT ( face ); + + first = face->charmaps; + + if ( !first ) + return FT_Err_Invalid_CharMap_Handle; + + /* + * the original TrueType specification(s) only specified charmap + * formats that are capable of mapping 8 or 16 bit character codes to + * glyph indices. + * + * however, recent updates to the Apple and OpenType specifications + * introduced new formats that are capable of mapping 32-bit character + * codes as well. And these are already used on some fonts, mainly to + * map non-BMP Asian ideographs as defined in Unicode. + * + * for compatibility purposes, these fonts generally come with + * *several* Unicode charmaps: + * + * - one of them in the "old" 16-bit format, that cannot access + * all glyphs in the font + * + * - another one in the "new" 32-bit format, that can access all + * the glyphs. + * + * this function has been written to always favor a 32-bit charmap + * 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! */ + + cur = first + face->num_charmaps; /* points after the last one */ + + for ( ; --cur >= first; ) + { + if ( cur[0]->encoding == FT_ENCODING_UNICODE ) + { + unicmap = cur; /* record we found a Unicode charmap */ + + /* XXX If some new encodings to represent UCS-4 are added, */ + /* they should be added here. */ + if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT && + cur[0]->encoding_id == TT_MS_ID_UCS_4 ) || + ( 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! */ + { + 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. */ + if ( unicmap != NULL ) + { + face->charmap = unicmap[0]; + return 0; + } + + /* Chou blanc! */ + return FT_Err_Invalid_CharMap_Handle; + } + + /*************************************************************************/ /* */ /* */ @@ -718,7 +853,7 @@ FT_Memory memory; FT_Driver_Class clazz; FT_Face face = 0; - FT_Error error; + FT_Error error, error2; FT_Face_Internal internal; @@ -748,7 +883,7 @@ i++ ) if ( params[i].tag == FT_PARAM_TAG_INCREMENTAL ) face->internal->incremental_interface = params[i].data; - } + } #endif error = clazz->init_face( stream, @@ -760,24 +895,17 @@ goto Fail; /* select Unicode charmap by default */ + error2 = find_unicode_charmap( face ); + + /* if no Unicode charmap can be found, FT_Err_Invalid_CharMap_Handle is + * returned. + */ + + /* no error should happen, but we want to play safe. */ + if ( error2 && error2 != FT_Err_Invalid_CharMap_Handle ) { - FT_Int nn; - FT_CharMap unicmap = NULL, cmap; - - - for ( nn = 0; nn < face->num_charmaps; nn++ ) - { - cmap = face->charmaps[nn]; - - if ( cmap->encoding == FT_ENCODING_UNICODE ) - { - unicmap = cmap; - break; - } - } - - if ( unicmap != NULL ) - face->charmap = unicmap; + error = error2; + goto Fail; } *aface = face; @@ -1241,10 +1369,10 @@ /* Compute root ascender, descender, test height, and max_advance */ metrics->ascender = ( FT_MulFix( face->ascender, - metrics->y_scale ) + 32 ) & -64; + metrics->y_scale ) + 63 ) & -64; metrics->descender = ( FT_MulFix( face->descender, - metrics->y_scale ) + 32 ) & -64; + metrics->y_scale ) + 0 ) & -64; metrics->height = ( FT_MulFix( face->height, metrics->y_scale ) + 32 ) & -64; @@ -1297,9 +1425,10 @@ if ( char_height < 1 * 64 ) char_height = 1 * 64; - /* Compute pixel sizes in 26.6 units */ - dim_x = ( ( char_width * horz_resolution ) / 72 ) ; - dim_y = ( ( char_height * vert_resolution ) / 72 ) ; + /* Compute pixel sizes in 26.6 units. we use rounding + */ + dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; + dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); @@ -1315,15 +1444,6 @@ ft_recompute_scaled_metrics( face, metrics ); } - face->internal->orig_width = char_width; - face->internal->orig_height = char_height; - - face->internal->orig_horz_res = horz_resolution; - face->internal->orig_vert_res = vert_resolution; - - face->internal->orig_x_scale = metrics->x_scale; - face->internal->orig_y_scale = metrics->y_scale; - if ( clazz->set_char_sizes ) error = clazz->set_char_sizes( face->size, char_width, @@ -1379,14 +1499,6 @@ ft_recompute_scaled_metrics( face, metrics ); } - face->internal->orig_width = pixel_width << 6; - face->internal->orig_height = pixel_height << 6; - - face->internal->orig_horz_res = 0; - face->internal->orig_vert_res = 0; - - face->internal->orig_x_scale = metrics->x_scale; - face->internal->orig_y_scale = metrics->y_scale; if ( clazz->set_pixel_sizes ) error = clazz->set_pixel_sizes( face->size, pixel_width, @@ -1458,6 +1570,13 @@ if ( !face ) return FT_Err_Invalid_Face_Handle; + /* FT_ENCODING_UNICODE is special. We try to find the `best' Unicode */ + /* charmap available, i.e. one with UCS-4 characters, if possible. */ + /* */ + /* This is done by find_unicode_charmap() above, to share code. */ + if ( encoding == FT_ENCODING_UNICODE ) + return find_unicode_charmap( face ); + cur = face->charmaps; if ( !cur ) return FT_Err_Invalid_CharMap_Handle; @@ -1784,6 +1903,32 @@ } + /* documentation is in tttables.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Load_Sfnt_Table( FT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ) + { + SFNT_Load_Table_Func func; + FT_Driver driver; + + + if ( !face || !FT_IS_SFNT( face ) ) + return FT_Err_Invalid_Face_Handle; + + driver = face->driver; + func = (SFNT_Load_Table_Func) driver->root.clazz->get_interface( + FT_MODULE( driver ), "load_sfnt" ); + if ( !func ) + return FT_Err_Unimplemented_Feature; + + return func( face, tag, offset, buffer, length ); + } + + FT_EXPORT_DEF( FT_Error ) FT_Activate_Size( FT_Size size ) { @@ -2519,4 +2664,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftoutln.c b/src/libs/freetype2/base/ftoutln.c index c59043bc04..0eca3d5eee 100644 --- a/src/libs/freetype2/base/ftoutln.c +++ b/src/libs/freetype2/base/ftoutln.c @@ -655,4 +655,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftpfr.c b/src/libs/freetype2/base/ftpfr.c index bf2c2a2a5c..e091c3e4c0 100644 --- a/src/libs/freetype2/base/ftpfr.c +++ b/src/libs/freetype2/base/ftpfr.c @@ -102,4 +102,4 @@ return error; } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftstream.c b/src/libs/freetype2/base/ftstream.c index 60e7856810..919c22254e 100644 --- a/src/libs/freetype2/base/ftstream.c +++ b/src/libs/freetype2/base/ftstream.c @@ -800,4 +800,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftstroker.c b/src/libs/freetype2/base/ftstroker.c index c019be7dd8..4a3b01e6e4 100644 --- a/src/libs/freetype2/base/ftstroker.c +++ b/src/libs/freetype2/base/ftstroker.c @@ -233,8 +233,12 @@ { FT_ASSERT( border->start >= 0 ); - border->tags[ border->start ] |= FT_STROKE_TAG_BEGIN; - border->tags[ border->num_points-1 ] |= FT_STROKE_TAG_END; + /* don't record empty paths !! */ + if ( border->num_points > (FT_UInt)border->start ) + { + border->tags[ border->start ] |= FT_STROKE_TAG_BEGIN; + border->tags[ border->num_points-1 ] |= FT_STROKE_TAG_END; + } border->start = -1; border->movable = 0; @@ -469,7 +473,7 @@ FT_Byte* tags = border->tags; FT_Int in_contour = 0; - for ( ; count > 0; count--, point++, tags++ ) + for ( ; count > 0; count--, num_points++, point++, tags++ ) { if ( tags[0] & FT_STROKE_TAG_BEGIN ) { @@ -538,7 +542,7 @@ FT_Short* write = outline->contours + outline->n_contours; FT_Short index = (FT_Short) outline->n_points; - for ( ; count > 0; count--, tags++, write++, index++ ) + for ( ; count > 0; count--, tags++, index++ ) { if ( *tags & FT_STROKE_TAG_END ) { @@ -787,9 +791,15 @@ theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ); if (theta == FT_ANGLE_PI) + { theta = rotate; + phi = stroker->angle_in; + } else + { theta = theta/2; + phi = stroker->angle_in + theta + rotate; + } thcos = FT_Cos( theta ); sigma = FT_MulFix( stroker->miter_limit, thcos ); @@ -797,7 +807,6 @@ if ( sigma >= 0x10000L ) miter = 0; - phi = stroker->angle_in + theta + rotate; if (miter) /* this is a miter (broken angle) */ { @@ -1362,3 +1371,207 @@ ft_stroke_border_export( stroker->borders+1, outline ); } } + + + + + + /* + * the following is very similar to FT_Outline_Decompose, except + * that we do support opened paths, and do not scale the outline + */ + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_ParseOutline( FT_Stroker stroker, + FT_Outline* outline, + FT_Bool opened ) + { + FT_Vector v_last; + FT_Vector v_control; + FT_Vector v_start; + + FT_Vector* point; + FT_Vector* limit; + char* tags; + + FT_Error error; + + FT_Int n; /* index of contour in outline */ + FT_UInt first; /* index of first point in contour */ + FT_Int tag; /* current point's state */ + FT_Int in_path; + + if ( !outline || !stroker ) + return FT_Err_Invalid_Argument; + + first = 0; + + in_path = 0; + + for ( n = 0; n < outline->n_contours; n++ ) + { + FT_Int last; /* index of last point in contour */ + + + last = outline->contours[n]; + limit = outline->points + last; + + v_start = outline->points[first]; + v_last = outline->points[last]; + + v_control = v_start; + + point = outline->points + first; + tags = outline->tags + first; + tag = FT_CURVE_TAG( tags[0] ); + + /* A contour cannot start with a cubic control point! */ + if ( tag == FT_CURVE_TAG_CUBIC ) + goto Invalid_Outline; + + /* check first point to determine origin */ + if ( tag == FT_CURVE_TAG_CONIC ) + { + /* first point is conic control. Yes, this happens. */ + if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON ) + { + /* start at last point if it is on the curve */ + v_start = v_last; + limit--; + } + else + { + /* if both first and last points are conic, */ + /* start at their middle and record its position */ + /* for closure */ + v_start.x = ( v_start.x + v_last.x ) / 2; + v_start.y = ( v_start.y + v_last.y ) / 2; + + v_last = v_start; + } + point--; + tags--; + } + + error = FT_Stroker_BeginSubPath( stroker, &v_start, opened ); + if ( error ) + goto Exit; + + in_path = 1; + + while ( point < limit ) + { + point++; + tags++; + + tag = FT_CURVE_TAG( tags[0] ); + switch ( tag ) + { + case FT_CURVE_TAG_ON: /* emit a single line_to */ + { + FT_Vector vec; + + + vec.x = point->x; + vec.y = point->y; + + error = FT_Stroker_LineTo( stroker, &vec ); + if ( error ) + goto Exit; + continue; + } + + case FT_CURVE_TAG_CONIC: /* consume conic arcs */ + v_control.x = point->x; + v_control.y = point->y; + + Do_Conic: + if ( point < limit ) + { + FT_Vector vec; + FT_Vector v_middle; + + + point++; + tags++; + tag = FT_CURVE_TAG( tags[0] ); + + vec = point[0]; + + if ( tag == FT_CURVE_TAG_ON ) + { + error = FT_Stroker_ConicTo( stroker, &v_control, &vec ); + if ( error ) + goto Exit; + continue; + } + + if ( tag != FT_CURVE_TAG_CONIC ) + goto Invalid_Outline; + + v_middle.x = ( v_control.x + vec.x ) / 2; + v_middle.y = ( v_control.y + vec.y ) / 2; + + error = FT_Stroker_ConicTo( stroker, &v_control, &v_middle ); + if ( error ) + goto Exit; + + v_control = vec; + goto Do_Conic; + } + + error = FT_Stroker_ConicTo( stroker, &v_control, &v_start ); + goto Close; + + default: /* FT_CURVE_TAG_CUBIC */ + { + FT_Vector vec1, vec2; + + + if ( point + 1 > limit || + FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) + goto Invalid_Outline; + + point += 2; + tags += 2; + + vec1 = point[-2]; + vec2 = point[-1]; + + if ( point <= limit ) + { + FT_Vector vec; + + + vec = point[0]; + + error = FT_Stroker_CubicTo( stroker, &vec1, &vec2, &vec ); + if ( error ) + goto Exit; + continue; + } + + error = FT_Stroker_CubicTo( stroker, &vec1, &vec2, &v_start ); + goto Close; + } + } + } + + Close: + if ( error ) + goto Exit; + + error = FT_Stroker_EndSubPath( stroker ); + if ( error ) + goto Exit; + + first = last + 1; + } + + return 0; + + Exit: + return error; + + Invalid_Outline: + return FT_Err_Invalid_Outline; + } diff --git a/src/libs/freetype2/base/ftsynth.c b/src/libs/freetype2/base/ftsynth.c index 45459f3ee5..8a8fabdc25 100644 --- a/src/libs/freetype2/base/ftsynth.c +++ b/src/libs/freetype2/base/ftsynth.c @@ -283,4 +283,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftsysio.c b/src/libs/freetype2/base/ftsysio.c index 344ee516dd..05cb518d43 100644 --- a/src/libs/freetype2/base/ftsysio.c +++ b/src/libs/freetype2/base/ftsysio.c @@ -128,4 +128,4 @@ ft_object_create( clazz, pathname, FT_OBJECT_P(astream) ); } - + diff --git a/src/libs/freetype2/base/ftsysmem.c b/src/libs/freetype2/base/ftsysmem.c index 6a34f693f3..b6a0dd1fcf 100644 --- a/src/libs/freetype2/base/ftsysmem.c +++ b/src/libs/freetype2/base/ftsysmem.c @@ -27,4 +27,4 @@ }; FT_APIVAR_DEF( const FT_Memory_Funcs ) - ft_memory_funcs_default = &ft_memory_funcs_defaults_rec; + ft_memory_funcs_default = &ft_memory_funcs_defaults_rec; diff --git a/src/libs/freetype2/base/ftsystem.c b/src/libs/freetype2/base/ftsystem.c index 2365de2571..73db9f0956 100644 --- a/src/libs/freetype2/base/ftsystem.c +++ b/src/libs/freetype2/base/ftsystem.c @@ -300,4 +300,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/fttrigon.c b/src/libs/freetype2/base/fttrigon.c index 744f9a9b56..cc50b5e12b 100644 --- a/src/libs/freetype2/base/fttrigon.c +++ b/src/libs/freetype2/base/fttrigon.c @@ -474,6 +474,8 @@ FT_Angle delta = angle2 - angle1; delta %= FT_ANGLE_2PI; + if ( delta < 0 ) + delta += FT_ANGLE_2PI; if ( delta > FT_ANGLE_PI ) delta -= FT_ANGLE_2PI; @@ -482,4 +484,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/fttype1.c b/src/libs/freetype2/base/fttype1.c index d8b188647d..fad6ae5b93 100644 --- a/src/libs/freetype2/base/fttype1.c +++ b/src/libs/freetype2/base/fttype1.c @@ -84,4 +84,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftutil.c b/src/libs/freetype2/base/ftutil.c index 451bee524c..f3244dfa27 100644 --- a/src/libs/freetype2/base/ftutil.c +++ b/src/libs/freetype2/base/ftutil.c @@ -327,4 +327,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/ftwinfnt.c b/src/libs/freetype2/base/ftwinfnt.c new file mode 100644 index 0000000000..b8db7d363d --- /dev/null +++ b/src/libs/freetype2/base/ftwinfnt.c @@ -0,0 +1,55 @@ +/***************************************************************************/ +/* */ +/* ftwinfnt.c */ +/* */ +/* FreeType API for accessing Windows FNT specific info (body). */ +/* */ +/* 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. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_WINFONTS_H +#include FT_INTERNAL_FNT_TYPES_H +#include FT_INTERNAL_OBJECTS_H + + + FT_EXPORT_DEF( FT_Error ) + FT_Get_WinFNT_Header( FT_Face face, + FT_WinFNT_HeaderRec *header ) + { + FT_Error error; + + error = FT_Err_Invalid_Argument; + + if ( face != NULL && face->driver != NULL ) + { + FT_Module driver = (FT_Module) face->driver; + + + if ( driver->clazz && driver->clazz->module_name && + ft_strcmp( driver->clazz->module_name, "winfonts" ) == 0 ) + { + FNT_Size size = (FNT_Size)face->size; + FNT_Font font = size->font; + + if (font) + { + FT_MEM_COPY( header, &font->header, sizeof(*header) ); + error = 0; + } + } + } + return error; + } + + +/* END */ diff --git a/src/libs/freetype2/base/ftxf86.c b/src/libs/freetype2/base/ftxf86.c index 6fd7722a0f..614d888922 100644 --- a/src/libs/freetype2/base/ftxf86.c +++ b/src/libs/freetype2/base/ftxf86.c @@ -77,4 +77,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/base/rules.mk b/src/libs/freetype2/base/rules.mk index 0a38faefa9..3b63bcc702 100644 --- a/src/libs/freetype2/base/rules.mk +++ b/src/libs/freetype2/base/rules.mk @@ -49,12 +49,14 @@ BASE_SRC := $(BASE_)ftcalc.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_)ftglyph.c \ - $(BASE_)ftmm.c \ - $(BASE_)ftbdf.c \ - $(BASE_)fttype1.c \ - $(BASE_)ftxf86.c \ - $(BASE_)ftpfr.c \ +BASE_EXT_SRC := $(BASE_)ftglyph.c \ + $(BASE_)ftmm.c \ + $(BASE_)ftbdf.c \ + $(BASE_)fttype1.c \ + $(BASE_)ftxf86.c \ + $(BASE_)ftpfr.c \ + $(BASE_)ftstroker.c \ + $(BASE_)ftwinfnt.c \ $(BASE_)ftbbox.c # Default extensions objects @@ -89,4 +91,4 @@ $(BASE_OBJ_S): $(BASE_SRC_S) $(BASE_SRC) $(FREETYPE_H) $(OBJ_)%.$O: $(BASE_)%.c $(FREETYPE_H) $(BASE_COMPILE) $T$@ $< -# EOF +# EOF diff --git a/src/libs/freetype2/bdf/Jamfile b/src/libs/freetype2/bdf/Jamfile index 06a31904ec..f2c5917e8c 100644 --- a/src/libs/freetype2/bdf/Jamfile +++ b/src/libs/freetype2/bdf/Jamfile @@ -20,4 +20,4 @@ UseFreeTypeHeaders ; FT2_Library $(FT2_LIB) : $(_sources).c ; } -# end of src/bdf Jamfile +# end of src/bdf Jamfile diff --git a/src/libs/freetype2/bdf/README b/src/libs/freetype2/bdf/README index d45e4fb15a..73785b4e8f 100644 --- a/src/libs/freetype2/bdf/README +++ b/src/libs/freetype2/bdf/README @@ -145,4 +145,4 @@ Credits This driver is based on excellent Mark Leisher's bdf library. If you find something good in this driver you should probably thank him, not -me. +me. diff --git a/src/libs/freetype2/bdf/bdf.c b/src/libs/freetype2/bdf/bdf.c index 9c828853e1..26f969e57f 100644 --- a/src/libs/freetype2/bdf/bdf.c +++ b/src/libs/freetype2/bdf/bdf.c @@ -31,4 +31,4 @@ THE SOFTWARE. #include "bdfdrivr.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/bdf/bdf.h b/src/libs/freetype2/bdf/bdf.h index 6a4bb821f1..2f093fc03a 100644 --- a/src/libs/freetype2/bdf/bdf.h +++ b/src/libs/freetype2/bdf/bdf.h @@ -292,4 +292,4 @@ FT_END_HEADER #endif /* __BDF_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/bdf/bdfdrivr.c b/src/libs/freetype2/bdf/bdfdrivr.c index 0e9197f07a..21615715c3 100644 --- a/src/libs/freetype2/bdf/bdfdrivr.c +++ b/src/libs/freetype2/bdf/bdfdrivr.c @@ -29,6 +29,7 @@ THE SOFTWARE. #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_OBJECTS_H +#include FT_BDF_H #include "bdf.h" #include "bdfdrivr.h" @@ -488,8 +489,6 @@ THE SOFTWARE. int i, j, count; unsigned char *p, *pp; - FT_Memory memory = face->bdffont->memory; - FT_UNUSED( load_flags ); @@ -513,9 +512,9 @@ THE SOFTWARE. bitmap->pixel_mode = FT_PIXEL_MODE_MONO; bitmap->pitch = glyph.bpr; - if ( FT_NEW_ARRAY( bitmap->buffer, glyph.bytes ) ) - goto Exit; - FT_MEM_COPY( bitmap->buffer, glyph.bitmap, glyph.bytes ); + /* 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 { @@ -523,7 +522,8 @@ THE SOFTWARE. bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; bitmap->pitch = bitmap->width; - if ( FT_NEW_ARRAY( bitmap->buffer, bitmap->rows * bitmap->pitch ) ) + error = ft_glyphslot_alloc_bitmap( slot, bitmap->rows * bitmap->pitch ); + if ( error ) goto Exit; switch ( bpp ) @@ -624,13 +624,64 @@ THE SOFTWARE. slot->linearHoriAdvance = (FT_Fixed)glyph.dwidth << 16; slot->format = FT_GLYPH_FORMAT_BITMAP; - slot->flags = FT_GLYPH_OWN_BITMAP; Exit: return error; } + static FT_Error + bdf_get_bdf_property( BDF_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ) + { + bdf_property_t* prop; + + FT_ASSERT( face && face->bdffont ); + + prop = bdf_get_font_property( face->bdffont, (char*)prop_name ); + if ( prop != NULL ) + { + switch ( prop->format ) + { + case BDF_ATOM: + aproperty->type = BDF_PROPERTY_TYPE_ATOM; + aproperty->u.atom = prop->value.atom; + break; + + case BDF_INTEGER: + aproperty->type = BDF_PROPERTY_TYPE_INTEGER; + aproperty->u.integer = prop->value.int32; + break; + + case BDF_CARDINAL: + aproperty->type = BDF_PROPERTY_TYPE_CARDINAL; + aproperty->u.cardinal = prop->value.card32; + break; + + default: + goto Fail; + } + return 0; + } + Fail: + return FT_Err_Invalid_Argument; + } + + + static FT_Module_Interface + bdf_driver_requester( FT_Module module, + const char* name ) + { + FT_UNUSED( module ); + + if ( name && ft_strcmp( name, "get_bdf_property" ) == 0 ) + return (FT_Module_Interface) bdf_get_bdf_property; + + return NULL; + } + + FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec bdf_driver_class = { @@ -646,7 +697,7 @@ THE SOFTWARE. (FT_Module_Constructor)0, (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 + (FT_Module_Requester) bdf_driver_requester }, sizeof ( BDF_FaceRec ), @@ -671,4 +722,4 @@ THE SOFTWARE. }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/bdf/bdfdrivr.h b/src/libs/freetype2/bdf/bdfdrivr.h index 5c5896459f..70265bc83e 100644 --- a/src/libs/freetype2/bdf/bdfdrivr.h +++ b/src/libs/freetype2/bdf/bdfdrivr.h @@ -71,4 +71,4 @@ FT_END_HEADER #endif /* __BDFDRIVR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/bdf/bdferror.h b/src/libs/freetype2/bdf/bdferror.h index b27fa333bb..d2a046791d 100644 --- a/src/libs/freetype2/bdf/bdferror.h +++ b/src/libs/freetype2/bdf/bdferror.h @@ -41,4 +41,4 @@ #endif /* __BDFERROR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/bdf/bdflib.c b/src/libs/freetype2/bdf/bdflib.c index 7496e6061c..9deeb90c04 100644 --- a/src/libs/freetype2/bdf/bdflib.c +++ b/src/libs/freetype2/bdf/bdflib.c @@ -2433,4 +2433,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/bdf/descrip.mms b/src/libs/freetype2/bdf/descrip.mms index 4c32dc4499..834ae7819d 100644 --- a/src/libs/freetype2/bdf/descrip.mms +++ b/src/libs/freetype2/bdf/descrip.mms @@ -20,4 +20,4 @@ OBJS=bdf.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/bdf/module.mk b/src/libs/freetype2/bdf/module.mk index 24115e75d0..db0c262e1b 100644 --- a/src/libs/freetype2/bdf/module.mk +++ b/src/libs/freetype2/bdf/module.mk @@ -28,4 +28,4 @@ make_module_list: add_bdf_driver add_bdf_driver: $(OPEN_DRIVER)bdf_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)bdf $(ECHO_DRIVER_DESC)bdf bitmap fonts$(ECHO_DRIVER_DONE) - + diff --git a/src/libs/freetype2/bdf/rules.mk b/src/libs/freetype2/bdf/rules.mk index b1a3ed9f8e..eacaea768a 100644 --- a/src/libs/freetype2/bdf/rules.mk +++ b/src/libs/freetype2/bdf/rules.mk @@ -76,4 +76,4 @@ $(OBJ_)%.$O: $(BDF_DIR_)%.c $(FREETYPE_H) $(BDF_DRV_H) DRV_OBJS_S += $(BDF_DRV_OBJ_S) DRV_OBJS_M += $(BDF_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/cache/Jamfile b/src/libs/freetype2/cache/Jamfile index cc2ebca43a..bef45ae448 100644 --- a/src/libs/freetype2/cache/Jamfile +++ b/src/libs/freetype2/cache/Jamfile @@ -9,7 +9,7 @@ UseFreeTypeHeaders ; # later used in #include statements related to the cache sub-system. It # needs to be parsed through a HDRMACRO rule for macro definitions. # -# HDRMACRO [ FT2_SubDir include ftcache.h ] ; +#HDRMACRO [ FT2_SubDir include ftcache.h ] ; { local _sources ; @@ -26,4 +26,4 @@ UseFreeTypeHeaders ; FT2_Library $(FT2_LIB) : $(_sources).c ; } -# end of src/cache Jamfile +# end of src/cache Jamfile diff --git a/src/libs/freetype2/cache/descrip.mms b/src/libs/freetype2/cache/descrip.mms index ea12f2e376..c3e71ff3f3 100644 --- a/src/libs/freetype2/cache/descrip.mms +++ b/src/libs/freetype2/cache/descrip.mms @@ -23,4 +23,4 @@ all : $(OBJS) ftcache.obj : ftcache.c ftlru.c ftcmanag.c ftccache.c ftcglyph.c ftcimage.c \ ftcsbits.c ftccmap.c -# EOF +# EOF diff --git a/src/libs/freetype2/cache/ftcache.c b/src/libs/freetype2/cache/ftcache.c index 07e85e1ea4..f6b4b2a73b 100644 --- a/src/libs/freetype2/cache/ftcache.c +++ b/src/libs/freetype2/cache/ftcache.c @@ -28,4 +28,4 @@ #include "ftccmap.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftccache.c b/src/libs/freetype2/cache/ftccache.c index 14cb725b2c..6f273c1655 100644 --- a/src/libs/freetype2/cache/ftccache.c +++ b/src/libs/freetype2/cache/ftccache.c @@ -196,7 +196,8 @@ FTC_Node* pold; - FT_ASSERT( old_index >= FTC_HASH_INITIAL_SIZE ); + if ( old_index+1 <= FTC_HASH_INITIAL_SIZE ) + goto Exit; if ( p == 0 ) { @@ -356,10 +357,12 @@ FT_FREE( node ); +#if 0 /* check, just in case of general corruption :-) */ if ( manager->num_nodes == 0 ) FT_ERROR(( "ftc_node_destroy: invalid cache node count! = %d\n", manager->num_nodes )); +#endif } @@ -404,11 +407,14 @@ FT_EXPORT_DEF( void ) ftc_family_done( FTC_Family family ) { - FTC_Manager manager = family->cache->manager; + if ( family && family->cache ) + { + FTC_Manager manager = family->cache->manager; - /* remove from manager's family table */ - ftc_family_table_free( &manager->families, family->fam_index ); + /* remove from manager's family table */ + ftc_family_table_free( &manager->families, family->fam_index ); + } } @@ -545,8 +551,10 @@ FTC_Query query, FTC_Node *anode ) { - FT_Error error = FT_Err_Ok; - FT_LruNode lru; + FT_Error error = FT_Err_Ok; + FTC_Manager manager; + FT_LruNode lru; + FT_UInt free_count = 0; if ( !cache || !query || !anode ) @@ -557,152 +565,237 @@ query->hash = 0; query->family = NULL; - /* XXX: we break encapsulation for the sake of speed! */ + manager = cache->manager; + + /* here's a small note explaining what's hapenning in the code below. + * + * we need to deal intelligently with out-of-memory (OOM) conditions + * when trying to create a new family or cache node during the lookup. + * + * when an OOM is detected, we'll try to free one or more "old" nodes + * from the cache, then try again. it may be necessary to do that several + * times, so a loop is needed. + * + * the local variable "free_count" holds the number of "old" nodes to + * discard on each attempt. it starts at 1 and doubles on each iteration. + * the loop stops when: + * + * - a non-OOM error is detected + * - a succesful lookup is performed + * - there are no more unused nodes in the cache + * + * for the record, remember that all used nodes appear _before_ + * unused ones in the manager's MRU node list. + */ + + for (;;) { - /* first of all, find the relevant family */ - FT_LruList list = cache->families; - FT_LruNode fam, *pfam; - FT_LruNode_CompareFunc compare = list->clazz->node_compare; - - pfam = &list->nodes; - for (;;) { - fam = *pfam; - if ( fam == NULL ) + /* first of all, find the relevant family */ + FT_LruList list = cache->families; + FT_LruNode fam, *pfam; + FT_LruNode_CompareFunc compare = list->clazz->node_compare; + + pfam = &list->nodes; + for (;;) { - error = FT_LruList_Lookup( list, query, &lru ); - if ( error ) - goto Exit; - - goto Skip; - } - - if ( compare( fam, query, list->data ) ) - break; - - pfam = &fam->next; - } - - FT_ASSERT( fam != NULL ); - - /* move to top of list when needed */ - if ( fam != list->nodes ) - { - *pfam = fam->next; - fam->next = list->nodes; - list->nodes = fam; - } - - lru = fam; - - Skip: - ; - } - - { - FTC_Family family = (FTC_Family) lru; - FT_UFast hash = query->hash; - FTC_Node* bucket; - FT_UInt idx; - - - idx = hash & cache->mask; - if ( idx < cache->p ) - idx = hash & ( cache->mask * 2 + 1 ); - - bucket = cache->buckets + idx; - - - if ( query->family != family || - family->fam_index >= cache->manager->families.size ) - { - FT_ERROR(( - "ftc_cache_lookup: invalid query (bad 'family' field)\n" )); - return FTC_Err_Invalid_Argument; - } - - if ( *bucket ) - { - FTC_Node* pnode = bucket; - FTC_Node_CompareFunc compare = cache->clazz->node_compare; - - - for ( ;; ) - { - FTC_Node node; - - - node = *pnode; - if ( node == NULL ) - break; - - if ( node->hash == hash && - (FT_UInt)node->fam_index == family->fam_index && - compare( node, query, cache ) ) + fam = *pfam; + if ( fam == NULL ) { - /* move to head of bucket list */ - if ( pnode != bucket ) - { - *pnode = node->link; - node->link = *bucket; - *bucket = node; - } + error = FT_LruList_Lookup( list, query, &lru ); + if ( error ) + goto Fail; - /* move to head of MRU list */ - if ( node != cache->manager->nodes_list ) - ftc_node_mru_up( node, cache->manager ); - - *anode = node; - goto Exit; + goto Skip; } - pnode = &node->link; + if ( compare( fam, query, list->data ) ) + break; + + pfam = &fam->next; } + + FT_ASSERT( fam != NULL ); + + /* move to top of list when needed */ + if ( fam != list->nodes ) + { + *pfam = fam->next; + fam->next = list->nodes; + list->nodes = fam; + } + + lru = fam; + + Skip: + ; } - /* didn't find a node, create a new one */ { - FTC_Cache_Class clazz = cache->clazz; - FTC_Manager manager = cache->manager; - FT_Memory memory = cache->memory; - FTC_Node node; + FTC_Manager manager = cache->manager; + FTC_Family family = (FTC_Family) lru; + FT_UFast hash = query->hash; + FTC_Node* bucket; + FT_UInt idx; - if ( FT_ALLOC( node, clazz->node_size ) ) - goto Exit; + idx = hash & cache->mask; + if ( idx < cache->p ) + idx = hash & ( cache->mask * 2 + 1 ); - node->fam_index = (FT_UShort) family->fam_index; - node->hash = query->hash; - node->ref_count = 0; + bucket = cache->buckets + idx; - error = clazz->node_init( node, query, cache ); - if ( error ) + + if ( query->family != family || + family->fam_index >= manager->families.size ) { - FT_FREE( node ); + FT_ERROR(( + "ftc_cache_lookup: invalid query (bad 'family' field)\n" )); + error = FTC_Err_Invalid_Argument; goto Exit; } - error = ftc_node_hash_link( node, cache ); - if ( error ) + if ( *bucket ) { - clazz->node_done( node, cache ); - FT_FREE( node ); + FTC_Node* pnode = bucket; + FTC_Node_CompareFunc compare = cache->clazz->node_compare; + + + for ( ;; ) + { + FTC_Node node; + + + node = *pnode; + if ( node == NULL ) + break; + + if ( node->hash == hash && + (FT_UInt)node->fam_index == family->fam_index && + compare( node, query, cache ) ) + { + /* move to head of bucket list */ + if ( pnode != bucket ) + { + *pnode = node->link; + node->link = *bucket; + *bucket = node; + } + + /* move to head of MRU list */ + if ( node != manager->nodes_list ) + ftc_node_mru_up( node, manager ); + + *anode = node; + goto Exit; + } + + pnode = &node->link; + } + } + + /* didn't find a node, create a new one */ + { + FTC_Cache_Class clazz = cache->clazz; + FT_Memory memory = cache->memory; + FTC_Node node; + + + if ( FT_ALLOC( node, clazz->node_size ) ) + goto Fail; + + node->fam_index = (FT_UShort) family->fam_index; + node->hash = query->hash; + node->ref_count = 0; + + error = clazz->node_init( node, query, cache ); + if ( error ) + { + FT_FREE( node ); + goto Fail; + } + + error = ftc_node_hash_link( node, cache ); + if ( error ) + { + clazz->node_done( node, cache ); + FT_FREE( node ); + goto Fail; + } + + ftc_node_mru_link( node, cache->manager ); + + cache->manager->cur_weight += clazz->node_weight( node, cache ); + + /* now try to compress the node pool when necessary */ + if ( manager->cur_weight >= manager->max_weight ) + { + node->ref_count++; + FTC_Manager_Compress( manager ); + node->ref_count--; + } + + *anode = node; + } + + /* all is well, exit now + */ + goto Exit; + } + + Fail: + if ( error != FT_Err_Out_Of_Memory ) + goto Exit; + + /* there is not enough memory, try to release some unused nodes + * from the cache to make room for a new one. + */ + { + FT_UInt new_count; + + new_count = 1 + free_count*2; + + /* check overflow and bounds */ + if ( new_count < free_count || free_count > manager->num_nodes ) goto Exit; - } - ftc_node_mru_link( node, cache->manager ); + free_count = new_count; - cache->manager->cur_weight += clazz->node_weight( node, cache ); - - /* now try to compress the node pool when necessary */ - if ( manager->cur_weight >= manager->max_weight ) + /* try to remove "new_count" nodes from the list */ { - node->ref_count++; - FTC_Manager_Compress( manager ); - node->ref_count--; - } + FTC_Node first = manager->nodes_list; + FTC_Node node; - *anode = node; + if ( first == NULL ) /* empty list ! */ + goto Exit; + + /* go to last node - it's a circular list */ + node = first->mru_prev; + for ( ; node && new_count > 0; new_count-- ) + { + FTC_Node prev = node->mru_prev; + + /* used nodes always appear before unused one in the MRU + * list. if we find one here, we'd better stop right now + * our iteration + */ + if ( node->ref_count > 0 ) + { + /* if there are no unused nodes in the list, we'd better exit */ + if ( new_count == free_count ) + goto Exit; + + break; + } + + ftc_node_destroy( node, manager ); + + if ( node == first ) + break; + + node = prev; + } + } } } @@ -711,4 +804,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftccache.i b/src/libs/freetype2/cache/ftccache.i index bb6e631a25..bf61450021 100644 --- a/src/libs/freetype2/cache/ftccache.i +++ b/src/libs/freetype2/cache/ftccache.i @@ -154,4 +154,4 @@ #undef GEN_CACHE_LOOKUP -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftccmap.c b/src/libs/freetype2/cache/ftccmap.c index 8c982c3d69..bdf61ed6e7 100644 --- a/src/libs/freetype2/cache/ftccmap.c +++ b/src/libs/freetype2/cache/ftccmap.c @@ -23,9 +23,13 @@ #include FT_CACHE_MANAGER_H #include FT_INTERNAL_MEMORY_H #include FT_INTERNAL_DEBUG_H +#include FT_TRUETYPE_IDS_H #include "ftcerror.h" +#undef FT_COMPONENT +#define FT_COMPONENT trace_cache + /*************************************************************************/ /* */ /* Each FTC_CMapNode contains a simple array to map a range of character */ @@ -131,7 +135,7 @@ ftc_cmap_node_weight( FTC_CMapNode cnode ) { FT_UNUSED( cnode ); - + return sizeof ( *cnode ); } @@ -189,10 +193,54 @@ break; case FTC_CMAP_BY_ENCODING: - for ( idx = 0; idx < count; idx++, cur++ ) - if ( cur[0]->encoding == desc->u.encoding ) - break; + if (desc->u.encoding == FT_ENCODING_UNICODE) + { + /* 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! + */ + FT_UInt unicmap_idx = count; /* some UCS-2 map, if we found it */ + + cur += count - 1; + + for ( idx = 0; idx < count; idx++, cur-- ) + { + if ( cur[0]->encoding == FT_ENCODING_UNICODE ) + { + unicmap_idx = idx; /* record we found a Unicode charmap */ + + /* XXX If some new encodings to represent UCS-4 are added, + * they should be added here. + */ + if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT && + cur[0]->encoding_id == TT_MS_ID_UCS_4 ) || + ( 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! */ + { + idx = count - 1 - idx; + goto Found_idx_for_FTC_CMAP_BY_ENCODING; + } + } + } + + /* We do not have any UCS-4 charmap. Sigh. + * Let's see if we have some other kind of Unicode charmap, though. + */ + if ( unicmap_idx < count ) + idx = count - 1 - unicmap_idx; + } + else + { + for ( idx = 0; idx < count; idx++, cur++ ) + if ( cur[0]->encoding == desc->u.encoding ) + break; + } + + Found_idx_for_FTC_CMAP_BY_ENCODING: hash = idx * 67; break; @@ -227,7 +275,7 @@ return error; Bad_Descriptor: - FT_ERROR(( "ftp_cmap_family_init: invalid charmap descriptor\n" )); + FT_TRACE1(( "ftp_cmap_family_init: invalid charmap descriptor\n" )); return FTC_Err_Invalid_Argument; } @@ -408,4 +456,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftcerror.h b/src/libs/freetype2/cache/ftcerror.h index 5998d42daf..df381f5218 100644 --- a/src/libs/freetype2/cache/ftcerror.h +++ b/src/libs/freetype2/cache/ftcerror.h @@ -37,4 +37,4 @@ #endif /* __FTCERROR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftcglyph.c b/src/libs/freetype2/cache/ftcglyph.c index aa21228a79..27cb80db37 100644 --- a/src/libs/freetype2/cache/ftcglyph.c +++ b/src/libs/freetype2/cache/ftcglyph.c @@ -112,4 +112,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftcimage.c b/src/libs/freetype2/cache/ftcimage.c index fa1b6ac717..47af4f5bda 100644 --- a/src/libs/freetype2/cache/ftcimage.c +++ b/src/libs/freetype2/cache/ftcimage.c @@ -396,4 +396,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftcmanag.c b/src/libs/freetype2/cache/ftcmanag.c index 7cdb8f9da7..4250a70963 100644 --- a/src/libs/freetype2/cache/ftcmanag.c +++ b/src/libs/freetype2/cache/ftcmanag.c @@ -762,4 +762,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftcsbits.c b/src/libs/freetype2/cache/ftcsbits.c index 663467616a..f3b4603571 100644 --- a/src/libs/freetype2/cache/ftcsbits.c +++ b/src/libs/freetype2/cache/ftcsbits.c @@ -216,7 +216,7 @@ /* we mark unloaded glyphs with `sbit.buffer == 0' */ /* and 'width == 255', 'height == 0' */ /* */ - if ( error ) + if ( error && error != FT_Err_Out_Of_Memory ) { sbit->width = 255; error = 0; @@ -554,4 +554,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/ftlru.c b/src/libs/freetype2/cache/ftlru.c index 4a6f603553..feb38ea790 100644 --- a/src/libs/freetype2/cache/ftlru.c +++ b/src/libs/freetype2/cache/ftlru.c @@ -21,6 +21,7 @@ #include FT_CACHE_INTERNAL_LRU_H #include FT_LIST_H #include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H #include "ftcerror.h" @@ -187,80 +188,135 @@ goto Exit; } - /* we haven't found the relevant element. We will now try */ - /* to create a new one. */ - /* */ - - /* first, check if our list if full, when appropriate */ - if ( list->max_nodes > 0 && list->num_nodes >= list->max_nodes ) + /* since we haven't found the relevant element in our LRU list, + * we're going to "create" a new one. + * + * the following code is a bit special, because it tries to handle + * out-of-memory conditions (OOM) in an intelligent way. + * + * more precisely, if not enough memory is available to create a + * new node or "flush" an old one, we need to remove the oldest + * elements from our list, and try again. since several tries may + * be necessary, a loop is needed + * + * this loop will only exit when: + * + * - a new node was succesfully created, or an old node flushed + * - an error other than FT_Err_Out_Of_Memory is detected + * - the list of nodes is empty, and it isn't possible to create + * new nodes + * + * on each unsucesful attempt, one node will be removed from the list + * + */ + { - /* this list list is full; we will now flush */ - /* the oldest node, if there's one! */ - FT_LruNode last = *plast; + FT_Int drop_last = ( list->max_nodes > 0 && + list->num_nodes >= list->max_nodes ); - - if ( last ) + for (;;) { - if ( clazz->node_flush ) + node = NULL; + + /* when "drop_last" is true, we should free the last node in + * the list to make room for a new one. note that we re-use + * its memory block to save allocation calls. + */ + if ( drop_last ) { - error = clazz->node_flush( last, key, list->data ); + /* find the last node in the list + */ + pnode = &list->nodes; + node = *pnode; + + if ( node == NULL ) + { + FT_ASSERT( list->nodes == 0 ); + error = FT_Err_Out_Of_Memory; + goto Exit; + } + + FT_ASSERT( list->num_nodes > 0 ); + + while ( node->next ) + { + pnode = &node->next; + node = *pnode; + } + + /* remove it from the list, and try to "flush" it. doing this will + * save a significant number of dynamic allocations compared to + * a classic destroy/create cycle + */ + *pnode = NULL; + list->num_nodes -= 1; + + if ( clazz->node_flush ) + { + error = clazz->node_flush( node, key, list->data ); + if ( !error ) + goto Success; + + /* note that if an error occured during the flush, we need to + * finalize it since it is potentially in incomplete state. + */ + } + + /* we finalize, but do not destroy the last node, we + * simply re-use its memory block ! + */ + if ( clazz->node_done ) + clazz->node_done( node, list->data ); + + FT_MEM_ZERO( node, clazz->node_size ); } else { - if ( clazz->node_done ) - clazz->node_done( last, list->data ); - - last->key = key; - error = clazz->node_init( last, key, list->data ); + /* try to allocate a new node when "drop_last" is not TRUE + * this usually happens on the first pass, when the LRU list + * is not already full. + */ + if ( FT_ALLOC( node, clazz->node_size ) ) + goto Fail; } + + FT_ASSERT( node != NULL ); - if ( !error ) + node->key = key; + error = clazz->node_init( node, key, list->data ); + if ( error ) { - /* move it to the top of the list */ - *plast = NULL; - last->next = list->nodes; - list->nodes = last; + if ( clazz->node_done ) + clazz->node_done( node, list->data ); - result = last; - goto Exit; + FT_FREE( node ); + goto Fail; } - /* in case of error during the flush or done/init cycle, */ - /* we need to discard the node */ - if ( clazz->node_done ) - clazz->node_done( last, list->data ); + Success: + result = node; - *plast = NULL; - list->num_nodes--; - - FT_FREE( last ); + node->next = list->nodes; + list->nodes = node; + list->num_nodes++; goto Exit; + + Fail: + if ( error != FT_Err_Out_Of_Memory ) + goto Exit; + + drop_last = 1; + continue; } } - /* otherwise, simply allocate a new node */ - if ( FT_ALLOC( node, clazz->node_size ) ) - goto Exit; - - node->key = key; - error = clazz->node_init( node, key, list->data ); - if ( error ) - { - FT_FREE( node ); - goto Exit; - } - - result = node; - node->next = list->nodes; - list->nodes = node; - list->num_nodes++; - Exit: *anode = result; return error; } + FT_EXPORT_DEF( void ) FT_LruList_Remove( FT_LruList list, FT_LruNode node ) @@ -335,4 +391,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cache/rules.mk b/src/libs/freetype2/cache/rules.mk index a74e7800ac..41e5e2b2d3 100644 --- a/src/libs/freetype2/cache/rules.mk +++ b/src/libs/freetype2/cache/rules.mk @@ -77,4 +77,4 @@ DRV_OBJS_S += $(Cache_DRV_OBJ_S) DRV_OBJS_M += $(Cache_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/cff/Jamfile b/src/libs/freetype2/cff/Jamfile index e7aa1cb8df..f01c8c9cea 100644 --- a/src/libs/freetype2/cff/Jamfile +++ b/src/libs/freetype2/cff/Jamfile @@ -20,4 +20,4 @@ UseFreeTypeHeaders ; FT2_Library $(FT2_LIB) : $(_sources).c ; } -# end of src/cff Jamfile +# end of src/cff Jamfile diff --git a/src/libs/freetype2/cff/cff.c b/src/libs/freetype2/cff/cff.c index 013c329cab..590af6b03b 100644 --- a/src/libs/freetype2/cff/cff.c +++ b/src/libs/freetype2/cff/cff.c @@ -26,4 +26,4 @@ #include "cffgload.c" #include "cffcmap.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffcmap.c b/src/libs/freetype2/cff/cffcmap.c index 5beb6aea58..5c0d8f7e2c 100644 --- a/src/libs/freetype2/cff/cffcmap.c +++ b/src/libs/freetype2/cff/cffcmap.c @@ -323,4 +323,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffcmap.h b/src/libs/freetype2/cff/cffcmap.h index e136d29e08..e03b81454e 100644 --- a/src/libs/freetype2/cff/cffcmap.h +++ b/src/libs/freetype2/cff/cffcmap.h @@ -85,4 +85,4 @@ FT_END_HEADER #endif /* __CFFCMAP_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffdrivr.c b/src/libs/freetype2/cff/cffdrivr.c index 34ed2bf76e..2ca6a873f6 100644 --- a/src/libs/freetype2/cff/cffdrivr.c +++ b/src/libs/freetype2/cff/cffdrivr.c @@ -417,4 +417,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffdrivr.h b/src/libs/freetype2/cff/cffdrivr.h index 553848c0a9..f5c19d1cf8 100644 --- a/src/libs/freetype2/cff/cffdrivr.h +++ b/src/libs/freetype2/cff/cffdrivr.h @@ -36,4 +36,4 @@ FT_END_HEADER #endif /* __CFFDRIVER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cfferrs.h b/src/libs/freetype2/cff/cfferrs.h index 1b2a5c95c8..a0c38f641a 100644 --- a/src/libs/freetype2/cff/cfferrs.h +++ b/src/libs/freetype2/cff/cfferrs.h @@ -38,4 +38,4 @@ #endif /* __CFFERRS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffgload.c b/src/libs/freetype2/cff/cffgload.c index 69277ae59e..a5a94e6d8f 100644 --- a/src/libs/freetype2/cff/cffgload.c +++ b/src/libs/freetype2/cff/cffgload.c @@ -2363,6 +2363,29 @@ cff_builder_done( &decoder.builder ); } + #ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* Incremental fonts can optionally override the metrics. */ + if ( !error && + face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; + + metrics.bearing_x = decoder.builder.left_bearing.x; + metrics.bearing_y = decoder.builder.left_bearing.y; + metrics.advance = decoder.builder.advance.x; + error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, FALSE, &metrics ); + decoder.builder.left_bearing.x = metrics.bearing_x; + decoder.builder.left_bearing.y = metrics.bearing_y; + decoder.builder.advance.x = metrics.advance; + decoder.builder.advance.y = 0; + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + font_matrix = cff->top_font.font_dict.font_matrix; font_offset = cff->top_font.font_dict.font_offset; @@ -2478,4 +2501,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffgload.h b/src/libs/freetype2/cff/cffgload.h index a1be92cb00..6c52621fa3 100644 --- a/src/libs/freetype2/cff/cffgload.h +++ b/src/libs/freetype2/cff/cffgload.h @@ -211,4 +211,4 @@ FT_END_HEADER #endif /* __CFFGLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffload.c b/src/libs/freetype2/cff/cffload.c index b21cfc3cae..660d87c9f3 100644 --- a/src/libs/freetype2/cff/cffload.c +++ b/src/libs/freetype2/cff/cffload.c @@ -1538,10 +1538,10 @@ { if ( FT_FRAME_ENTER( ( num_glyphs - 1 ) * 2 ) ) goto Exit; - + for ( j = 1; j < num_glyphs; j++ ) charset->sids[j] = FT_GET_USHORT(); - + FT_FRAME_EXIT(); } break; @@ -1595,17 +1595,16 @@ /* In order to use a predefined charset, the following must be */ /* true: The charset constructed for the glyphs in the font's */ /* charstrings dictionary must match the predefined charset in */ - /* the first num_glyphs, and hence must match the predefined */ - /* charset *exactly*. */ + /* the first num_glyphs */ charset->offset = offset; /* record charset type */ switch ( (FT_UInt)offset ) { case 0: - if ( num_glyphs != 229 ) + if ( num_glyphs > 229 ) { - FT_ERROR(("cff_charset_load: implicit charset not equal to\n" + FT_ERROR(("cff_charset_load: implicit charset larger than\n" "predefined charset (Adobe ISO-Latin)!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; @@ -1622,9 +1621,9 @@ break; case 1: - if ( num_glyphs != 166 ) + if ( num_glyphs > 166 ) { - FT_ERROR(( "cff_charset_load: implicit charset not equal to\n" + FT_ERROR(( "cff_charset_load: implicit charset larger than\n" "predefined charset (Adobe Expert)!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; @@ -1641,9 +1640,9 @@ break; case 2: - if ( num_glyphs != 87 ) + if ( num_glyphs > 87 ) { - FT_ERROR(( "cff_charset_load: implicit charset not equal to\n" + FT_ERROR(( "cff_charset_load: implicit charset larger than\n" "predefined charset (Adobe Expert Subset)!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; @@ -1744,26 +1743,29 @@ FT_READ_BYTE( count ) ) goto Exit; - encoding->count = count + 1; - switch ( encoding->format & 0x7F ) { case 0: { FT_Byte* p; - + + /* by convention, GID 0 is always ".notdef" and is never */ + /* coded in the font. Hence, the number of codes found */ + /* in the table is 'count+1' */ + /* */ + encoding->count = count + 1; if ( FT_FRAME_ENTER( count ) ) goto Exit; p = (FT_Byte*)stream->cursor; - + for ( j = 1; j <= count; j++ ) { glyph_code = *p++; /* Make sure j is not too big. */ - if ( (FT_UInt) glyph_code < num_glyphs ) + if ( j < num_glyphs ) { /* Assign code to GID mapping. */ encoding->codes[glyph_code] = (FT_UShort)j; @@ -1772,7 +1774,7 @@ encoding->sids[glyph_code] = charset->sids[j]; } } - + FT_FRAME_EXIT(); } break; @@ -1784,6 +1786,8 @@ FT_UInt k; + encoding->count = 0; + /* Parse the Format1 ranges. */ for ( j = 0; j < count; j++, i += nleft ) { @@ -1798,6 +1802,10 @@ /* Increment nleft, so we read `nleft + 1' codes/sids. */ nleft++; + /* compute max number of character codes */ + if ( (FT_UInt)nleft > encoding->count ) + encoding->count = nleft; + /* Fill in the range of codes/sids. */ for ( k = i; k < nleft + i; k++, glyph_code++ ) { @@ -1812,6 +1820,10 @@ } } } + + /* simple check, one never knows what can be found in a font */ + if ( encoding->count > 256 ) + encoding->count = 256; } break; @@ -1867,8 +1879,6 @@ /* encoding (see the note at the end of section 12 in the CFF */ /* specification). */ - encoding->count = 256; - switch ( (FT_UInt)offset ) { case 0: @@ -1886,6 +1896,10 @@ Populate: /* Construct code to GID mapping from code to SID mapping */ /* and charset. */ + + encoding->count = 0; + + for ( j = 0; j < 256; j++ ) { /* If j is encoded, find the GID for it. */ @@ -1905,7 +1919,13 @@ encoding->sids [j] = 0; } else + { encoding->codes[j] = (FT_UShort)i; + + /* update encoding count */ + if ( encoding->count < j+1 ) + encoding->count = j+1; + } } } break; @@ -2244,4 +2264,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffload.h b/src/libs/freetype2/cff/cffload.h index 4cadfe6bbb..0bb76be029 100644 --- a/src/libs/freetype2/cff/cffload.h +++ b/src/libs/freetype2/cff/cffload.h @@ -71,4 +71,4 @@ FT_END_HEADER #endif /* __CFFLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffobjs.c b/src/libs/freetype2/cff/cffobjs.c index 830f46269f..d34b083c34 100644 --- a/src/libs/freetype2/cff/cffobjs.c +++ b/src/libs/freetype2/cff/cffobjs.c @@ -572,4 +572,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffobjs.h b/src/libs/freetype2/cff/cffobjs.h index cf60ecfb25..878d47ea99 100644 --- a/src/libs/freetype2/cff/cffobjs.h +++ b/src/libs/freetype2/cff/cffobjs.h @@ -157,4 +157,4 @@ FT_END_HEADER #endif /* __CFFOBJS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffparse.c b/src/libs/freetype2/cff/cffparse.c index 3e1f8408e8..18ef7f7b42 100644 --- a/src/libs/freetype2/cff/cffparse.c +++ b/src/libs/freetype2/cff/cffparse.c @@ -678,4 +678,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cffparse.h b/src/libs/freetype2/cff/cffparse.h index 2de95a2c5b..2392764efb 100644 --- a/src/libs/freetype2/cff/cffparse.h +++ b/src/libs/freetype2/cff/cffparse.h @@ -66,4 +66,4 @@ FT_END_HEADER #endif /* __CFF_PARSE_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/cfftoken.h b/src/libs/freetype2/cff/cfftoken.h index 2cbb837b43..4df58c1c7f 100644 --- a/src/libs/freetype2/cff/cfftoken.h +++ b/src/libs/freetype2/cff/cfftoken.h @@ -94,4 +94,4 @@ CFF_FIELD_NUM ( 21, nominal_width ) -/* END */ +/* END */ diff --git a/src/libs/freetype2/cff/descrip.mms b/src/libs/freetype2/cff/descrip.mms index 2401f2ee2b..99b509cc88 100644 --- a/src/libs/freetype2/cff/descrip.mms +++ b/src/libs/freetype2/cff/descrip.mms @@ -20,4 +20,4 @@ OBJS=cff.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/cff/module.mk b/src/libs/freetype2/cff/module.mk index 68789c98ac..91a15322db 100644 --- a/src/libs/freetype2/cff/module.mk +++ b/src/libs/freetype2/cff/module.mk @@ -19,4 +19,4 @@ add_cff_driver: $(OPEN_DRIVER)cff_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)cff $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/cff/rules.mk b/src/libs/freetype2/cff/rules.mk index b53fdd83a2..7dabd9a290 100644 --- a/src/libs/freetype2/cff/rules.mk +++ b/src/libs/freetype2/cff/rules.mk @@ -68,4 +68,4 @@ $(OBJ_)%.$O: $(CFF_DIR_)%.c $(FREETYPE_H) $(CFF_DRV_H) DRV_OBJS_S += $(CFF_DRV_OBJ_S) DRV_OBJS_M += $(CFF_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/cid/Jamfile b/src/libs/freetype2/cid/Jamfile index 2180607b2b..f09529a31b 100644 --- a/src/libs/freetype2/cid/Jamfile +++ b/src/libs/freetype2/cid/Jamfile @@ -20,4 +20,4 @@ UseFreeTypeHeaders ; FT2_Library $(FT2_LIB) : $(_sources).c ; } -# end of src/cid Jamfile +# end of src/cid Jamfile diff --git a/src/libs/freetype2/cid/ciderrs.h b/src/libs/freetype2/cid/ciderrs.h index 01813e1898..9972bf6fa4 100644 --- a/src/libs/freetype2/cid/ciderrs.h +++ b/src/libs/freetype2/cid/ciderrs.h @@ -37,4 +37,4 @@ #endif /* __CIDERRS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidgload.c b/src/libs/freetype2/cid/cidgload.c index 9e606742a6..7596a784aa 100644 --- a/src/libs/freetype2/cid/cidgload.c +++ b/src/libs/freetype2/cid/cidgload.c @@ -89,7 +89,7 @@ else -#endif +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ /* For ordinary fonts read the CID font dictionary index */ /* and charstring offset from the CIDMap. */ @@ -162,23 +162,21 @@ face->root.internal->incremental_interface && face->root.internal->incremental_interface->funcs->get_glyph_metrics ) { - FT_Bool found = FALSE; FT_Incremental_MetricsRec metrics; - + metrics.bearing_x = decoder->builder.left_bearing.x; + metrics.bearing_y = decoder->builder.left_bearing.y; + metrics.advance = decoder->builder.advance.x; error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( face->root.internal->incremental_interface->object, - glyph_index, FALSE, &metrics, &found ); - if ( found ) - { - decoder->builder.left_bearing.x = metrics.bearing_x; - decoder->builder.left_bearing.y = metrics.bearing_y; - decoder->builder.advance.x = metrics.advance; - decoder->builder.advance.y = 0; - } + glyph_index, FALSE, &metrics ); + decoder->builder.left_bearing.x = metrics.bearing_x; + decoder->builder.left_bearing.y = metrics.bearing_y; + decoder->builder.advance.x = metrics.advance; + decoder->builder.advance.y = 0; } -#endif +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ Exit: return error; @@ -434,4 +432,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidgload.h b/src/libs/freetype2/cid/cidgload.h index 93858e8650..3bac242582 100644 --- a/src/libs/freetype2/cid/cidgload.h +++ b/src/libs/freetype2/cid/cidgload.h @@ -48,4 +48,4 @@ FT_END_HEADER #endif /* __CIDGLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidload.c b/src/libs/freetype2/cid/cidload.c index 19cfab50ff..febeb9701c 100644 --- a/src/libs/freetype2/cid/cidload.c +++ b/src/libs/freetype2/cid/cidload.c @@ -543,4 +543,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidload.h b/src/libs/freetype2/cid/cidload.h index 8fc577db5e..b92ca7ed29 100644 --- a/src/libs/freetype2/cid/cidload.h +++ b/src/libs/freetype2/cid/cidload.h @@ -54,4 +54,4 @@ FT_END_HEADER #endif /* __CIDLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidobjs.c b/src/libs/freetype2/cid/cidobjs.c index ac5f16e4a9..d8776cb342 100644 --- a/src/libs/freetype2/cid/cidobjs.c +++ b/src/libs/freetype2/cid/cidobjs.c @@ -445,4 +445,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidobjs.h b/src/libs/freetype2/cid/cidobjs.h index 2d72d73e2f..eb2f1d747d 100644 --- a/src/libs/freetype2/cid/cidobjs.h +++ b/src/libs/freetype2/cid/cidobjs.h @@ -155,4 +155,4 @@ FT_END_HEADER #endif /* __CIDOBJS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidparse.c b/src/libs/freetype2/cid/cidparse.c index 397a66ff8f..a3ce61a998 100644 --- a/src/libs/freetype2/cid/cidparse.c +++ b/src/libs/freetype2/cid/cidparse.c @@ -152,4 +152,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidparse.h b/src/libs/freetype2/cid/cidparse.h index 1b3e0b9670..cb97ea0a75 100644 --- a/src/libs/freetype2/cid/cidparse.h +++ b/src/libs/freetype2/cid/cidparse.h @@ -113,4 +113,4 @@ FT_END_HEADER #endif /* __CIDPARSE_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidriver.c b/src/libs/freetype2/cid/cidriver.c index 4d6f442c06..a36e3251de 100644 --- a/src/libs/freetype2/cid/cidriver.c +++ b/src/libs/freetype2/cid/cidriver.c @@ -110,4 +110,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidriver.h b/src/libs/freetype2/cid/cidriver.h index d5a80f6f9f..2327b514e4 100644 --- a/src/libs/freetype2/cid/cidriver.h +++ b/src/libs/freetype2/cid/cidriver.h @@ -36,4 +36,4 @@ FT_END_HEADER #endif /* __CIDRIVER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/cidtoken.h b/src/libs/freetype2/cid/cidtoken.h index f0dac92523..ca08ca0361 100644 --- a/src/libs/freetype2/cid/cidtoken.h +++ b/src/libs/freetype2/cid/cidtoken.h @@ -93,4 +93,4 @@ T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12 ) -/* END */ +/* END */ diff --git a/src/libs/freetype2/cid/descrip.mms b/src/libs/freetype2/cid/descrip.mms index 592fd587a7..a252ad1263 100644 --- a/src/libs/freetype2/cid/descrip.mms +++ b/src/libs/freetype2/cid/descrip.mms @@ -20,4 +20,4 @@ OBJS=type1cid.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/cid/module.mk b/src/libs/freetype2/cid/module.mk index f59d8a9516..a8bd687f4d 100644 --- a/src/libs/freetype2/cid/module.mk +++ b/src/libs/freetype2/cid/module.mk @@ -18,4 +18,4 @@ make_module_list: add_type1cid_driver add_type1cid_driver: $(OPEN_DRIVER)t1cid_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)cid $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/cid/rules.mk b/src/libs/freetype2/cid/rules.mk index 809b20aeb6..bbfff9a03c 100644 --- a/src/libs/freetype2/cid/rules.mk +++ b/src/libs/freetype2/cid/rules.mk @@ -67,4 +67,4 @@ $(OBJ_)%.$O: $(CID_DIR_)%.c $(FREETYPE_H) $(CID_DRV_H) DRV_OBJS_S += $(CID_DRV_OBJ_S) DRV_OBJS_M += $(CID_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/cid/type1cid.c b/src/libs/freetype2/cid/type1cid.c index 0b866e97c4..2897a9614d 100644 --- a/src/libs/freetype2/cid/type1cid.c +++ b/src/libs/freetype2/cid/type1cid.c @@ -26,4 +26,4 @@ #include "cidgload.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/gzip/Jamfile b/src/libs/freetype2/gzip/Jamfile index 4f9db8a4b3..565c02ddc8 100644 --- a/src/libs/freetype2/gzip/Jamfile +++ b/src/libs/freetype2/gzip/Jamfile @@ -7,4 +7,4 @@ UseFreeTypeHeaders ; FT2_Library $(FT2_LIB) : ftgzip.c ; -# end of src/pcf Jamfile +# end of src/pcf Jamfile diff --git a/src/libs/freetype2/gzip/adler32.c b/src/libs/freetype2/gzip/adler32.c index f9b5308c99..09ed8d7e69 100644 --- a/src/libs/freetype2/gzip/adler32.c +++ b/src/libs/freetype2/gzip/adler32.c @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: adler32.c,v 1.1 2002/11/20 19:19:09 bonefish Exp $ */ +/* @(#) $Id: adler32.c,v 1.2 2003/07/24 18:52:52 darkwyrm Exp $ */ #include "zlib.h" @@ -18,10 +18,10 @@ #define DO16(buf) DO8(buf,0); DO8(buf,8); /* ========================================================================= */ -ZEXTERNDEF uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; +ZEXPORT(uLong) adler32( /* adler, buf, len) */ + uLong adler, + const Bytef *buf, + uInt len ) { unsigned long s1 = adler & 0xffff; unsigned long s2 = (adler >> 16) & 0xffff; @@ -45,4 +45,4 @@ ZEXTERNDEF uLong ZEXPORT adler32(adler, buf, len) s2 %= BASE; } return (s2 << 16) | s1; -} +} diff --git a/src/libs/freetype2/gzip/descrip.mms b/src/libs/freetype2/gzip/descrip.mms index 68d7a870d6..f036e6c07f 100644 --- a/src/libs/freetype2/gzip/descrip.mms +++ b/src/libs/freetype2/gzip/descrip.mms @@ -20,4 +20,4 @@ OBJS=ftgzip.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/gzip/ftgzip.c b/src/libs/freetype2/gzip/ftgzip.c index 91c0cd4f9e..f1053c252b 100644 --- a/src/libs/freetype2/gzip/ftgzip.c +++ b/src/libs/freetype2/gzip/ftgzip.c @@ -29,7 +29,7 @@ #ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB -# include "zlib.h" +# include #else /* !SYSTEM_ZLIB */ @@ -96,10 +96,10 @@ #ifndef FT_CONFIG_OPTION_SYSTEM_ZLIB local voidpf - zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; + zcalloc ( /* opaque, items, size) */ + voidpf opaque, + unsigned items, + unsigned size ) { return ft_gzip_alloc( opaque, items, size ); } @@ -177,7 +177,7 @@ (void)FT_STREAM_SKIP( 6 ); /* skip the extra field */ - if ( head[3] && FT_GZIP_EXTRA_FIELD ) + if ( head[3] & FT_GZIP_EXTRA_FIELD ) { FT_UInt len; @@ -187,7 +187,7 @@ } /* skip original file name */ - if ( head[3] && FT_GZIP_ORIG_NAME ) + if ( head[3] & FT_GZIP_ORIG_NAME ) for (;;) { FT_UInt c; @@ -276,6 +276,8 @@ { z_stream* zstream = &zip->zstream; + inflateEnd( zstream ); + /* clear the rest */ zstream->zalloc = NULL; zstream->zfree = NULL; @@ -376,6 +378,7 @@ if ( err == Z_STREAM_END ) { zip->limit = zstream->next_out; + error = FT_Err_Invalid_Stream_Operation; break; } else if ( err != Z_OK ) @@ -558,4 +561,4 @@ return FT_Err_Unimplemented_Feature; } -#endif /* !FT_CONFIG_OPTION_USE_ZLIB */ +#endif /* !FT_CONFIG_OPTION_USE_ZLIB */ diff --git a/src/libs/freetype2/gzip/infblock.c b/src/libs/freetype2/gzip/infblock.c index 423af8178d..123ae1d7a7 100644 --- a/src/libs/freetype2/gzip/infblock.c +++ b/src/libs/freetype2/gzip/infblock.c @@ -64,10 +64,10 @@ local const uInt border[] = { /* Order of the bit length code lengths */ */ -local void inflate_blocks_reset(s, z, c) -inflate_blocks_statef *s; -z_streamp z; -uLongf *c; +local void inflate_blocks_reset( /* s, z, c) */ +inflate_blocks_statef *s, +z_streamp z, +uLongf *c ) { if (c != Z_NULL) *c = s->check; @@ -85,10 +85,10 @@ uLongf *c; } -local inflate_blocks_statef *inflate_blocks_new(z, c, w) -z_streamp z; -check_func c; -uInt w; +local inflate_blocks_statef *inflate_blocks_new( /* z, c, w) */ +z_streamp z, +check_func c, +uInt w ) { inflate_blocks_statef *s; @@ -116,10 +116,10 @@ uInt w; } -local int inflate_blocks(s, z, r) -inflate_blocks_statef *s; -z_streamp z; -int r; +local int inflate_blocks( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) { uInt t; /* temporary storage */ uLong b; /* bit buffer */ @@ -365,12 +365,15 @@ int r; r = Z_STREAM_ERROR; LEAVE } +#ifdef NEED_DUMMY_RETURN + return 0; +#endif } -local int inflate_blocks_free(s, z) -inflate_blocks_statef *s; -z_streamp z; +local int inflate_blocks_free( /* s, z) */ +inflate_blocks_statef *s, +z_streamp z ) { inflate_blocks_reset(s, z, Z_NULL); ZFREE(z, s->window); @@ -380,4 +383,4 @@ z_streamp z; return Z_OK; } - + diff --git a/src/libs/freetype2/gzip/infblock.h b/src/libs/freetype2/gzip/infblock.h index c2535a1e45..3df7322adf 100644 --- a/src/libs/freetype2/gzip/infblock.h +++ b/src/libs/freetype2/gzip/infblock.h @@ -33,4 +33,4 @@ local int inflate_blocks_free OF(( inflate_blocks_statef *, z_streamp)); -#endif /* _INFBLOCK_H */ +#endif /* _INFBLOCK_H */ diff --git a/src/libs/freetype2/gzip/infcodes.c b/src/libs/freetype2/gzip/infcodes.c index 0347fc2a4b..6a36ead7b3 100644 --- a/src/libs/freetype2/gzip/infcodes.c +++ b/src/libs/freetype2/gzip/infcodes.c @@ -55,11 +55,11 @@ struct inflate_codes_state { }; -local inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z) -uInt bl, bd; -inflate_huft *tl; -inflate_huft *td; /* need separate declaration for Borland C++ */ -z_streamp z; +local inflate_codes_statef *inflate_codes_new( /* bl, bd, tl, td, z) */ +uInt bl, uInt bd, +inflate_huft *tl, +inflate_huft *td, /* need separate declaration for Borland C++ */ +z_streamp z ) { inflate_codes_statef *c; @@ -77,10 +77,10 @@ z_streamp z; } -local int inflate_codes(s, z, r) -inflate_blocks_statef *s; -z_streamp z; -int r; +local int inflate_codes( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) { uInt j; /* temporary storage */ inflate_huft *t; /* temporary pointer */ @@ -241,10 +241,10 @@ int r; } -local void inflate_codes_free(c, z) -inflate_codes_statef *c; -z_streamp z; +local void inflate_codes_free( /* c, z) */ +inflate_codes_statef *c, +z_streamp z ) { ZFREE(z, c); Tracev((stderr, "inflate: codes free\n")); -} +} diff --git a/src/libs/freetype2/gzip/infcodes.h b/src/libs/freetype2/gzip/infcodes.h index 154d7f896c..3281491815 100644 --- a/src/libs/freetype2/gzip/infcodes.h +++ b/src/libs/freetype2/gzip/infcodes.h @@ -28,4 +28,4 @@ local void inflate_codes_free OF(( inflate_codes_statef *, z_streamp )); -#endif /* _INFCODES_H */ +#endif /* _INFCODES_H */ diff --git a/src/libs/freetype2/gzip/inffixed.h b/src/libs/freetype2/gzip/inffixed.h index 77f7e76314..64e757c238 100644 --- a/src/libs/freetype2/gzip/inffixed.h +++ b/src/libs/freetype2/gzip/inffixed.h @@ -148,4 +148,4 @@ local inflate_huft fixed_td[] = { {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} - }; + }; diff --git a/src/libs/freetype2/gzip/inflate.c b/src/libs/freetype2/gzip/inflate.c index 72b01a925c..01029767eb 100644 --- a/src/libs/freetype2/gzip/inflate.c +++ b/src/libs/freetype2/gzip/inflate.c @@ -51,8 +51,8 @@ struct internal_state { }; -int ZEXPORT inflateReset(z) -z_streamp z; +ZEXPORT(int) inflateReset( /* z) */ +z_streamp z ) { if (z == Z_NULL || z->state == Z_NULL) return Z_STREAM_ERROR; @@ -65,8 +65,8 @@ z_streamp z; } -int ZEXPORT inflateEnd(z) -z_streamp z; +ZEXPORT(int) inflateEnd( /* z) */ +z_streamp z ) { if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL) return Z_STREAM_ERROR; @@ -79,11 +79,11 @@ z_streamp z; } -int ZEXPORT inflateInit2_(z, w, version, stream_size) -z_streamp z; -int w; -const char *version; -int stream_size; +ZEXPORT(int) inflateInit2_( /* z, w, version, stream_size) */ +z_streamp z, +int w, +const char *version, +int stream_size ) { if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || stream_size != sizeof(z_stream)) @@ -144,9 +144,9 @@ int stream_size; #define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) -int ZEXPORT inflate(z, f) -z_streamp z; -int f; +ZEXPORT(int) inflate( /* z, f) */ +z_streamp z, +int f ) { int r; uInt b; @@ -270,4 +270,4 @@ int f; return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ #endif } - + diff --git a/src/libs/freetype2/gzip/inftrees.c b/src/libs/freetype2/gzip/inftrees.c index ec57d39eda..d394d6202d 100644 --- a/src/libs/freetype2/gzip/inftrees.c +++ b/src/libs/freetype2/gzip/inftrees.c @@ -10,8 +10,11 @@ # define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */ #endif + +#if 0 local const char inflate_copyright[] = " inflate 1.1.4 Copyright 1995-2002 Mark Adler "; +#endif /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -89,21 +92,22 @@ local const uInt cpdext[30] = { /* Extra bits for distance codes */ /* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ #define BMAX 15 /* maximum bit length of any code */ -local int huft_build(b, n, s, d, e, t, m, hp, hn, v) -uIntf *b; /* code lengths in bits (all assumed <= BMAX) */ -uInt n; /* number of codes (assumed <= 288) */ -uInt s; /* number of simple-valued codes (0..s-1) */ -const uIntf *d; /* list of base values for non-simple codes */ -const uIntf *e; /* list of extra bits for non-simple codes */ -inflate_huft * FAR *t; /* result: starting table */ -uIntf *m; /* maximum lookup bits, returns actual */ -inflate_huft *hp; /* space for trees */ -uInt *hn; /* hufts used in space */ -uIntf *v; /* working area: values in order of bit length */ +local int huft_build( /* b, n, s, d, e, t, m, hp, hn, v) */ +uIntf *b, /* code lengths in bits (all assumed <= BMAX) */ +uInt n, /* number of codes (assumed <= 288) */ +uInt s, /* number of simple-valued codes (0..s-1) */ +const uIntf *d, /* list of base values for non-simple codes */ +const uIntf *e, /* list of extra bits for non-simple codes */ +inflate_huft * FAR *t, /* result: starting table */ +uIntf *m, /* maximum lookup bits, returns actual */ +inflate_huft *hp, /* space for trees */ +uInt *hn, /* hufts used in space */ +uIntf *v /* working area: values in order of bit length */ /* Given a list of code lengths and a maximum table size, make a set of tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR if the given code set is incomplete (the tables are still built in this case), or Z_DATA_ERROR if the input is invalid. */ +) { uInt a; /* counter for codes of length k */ @@ -289,12 +293,13 @@ uIntf *v; /* working area: values in order of bit length */ } -local int inflate_trees_bits(c, bb, tb, hp, z) -uIntf *c; /* 19 code lengths */ -uIntf *bb; /* bits tree desired/actual depth */ -inflate_huft * FAR *tb; /* bits tree result */ -inflate_huft *hp; /* space for trees */ -z_streamp z; /* for messages */ +local int inflate_trees_bits( /* c, bb, tb, hp, z) */ +uIntf *c, /* 19 code lengths */ +uIntf *bb, /* bits tree desired/actual depth */ +inflate_huft * FAR *tb, /* bits tree result */ +inflate_huft *hp, /* space for trees */ +z_streamp z /* for messages */ +) { int r; uInt hn = 0; /* hufts used in space */ @@ -316,16 +321,17 @@ z_streamp z; /* for messages */ } -local int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z) -uInt nl; /* number of literal/length codes */ -uInt nd; /* number of distance codes */ -uIntf *c; /* that many (total) code lengths */ -uIntf *bl; /* literal desired/actual bit depth */ -uIntf *bd; /* distance desired/actual bit depth */ -inflate_huft * FAR *tl; /* literal/length tree result */ -inflate_huft * FAR *td; /* distance tree result */ -inflate_huft *hp; /* space for trees */ -z_streamp z; /* for messages */ +local int inflate_trees_dynamic( /* nl, nd, c, bl, bd, tl, td, hp, z) */ +uInt nl, /* number of literal/length codes */ +uInt nd, /* number of distance codes */ +uIntf *c, /* that many (total) code lengths */ +uIntf *bl, /* literal desired/actual bit depth */ +uIntf *bd, /* distance desired/actual bit depth */ +inflate_huft * FAR *tl, /* literal/length tree result */ +inflate_huft * FAR *td, /* distance tree result */ +inflate_huft *hp, /* space for trees */ +z_streamp z /* for messages */ +) { int r; uInt hn = 0; /* hufts used in space */ @@ -394,12 +400,13 @@ local inflate_huft *fixed_td; #endif -local int inflate_trees_fixed(bl, bd, tl, td, z) -uIntf *bl; /* literal desired/actual bit depth */ -uIntf *bd; /* distance desired/actual bit depth */ -inflate_huft * FAR *tl; /* literal/length tree result */ -inflate_huft * FAR *td; /* distance tree result */ -z_streamp z; /* for memory allocation */ +local int inflate_trees_fixed( /* bl, bd, tl, td, z) */ +uIntf *bl, /* literal desired/actual bit depth */ +uIntf *bd, /* distance desired/actual bit depth */ +inflate_huft * FAR *tl, /* literal/length tree result */ +inflate_huft * FAR *td, /* distance tree result */ +z_streamp z /* for memory allocation */ +) { #ifdef BUILDFIXED /* build fixed tables if not already */ @@ -450,4 +457,4 @@ z_streamp z; /* for memory allocation */ *tl = fixed_tl; *td = fixed_td; return Z_OK; -} +} diff --git a/src/libs/freetype2/gzip/inftrees.h b/src/libs/freetype2/gzip/inftrees.h index 92d2f284ef..e59619652f 100644 --- a/src/libs/freetype2/gzip/inftrees.h +++ b/src/libs/freetype2/gzip/inftrees.h @@ -60,4 +60,4 @@ local int inflate_trees_fixed OF(( inflate_huft * FAR *, /* distance tree result */ z_streamp)); /* for memory allocation */ -#endif /* _INFTREES_H */ +#endif /* _INFTREES_H */ diff --git a/src/libs/freetype2/gzip/infutil.c b/src/libs/freetype2/gzip/infutil.c index 9a6b92fca2..3c7bfec80c 100644 --- a/src/libs/freetype2/gzip/infutil.c +++ b/src/libs/freetype2/gzip/infutil.c @@ -19,10 +19,10 @@ local uInt inflate_mask[17] = { /* copy as much as possible from the sliding window to the output area */ -local int inflate_flush(s, z, r) -inflate_blocks_statef *s; -z_streamp z; -int r; +local int inflate_flush( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) { uInt n; Bytef *p; @@ -83,4 +83,4 @@ int r; /* done */ return r; -} +} diff --git a/src/libs/freetype2/gzip/infutil.h b/src/libs/freetype2/gzip/infutil.h index 820dcd3271..db9abac5e5 100644 --- a/src/libs/freetype2/gzip/infutil.h +++ b/src/libs/freetype2/gzip/infutil.h @@ -93,4 +93,4 @@ local int inflate_flush OF(( z_streamp , int)); -#endif +#endif diff --git a/src/libs/freetype2/gzip/rules.mk b/src/libs/freetype2/gzip/rules.mk index a092ce71d3..da7fa4d2f9 100644 --- a/src/libs/freetype2/gzip/rules.mk +++ b/src/libs/freetype2/gzip/rules.mk @@ -21,7 +21,11 @@ GZIP_DIR_ := $(GZIP_DIR)$(SEP) # compilation flags for the driver # -GZIP_COMPILE := $(FT_COMPILE) $I$(GZIP_DIR) +ifeq ($(SYSTEM_ZLIB),) + GZIP_COMPILE := $(FT_COMPILE) $I$(GZIP_DIR) +else + GZIP_COMPILE := $(FT_COMPILE) +endif # gzip support sources (i.e., C files) @@ -30,15 +34,19 @@ GZIP_DRV_SRC := $(GZIP_DIR_)ftgzip.c # gzip support headers # -GZIP_DRV_H := +GZIP_DRV_H := -# Pfr driver object(s) +# gzip driver object(s) # # GZIP_DRV_OBJ_M is used during `multi' builds # GZIP_DRV_OBJ_S is used during `single' builds # -GZIP_DRV_OBJ_M := $(GZIP_DRV_SRC:$(GZIP_DIR_)%.c=$(OBJ_)%.$O) +ifeq ($(SYSTEM_ZLIB),) + GZIP_DRV_OBJ_M := $(GZIP_DRV_SRC:$(GZIP_DIR_)%.c=$(OBJ_)%.$O) +else + GZIP_DRV_OBJ_M := $(OBJ_)ftgzip.$O +endif GZIP_DRV_OBJ_S := $(OBJ_)ftgzip.$O # gzip support source file for single build @@ -63,4 +71,4 @@ $(OBJ_)%.$O: $(GZIP_DIR_)%.c $(FREETYPE_H) $(GZIP_DRV_H) DRV_OBJS_S += $(GZIP_DRV_OBJ_S) DRV_OBJS_M += $(GZIP_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/gzip/zconf.h b/src/libs/freetype2/gzip/zconf.h index bb757cccbe..5728fca4af 100644 --- a/src/libs/freetype2/gzip/zconf.h +++ b/src/libs/freetype2/gzip/zconf.h @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: zconf.h,v 1.1 2002/11/20 19:19:16 bonefish Exp $ */ +/* @(#) $Id: zconf.h,v 1.2 2003/07/24 18:52:52 darkwyrm Exp $ */ #ifndef _ZCONF_H #define _ZCONF_H @@ -91,11 +91,14 @@ # define NO_DUMMY_DECL #endif -/* Old Borland C incorrectly complains about missing returns: */ +/* Old Borland C and LCC incorrectly complains about missing returns: */ #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) # define NEED_DUMMY_RETURN #endif +#if defined(__LCC__) +# define NEED_DUMMY_RETURN +#endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL @@ -167,22 +170,22 @@ # undef FAR # endif # include -# define ZEXPORT WINAPI +# define ZEXPORT(x) x WINAPI # ifdef WIN32 -# define ZEXPORTVA WINAPIV +# define ZEXPORTVA(x) x WINAPIV # else -# define ZEXPORTVA FAR _cdecl _export +# define ZEXPORTVA(x) x FAR _cdecl _export # endif # endif # if defined (__BORLANDC__) # if (__BORLANDC__ >= 0x0500) && defined (WIN32) # include -# define ZEXPORT __declspec(dllexport) WINAPI -# define ZEXPORTRVA __declspec(dllexport) WINAPIV +# define ZEXPORT(x) x __declspec(dllexport) WINAPI +# define ZEXPORTRVA(x) x __declspec(dllexport) WINAPIV # else # if defined (_Windows) && defined (__DLL__) -# define ZEXPORT _export -# define ZEXPORTVA _export +# define ZEXPORT(x) x _export +# define ZEXPORTVA(x) x _export # endif # endif # endif @@ -190,16 +193,16 @@ #ifndef ZEXPORT -# define ZEXPORT +# define ZEXPORT(x) static x #endif #ifndef ZEXPORTVA -# define ZEXPORTVA +# define ZEXPORTVA(x) static x #endif #ifndef ZEXTERN -# define ZEXTERN static +# define ZEXTERN(x) static x #endif #ifndef ZEXTERNDEF -# define ZEXTERNDEF static +# define ZEXTERNDEF(x) static x #endif #ifndef FAR @@ -272,4 +275,4 @@ typedef uLong FAR uLongf; # pragma map(inflate_trees_free,"INTRFR") #endif -#endif /* _ZCONF_H */ +#endif /* _ZCONF_H */ diff --git a/src/libs/freetype2/gzip/zlib.h b/src/libs/freetype2/gzip/zlib.h index e0c899b894..f7fa65cf9e 100644 --- a/src/libs/freetype2/gzip/zlib.h +++ b/src/libs/freetype2/gzip/zlib.h @@ -173,7 +173,7 @@ typedef z_stream FAR *z_streamp; */ /* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); +ZEXTERN(int) deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. @@ -286,7 +286,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); /* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); +ZEXTERN(int) inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by @@ -306,7 +306,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); */ -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +ZEXTERN(int) inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may some @@ -375,7 +375,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); */ -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +ZEXTERN(int) inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any @@ -393,7 +393,7 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); */ /* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, +ZEXTERN(int) deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, @@ -514,7 +514,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, */ /* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, +ZEXTERN(int) inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with an extra parameter. The @@ -566,7 +566,7 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, until success or end of the input data. */ -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +ZEXTERN(int) inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. @@ -772,7 +772,7 @@ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); compression library. */ -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +ZEXTERN(uLong) adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and @@ -810,7 +810,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, +ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) @@ -827,4 +827,4 @@ ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, } #endif -#endif /* _ZLIB_H */ +#endif /* _ZLIB_H */ diff --git a/src/libs/freetype2/gzip/zutil.c b/src/libs/freetype2/gzip/zutil.c index a42a339ba4..e1f419ea61 100644 --- a/src/libs/freetype2/gzip/zutil.c +++ b/src/libs/freetype2/gzip/zutil.c @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: zutil.c,v 1.1 2002/11/20 19:19:19 bonefish Exp $ */ +/* @(#) $Id: zutil.c,v 1.2 2003/07/24 18:52:52 darkwyrm Exp $ */ #include "zutil.h" @@ -178,4 +178,4 @@ void zcfree (opaque, ptr) if (opaque) return; /* make compiler happy */ } -#endif /* MY_ZCALLOC */ +#endif /* MY_ZCALLOC */ diff --git a/src/libs/freetype2/gzip/zutil.h b/src/libs/freetype2/gzip/zutil.h index eed2424cb7..ca77c25ac3 100644 --- a/src/libs/freetype2/gzip/zutil.h +++ b/src/libs/freetype2/gzip/zutil.h @@ -8,7 +8,7 @@ subject to change. Applications should only use zlib.h. */ -/* @(#) $Id: zutil.h,v 1.1 2002/11/20 19:19:20 bonefish Exp $ */ +/* @(#) $Id: zutil.h,v 1.2 2003/07/24 18:52:52 darkwyrm Exp $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H @@ -203,7 +203,7 @@ typedef unsigned long ulg; #endif -typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, +typedef uLong (*check_func) OF((uLong check, const Bytef *buf, uInt len)); local voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); local void zcfree OF((voidpf opaque, voidpf ptr)); @@ -213,4 +213,4 @@ local void zcfree OF((voidpf opaque, voidpf ptr)); #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} -#endif /* _Z_UTIL_H */ +#endif /* _Z_UTIL_H */ diff --git a/src/libs/freetype2/otlayout/otlayout.h b/src/libs/freetype2/otlayout/otlayout.h index 2cd67f568f..1afe9c7985 100644 --- a/src/libs/freetype2/otlayout/otlayout.h +++ b/src/libs/freetype2/otlayout/otlayout.h @@ -202,4 +202,4 @@ OTL_BEGIN_HEADER OTL_END_HEADER -#endif /* __OPENTYPE_LAYOUT_H__ */ +#endif /* __OPENTYPE_LAYOUT_H__ */ diff --git a/src/libs/freetype2/otlayout/otlbase.h b/src/libs/freetype2/otlayout/otlbase.h index 563d3002d0..d00fa682ea 100644 --- a/src/libs/freetype2/otlayout/otlbase.h +++ b/src/libs/freetype2/otlayout/otlbase.h @@ -11,4 +11,4 @@ OTL_BEGIN_HEADER OTL_END_HEADER -#endif /* __OTL_BASE_H__ */ +#endif /* __OTL_BASE_H__ */ diff --git a/src/libs/freetype2/otlayout/otlcommn.c b/src/libs/freetype2/otlayout/otlcommn.c index 742ff5b36e..9d648367f7 100644 --- a/src/libs/freetype2/otlayout/otlcommn.c +++ b/src/libs/freetype2/otlayout/otlcommn.c @@ -937,4 +937,4 @@ type_count, type_funcs, valid ); } -/* END */ +/* END */ diff --git a/src/libs/freetype2/otlayout/otlcommn.h b/src/libs/freetype2/otlayout/otlcommn.h index 25914fb9f7..31c624a5ac 100644 --- a/src/libs/freetype2/otlayout/otlcommn.h +++ b/src/libs/freetype2/otlayout/otlcommn.h @@ -274,4 +274,4 @@ OTL_END_HEADER #endif /* __OTLCOMMN_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/otlayout/otlconf.h b/src/libs/freetype2/otlayout/otlconf.h index 3ef17a0799..1ba60cb2e2 100644 --- a/src/libs/freetype2/otlayout/otlconf.h +++ b/src/libs/freetype2/otlayout/otlconf.h @@ -75,4 +75,4 @@ /* */ -#endif /* __OT_LAYOUT_CONFIG_H__ */ +#endif /* __OT_LAYOUT_CONFIG_H__ */ diff --git a/src/libs/freetype2/otlayout/otlgdef.c b/src/libs/freetype2/otlayout/otlgdef.c index ff1c2a1e86..6c5a163a2d 100644 --- a/src/libs/freetype2/otlayout/otlgdef.c +++ b/src/libs/freetype2/otlayout/otlgdef.c @@ -172,4 +172,4 @@ /* validate mark attach class */ otl_class_definition_validate( table + OTL_NEXT_USHORT( p ) ); } - + diff --git a/src/libs/freetype2/otlayout/otlgdef.h b/src/libs/freetype2/otlayout/otlgdef.h index 5046cc4364..db81aa216f 100644 --- a/src/libs/freetype2/otlayout/otlgdef.h +++ b/src/libs/freetype2/otlayout/otlgdef.h @@ -11,4 +11,4 @@ OTL_BEGIN_HEADER OTL_END_HEADER -#endif /* __OTL_GDEF_H__ */ +#endif /* __OTL_GDEF_H__ */ diff --git a/src/libs/freetype2/otlayout/otlgpos.h b/src/libs/freetype2/otlayout/otlgpos.h index 1d10cab495..b079d9909c 100644 --- a/src/libs/freetype2/otlayout/otlgpos.h +++ b/src/libs/freetype2/otlayout/otlgpos.h @@ -11,4 +11,4 @@ OTL_BEGIN_HEADER OTL_END_HEADER -#endif /* __OTL_GPOS_H__ */ +#endif /* __OTL_GPOS_H__ */ diff --git a/src/libs/freetype2/otlayout/otlgsub.c b/src/libs/freetype2/otlayout/otlgsub.c index 817760a7c8..aa720d34a8 100644 --- a/src/libs/freetype2/otlayout/otlgsub.c +++ b/src/libs/freetype2/otlayout/otlgsub.c @@ -864,4 +864,4 @@ otl_lookup_list_validate( table + lookups, 7, otl_gsub_validate_funcs, valid ); - } + } diff --git a/src/libs/freetype2/otlayout/otlgsub.h b/src/libs/freetype2/otlayout/otlgsub.h index db5edecf12..f097d3b534 100644 --- a/src/libs/freetype2/otlayout/otlgsub.h +++ b/src/libs/freetype2/otlayout/otlgsub.h @@ -23,4 +23,4 @@ OTL_BEGIN_HEADER OTL_END_HEADER -#endif /* __OTL_GSUB_H__ */ +#endif /* __OTL_GSUB_H__ */ diff --git a/src/libs/freetype2/otlayout/otlparse.c b/src/libs/freetype2/otlayout/otlparse.c index 705c0c60fa..caa8f5b564 100644 --- a/src/libs/freetype2/otlayout/otlparse.c +++ b/src/libs/freetype2/otlayout/otlparse.c @@ -139,4 +139,4 @@ } - + diff --git a/src/libs/freetype2/otlayout/otlparse.h b/src/libs/freetype2/otlayout/otlparse.h index 92f34bfdc2..adaa0634de 100644 --- a/src/libs/freetype2/otlayout/otlparse.h +++ b/src/libs/freetype2/otlayout/otlparse.h @@ -96,4 +96,4 @@ OTL_BEGIN_HEADER OTL_END_HEADER #endif /* __OTL_PARSER_H__ */ - + diff --git a/src/libs/freetype2/otlayout/otltable.h b/src/libs/freetype2/otlayout/otltable.h index af7bd78a58..0441e15766 100644 --- a/src/libs/freetype2/otlayout/otltable.h +++ b/src/libs/freetype2/otlayout/otltable.h @@ -57,4 +57,4 @@ OTL_BEGIN_HEADER OTL_END_HEADER -#endif /* __OTL_TABLE_H__ */ +#endif /* __OTL_TABLE_H__ */ diff --git a/src/libs/freetype2/otlayout/otltags.h b/src/libs/freetype2/otlayout/otltags.h index a667682190..236bb9f1c8 100644 --- a/src/libs/freetype2/otlayout/otltags.h +++ b/src/libs/freetype2/otlayout/otltags.h @@ -19,10 +19,12 @@ OTL_SCRIPT_TAG( 'a','r','m','n', "Armenian", ARMENIAN ) OTL_SCRIPT_TAG( 'b','e','n','g', "Bengali", BENGALI ) OTL_SCRIPT_TAG( 'b','o','p','o', "Bopomofo", BOPOMOFO ) OTL_SCRIPT_TAG( 'b','r','a','i', "Braille", BRAILLE ) +OTL_SCRIPT_TAG( 'b','y','z','m', "Byzantine Music", BYZANTINE_MUSIC ) OTL_SCRIPT_TAG( 'c','a','n','s', "Canadian Syllabic", CANADIAN ) OTL_SCRIPT_TAG( 'c','h','e','r', "Cherokee", CHEROKEE ) OTL_SCRIPT_TAG( 'h','a','n','i', "CJK Ideographic", CJK ) OTL_SCRIPT_TAG( 'c','y','r','l', "Cyrillic", CYRILLIC ) +OTL_SCRIPT_TAG( 'd','f','l','t', "Default", DEFAULT ) OTL_SCRIPT_TAG( 'd','e','v','a', "Devanagari", DEVANAGARI ) OTL_SCRIPT_TAG( 'e','t','h','i', "Ethiopic", ETHIOPIC ) OTL_SCRIPT_TAG( 'g','e','o','r', "Georgian", GEORGIAN ) @@ -32,9 +34,9 @@ OTL_SCRIPT_TAG( 'g','u','r','u', "Gurmukhi", GURMUKHI ) OTL_SCRIPT_TAG( 'j','a','m','o', "Hangul Jamo", JAMO ) OTL_SCRIPT_TAG( 'h','a','n','g', "Hangul", HANGUL ) OTL_SCRIPT_TAG( 'h','e','b','r', "Hebrew", HEBREW ) -OTL_SCRIPT_TAG( 'h','i','r','a', "Hiragana", HIRAGANA ) +OTL_SCRIPT_TAG( 'h','i','r','a', "Hiragana", HIRAGANA ) /* not in TAGS.txt */ OTL_SCRIPT_TAG( 'k','n','d','a', "Kannada", KANNADA ) -OTL_SCRIPT_TAG( 'k','a','n','a', "Katakana", KATAKANA ) +OTL_SCRIPT_TAG( 'k','a','n','a', "Katakana", KATAKANA ) /* in TAGS.txt, means Hiragana _and_ Katakana */ OTL_SCRIPT_TAG( 'k','h','m','r', "Khmer", KHMER ) OTL_SCRIPT_TAG( 'l','a','o',' ', "Lao", LAO ) OTL_SCRIPT_TAG( 'l','a','t','n', "Latin", LATIN ) @@ -83,4 +85,4 @@ OTL_SCRIPT_TAG( 'y','i',' ',' ', "Yi", YI ) #endif #undef OTL_FEATURE_TAG - + diff --git a/src/libs/freetype2/otlayout/otlutils.h b/src/libs/freetype2/otlayout/otlutils.h index de50f66f07..6341accf29 100644 --- a/src/libs/freetype2/otlayout/otlutils.h +++ b/src/libs/freetype2/otlayout/otlutils.h @@ -30,4 +30,4 @@ OTL_BEGIN_HEADER OTL_END_HEADER -#endif /* __OTLAYOUT_UTILS_H__ */ +#endif /* __OTLAYOUT_UTILS_H__ */ diff --git a/src/libs/freetype2/pcf/Jamfile b/src/libs/freetype2/pcf/Jamfile index d45389c814..b126fa526f 100644 --- a/src/libs/freetype2/pcf/Jamfile +++ b/src/libs/freetype2/pcf/Jamfile @@ -20,4 +20,4 @@ UseFreeTypeHeaders ; FT2_Library $(FT2_LIB) : $(_sources).c ; } -# end of src/pcf Jamfile +# end of src/pcf Jamfile diff --git a/src/libs/freetype2/pcf/descrip.mms b/src/libs/freetype2/pcf/descrip.mms index a3fd23180f..164b669f3a 100644 --- a/src/libs/freetype2/pcf/descrip.mms +++ b/src/libs/freetype2/pcf/descrip.mms @@ -32,4 +32,4 @@ OBJS=pcf.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/pcf/module.mk b/src/libs/freetype2/pcf/module.mk index 614c319208..2bb6f8faef 100644 --- a/src/libs/freetype2/pcf/module.mk +++ b/src/libs/freetype2/pcf/module.mk @@ -29,4 +29,4 @@ add_pcf_driver: $(OPEN_DRIVER)pcf_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)pcf $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/pcf/pcf.c b/src/libs/freetype2/pcf/pcf.c index 315655e56c..a43f363458 100644 --- a/src/libs/freetype2/pcf/pcf.c +++ b/src/libs/freetype2/pcf/pcf.c @@ -33,4 +33,4 @@ THE SOFTWARE. #include "pcfread.c" #include "pcfdriver.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/pcf/pcf.h b/src/libs/freetype2/pcf/pcf.h index 949d1b8aaa..3745623826 100644 --- a/src/libs/freetype2/pcf/pcf.h +++ b/src/libs/freetype2/pcf/pcf.h @@ -229,10 +229,9 @@ FT_BEGIN_HEADER pcf_load_font( FT_Stream, PCF_Face ); - FT_END_HEADER #endif /* __PCF_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pcf/pcfdriver.c b/src/libs/freetype2/pcf/pcfdriver.c index e995b8eef0..480eb833b9 100644 --- a/src/libs/freetype2/pcf/pcfdriver.c +++ b/src/libs/freetype2/pcf/pcfdriver.c @@ -32,10 +32,12 @@ THE SOFTWARE. #include FT_INTERNAL_OBJECTS_H #include FT_GZIP_H #include FT_ERRORS_H +#include FT_BDF_H #include "pcf.h" #include "pcfdriver.h" #include "pcfutil.h" +#include "pcfread.h" #include "pcferror.h" @@ -353,7 +355,6 @@ THE SOFTWARE. PCF_Face face = (PCF_Face)FT_SIZE_FACE( size ); FT_Stream stream = face->root.stream; FT_Error error = PCF_Err_Ok; - FT_Memory memory = FT_FACE( face )->memory; FT_Bitmap* bitmap = &slot->bitmap; PCF_Metric metric; int bytes; @@ -409,7 +410,8 @@ THE SOFTWARE. /* XXX: to do: are there cases that need repadding the bitmap? */ bytes = bitmap->pitch * bitmap->rows; - if ( FT_ALLOC( bitmap->buffer, bytes ) ) + error = ft_glyphslot_alloc_bitmap( slot, bytes ); + if ( error ) goto Exit; if ( FT_STREAM_SEEK( metric->bits ) || @@ -449,7 +451,6 @@ THE SOFTWARE. slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16; slot->format = FT_GLYPH_FORMAT_BITMAP; - slot->flags = FT_GLYPH_OWN_BITMAP; FT_TRACE4(( " --- ok\n" )); @@ -458,6 +459,49 @@ THE SOFTWARE. } + static FT_Error + pcf_get_bdf_property( PCF_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ) + { + PCF_Property prop; + + prop = pcf_find_property( face, prop_name ); + if ( prop != NULL ) + { + if ( prop->isString ) + { + aproperty->type = BDF_PROPERTY_TYPE_ATOM; + aproperty->u.atom = prop->value.atom; + } + else + { + /* apparently, the PCF driver loads all properties as signed integers ! + * this really doesn't seem to be a problem, because this is + * sufficient for any meaningful values + */ + aproperty->type = BDF_PROPERTY_TYPE_INTEGER; + aproperty->u.integer = prop->value.integer; + } + return 0; + } + return FT_Err_Invalid_Argument; + } + + + static FT_Module_Interface + pcf_driver_requester( FT_Module module, + const char* name ) + { + FT_UNUSED( module ); + + if ( name && ft_strcmp( name, "get_bdf_property" ) == 0 ) + return (FT_Module_Interface) pcf_get_bdf_property; + + return NULL; + } + + FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec pcf_driver_class = { @@ -473,7 +517,7 @@ THE SOFTWARE. (FT_Module_Constructor)0, (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 + (FT_Module_Requester) pcf_driver_requester }, sizeof( PCF_FaceRec ), @@ -498,4 +542,4 @@ THE SOFTWARE. }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/pcf/pcfdriver.h b/src/libs/freetype2/pcf/pcfdriver.h index 7c45b91811..a4c8289db6 100644 --- a/src/libs/freetype2/pcf/pcfdriver.h +++ b/src/libs/freetype2/pcf/pcfdriver.h @@ -41,4 +41,4 @@ FT_END_HEADER #endif /* __PCFDRIVER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pcf/pcferror.h b/src/libs/freetype2/pcf/pcferror.h index d75c067aa6..486b121996 100644 --- a/src/libs/freetype2/pcf/pcferror.h +++ b/src/libs/freetype2/pcf/pcferror.h @@ -37,4 +37,4 @@ #endif /* __PCFERROR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pcf/pcfread.c b/src/libs/freetype2/pcf/pcfread.c index 6a1a8a2968..afbf272ecb 100644 --- a/src/libs/freetype2/pcf/pcfread.c +++ b/src/libs/freetype2/pcf/pcfread.c @@ -33,6 +33,7 @@ THE SOFTWARE. #include "pcf.h" #include "pcfdriver.h" +#include "pcfread.h" #include "pcferror.h" @@ -316,7 +317,7 @@ THE SOFTWARE. }; - static PCF_Property + FT_LOCAL_DEF( PCF_Property ) pcf_find_property( PCF_Face face, const FT_String* prop ) { @@ -1054,4 +1055,4 @@ THE SOFTWARE. } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pcf/pcfutil.c b/src/libs/freetype2/pcf/pcfutil.c index eb911bbd29..a477cb8bcd 100644 --- a/src/libs/freetype2/pcf/pcfutil.c +++ b/src/libs/freetype2/pcf/pcfutil.c @@ -212,4 +212,4 @@ in this Software without prior written authorization from The Open Group. } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pcf/pcfutil.h b/src/libs/freetype2/pcf/pcfutil.h index 32dd1eab76..dca88c6a1e 100644 --- a/src/libs/freetype2/pcf/pcfutil.h +++ b/src/libs/freetype2/pcf/pcfutil.h @@ -55,4 +55,4 @@ THE SOFTWARE. #endif /* __PCFUTIL_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pcf/readme b/src/libs/freetype2/pcf/readme index 75f49e1427..e1a5372119 100644 --- a/src/libs/freetype2/pcf/readme +++ b/src/libs/freetype2/pcf/readme @@ -111,4 +111,4 @@ Credits Keith Packard wrote the pcf driver found in XFree86. His work is at the same time the specification and the sample implementation of the -PCF format. Undoubtedly, this driver is inspired from his work. +PCF format. Undoubtedly, this driver is inspired from his work. diff --git a/src/libs/freetype2/pcf/rules.mk b/src/libs/freetype2/pcf/rules.mk index 141f1b7442..c993a1986a 100644 --- a/src/libs/freetype2/pcf/rules.mk +++ b/src/libs/freetype2/pcf/rules.mk @@ -77,4 +77,4 @@ $(OBJ_)%.$O: $(PCF_DIR_)%.c $(FREETYPE_H) $(PCF_DRV_H) DRV_OBJS_S += $(PCF_DRV_OBJ_S) DRV_OBJS_M += $(PCF_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/pfr/descrip.mms b/src/libs/freetype2/pfr/descrip.mms index 75178d0eff..0c0a8550b9 100644 --- a/src/libs/freetype2/pfr/descrip.mms +++ b/src/libs/freetype2/pfr/descrip.mms @@ -20,4 +20,4 @@ OBJS=pfr.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/pfr/module.mk b/src/libs/freetype2/pfr/module.mk index 3da0d5a3c7..eb6cff2c40 100644 --- a/src/libs/freetype2/pfr/module.mk +++ b/src/libs/freetype2/pfr/module.mk @@ -19,4 +19,4 @@ add_pfr_driver: $(OPEN_DRIVER)pfr_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)pfr $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/pfr/pfr.c b/src/libs/freetype2/pfr/pfr.c index eb2c4edb7e..2dbf2983b9 100644 --- a/src/libs/freetype2/pfr/pfr.c +++ b/src/libs/freetype2/pfr/pfr.c @@ -26,4 +26,4 @@ #include "pfrdrivr.c" #include "pfrsbit.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrcmap.c b/src/libs/freetype2/pfr/pfrcmap.c index de6c5a07cf..804da8f343 100644 --- a/src/libs/freetype2/pfr/pfrcmap.c +++ b/src/libs/freetype2/pfr/pfrcmap.c @@ -155,4 +155,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrcmap.h b/src/libs/freetype2/pfr/pfrcmap.h index d77813e3c8..035fc05438 100644 --- a/src/libs/freetype2/pfr/pfrcmap.h +++ b/src/libs/freetype2/pfr/pfrcmap.h @@ -43,4 +43,4 @@ FT_END_HEADER #endif /* __PFRCMAP_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrdrivr.c b/src/libs/freetype2/pfr/pfrdrivr.c index 07ba9b4cd3..e4ef2ca3c5 100644 --- a/src/libs/freetype2/pfr/pfrdrivr.c +++ b/src/libs/freetype2/pfr/pfrdrivr.c @@ -165,4 +165,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrdrivr.h b/src/libs/freetype2/pfr/pfrdrivr.h index 36f1205b77..70cd05adb0 100644 --- a/src/libs/freetype2/pfr/pfrdrivr.h +++ b/src/libs/freetype2/pfr/pfrdrivr.h @@ -36,4 +36,4 @@ FT_END_HEADER #endif /* __PFRDRIVR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrerror.h b/src/libs/freetype2/pfr/pfrerror.h index 2e1c401dd2..bd4e57f30d 100644 --- a/src/libs/freetype2/pfr/pfrerror.h +++ b/src/libs/freetype2/pfr/pfrerror.h @@ -37,4 +37,4 @@ #endif /* __PFRERROR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrgload.c b/src/libs/freetype2/pfr/pfrgload.c index cb5c60b88e..4f01260b26 100644 --- a/src/libs/freetype2/pfr/pfrgload.c +++ b/src/libs/freetype2/pfr/pfrgload.c @@ -798,4 +798,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrgload.h b/src/libs/freetype2/pfr/pfrgload.h index 7cc7a8702a..5ee2ac1f42 100644 --- a/src/libs/freetype2/pfr/pfrgload.h +++ b/src/libs/freetype2/pfr/pfrgload.h @@ -46,4 +46,4 @@ FT_END_HEADER #endif /* __PFRGLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrload.c b/src/libs/freetype2/pfr/pfrload.c index 0cb32f4cfa..f32d1f9711 100644 --- a/src/libs/freetype2/pfr/pfrload.c +++ b/src/libs/freetype2/pfr/pfrload.c @@ -432,7 +432,16 @@ } - /* load font ID, i.e. name */ + /* load font ID, this is a so-called "unique" name that is rather + * long and descriptive (like "Tiresias ScreenFont v7.51"). + * + * note that a PFR font's family name is contained in an *undocumented* + * string of the "auxiliary data" portion of a physical font record. this + * may also contain the "real" style name ! + * + * if no family name is present, the font id is used instead for the + * family + */ FT_CALLBACK_DEF( FT_Error ) pfr_extra_item_load_font_id( FT_Byte* p, FT_Byte* limit, @@ -693,12 +702,54 @@ }; + /* loads a name from the auxiliary data. Since this extracts undocumented + * strings from the font file, we need to be careful here + */ + static FT_Error + pfr_aux_name_load( FT_Byte* p, + FT_UInt len, + FT_Memory memory, + FT_String* *astring ) + { + FT_Error error = 0; + FT_String* result = NULL; + FT_UInt n, ok; + + if ( len > 0 && p[len-1] == 0 ) + len--; + + /* check that each character is ASCII, that's to be sure + * to not load garbage.. + */ + ok = (len > 0); + for ( n = 0; n < len; n++ ) + if ( p[n] < 32 || p[n] > 127 ) + { + ok = 0; + break; + } + + if ( ok ) + { + if ( FT_ALLOC( result, len+1 ) ) + goto Exit; + + FT_MEM_COPY( result, p, len ); + result[len] = 0; + } + Exit: + *astring = result; + return error; + } + + FT_LOCAL_DEF( void ) pfr_phy_font_done( PFR_PhyFont phy_font, FT_Memory memory ) { - if ( phy_font->font_id ) - FT_FREE( phy_font->font_id ); + FT_FREE( phy_font->font_id ); + FT_FREE( phy_font->family_name ); + FT_FREE( phy_font->style_name ); FT_FREE( phy_font->vertical.stem_snaps ); phy_font->vertical.num_stem_snaps = 0; @@ -736,6 +787,7 @@ } + FT_LOCAL_DEF( FT_Error ) pfr_phy_font_load( PFR_PhyFont phy_font, FT_Stream stream, @@ -790,12 +842,80 @@ goto Fail; } - /* skip the aux bytes */ + /* in certain fonts, the auxiliary bytes contain interesting */ + /* information. These are not in the specification but can be */ + /* guessed by looking at the content of a few PFR0 fonts */ PFR_CHECK( 3 ); num_aux = PFR_NEXT_ULONG( p ); - PFR_CHECK( num_aux ); - p += num_aux; + if ( num_aux > 0 ) + { + FT_Byte* q = p; + FT_Byte* q2; + + PFR_CHECK( num_aux ); + p += num_aux; + + while ( num_aux > 0 ) + { + FT_UInt length, type; + + if ( q + 4 > p ) + break; + + length = PFR_NEXT_USHORT(q); + if ( length < 4 || length > num_aux ) + break; + + q2 = q + length - 2; + type = PFR_NEXT_USHORT(q); + + switch ( type ) + { + case 1: + { + /* this seems to correspond to the font's family name, + * padded to 16-bits with one zero when necessary + */ + error = pfr_aux_name_load( q, length-4U, memory, + &phy_font->family_name ); + if ( error ) + goto Exit; + } + break; + + case 2: + { + if ( q + 32 > q2 ) + break; + + q += 10; + phy_font->ascent = PFR_NEXT_SHORT(q); + phy_font->descent = PFR_NEXT_SHORT(q); + phy_font->leading = PFR_NEXT_SHORT(q); + q += 16; + } + break; + + case 3: + { + /* this seems to correspond to the font's style name, + * padded to 16-bits with one zero when necessary + */ + error = pfr_aux_name_load( q, length-4U, memory, + &phy_font->style_name ); + if ( error ) + goto Exit; + } + break; + + default: + ; + } + q = q2; + num_aux -= length; + } + } /* read the blue values */ { @@ -898,4 +1018,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrload.h b/src/libs/freetype2/pfr/pfrload.h index 9e54b7d3fd..2501138ac9 100644 --- a/src/libs/freetype2/pfr/pfrload.h +++ b/src/libs/freetype2/pfr/pfrload.h @@ -115,4 +115,4 @@ FT_END_HEADER #endif /* __PFRLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrobjs.c b/src/libs/freetype2/pfr/pfrobjs.c index 8ede63a955..d6f4936d80 100644 --- a/src/libs/freetype2/pfr/pfrobjs.c +++ b/src/libs/freetype2/pfr/pfrobjs.c @@ -41,10 +41,17 @@ FT_LOCAL_DEF( void ) pfr_face_done( PFR_Face face ) { + FT_Memory memory = face->root.driver->root.memory; + + /* we don't want dangling pointers */ + face->root.family_name = NULL; + face->root.style_name = NULL; + /* finalize the physical font record */ pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) ); /* no need to finalize the logical font or the header */ + FT_FREE( face->root.available_sizes ); } @@ -136,8 +143,18 @@ if ( phy_font->num_kern_pairs > 0 ) root->face_flags |= FT_FACE_FLAG_KERNING; - root->family_name = phy_font->font_id; - root->style_name = NULL; /* no style name in font file */ + /* if no family name was found in the "undocumented" auxiliary + * data, use the font ID instead. This sucks but is better than + * nothing + */ + root->family_name = phy_font->family_name; + if ( root->family_name == NULL ) + root->family_name = phy_font->font_id; + + /* note that the style name can be NULL in certain PFR fonts, + * probably meaning "Regular" + */ + root->style_name = phy_font->style_name; root->num_fixed_sizes = 0; root->available_sizes = 0; @@ -150,6 +167,27 @@ ( ( ( root->ascender - root->descender ) * 12 ) / 10 ); + if ( phy_font->num_strikes > 0 ) + { + FT_UInt n, count = phy_font->num_strikes; + FT_Bitmap_Size* size; + PFR_Strike strike; + FT_Memory memory = root->stream->memory; + + + if ( FT_NEW_ARRAY( root->available_sizes, count ) ) + goto Exit; + + size = root->available_sizes; + strike = phy_font->strikes; + for ( n = 0; n < count; n++, size++, strike++ ) + { + size->height = (FT_UShort) strike->y_ppm; + size->width = (FT_UShort) strike->x_ppm; + } + root->num_fixed_sizes = count; + } + /* now compute maximum advance width */ if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 ) root->max_advance_width = (FT_Short)phy_font->standard_advance; @@ -255,6 +293,12 @@ goto Exit; } + if ( load_flags & FT_LOAD_SBITS_ONLY ) + { + error = FT_Err_Invalid_Argument; + goto Exit; + } + gchar = face->phy_font.chars + gindex; slot->root.format = FT_GLYPH_FORMAT_OUTLINE; outline->n_points = 0; @@ -434,4 +478,4 @@ return 0; } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrobjs.h b/src/libs/freetype2/pfr/pfrobjs.h index b29b64c6cd..1d90b17658 100644 --- a/src/libs/freetype2/pfr/pfrobjs.h +++ b/src/libs/freetype2/pfr/pfrobjs.h @@ -93,4 +93,4 @@ FT_END_HEADER #endif /* __PFROBJS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrsbit.c b/src/libs/freetype2/pfr/pfrsbit.c index b93c2071ac..65085bddd4 100644 --- a/src/libs/freetype2/pfr/pfrsbit.c +++ b/src/libs/freetype2/pfr/pfrsbit.c @@ -49,7 +49,7 @@ static void pfr_bitwriter_init( PFR_BitWriter writer, FT_Bitmap* target, - FT_Bool decreasing ) + FT_UInt decreasing ) { writer->line = target->buffer; writer->pitch = target->pitch; @@ -107,7 +107,7 @@ } else if ( mask == 0 ) { - cur[0] = c; + cur[0] = (FT_Byte)c; mask = 0x80; c = 0; cur ++; @@ -115,7 +115,7 @@ } if ( mask != 0x80 ) - cur[0] = c; + cur[0] = (FT_Byte) c; } @@ -185,7 +185,7 @@ } else if ( mask == 0 ) { - cur[0] = c; + cur[0] = (FT_Byte) c; mask = 0x80; c = 0; cur ++; @@ -249,7 +249,7 @@ } else if ( mask == 0 ) { - cur[0] = c; + cur[0] = (FT_Byte) c; c = 0; mask = 0x80; cur ++; @@ -281,7 +281,7 @@ FT_ULong* found_size ) { FT_UInt left, right, char_len; - FT_Bool two = flags & 1; + FT_Bool two = FT_BOOL( flags & 1 ); FT_Byte* buff; @@ -583,7 +583,7 @@ pfr_lookup_bitmap_data( stream->cursor, stream->limit, strike->num_bitmaps, - strike->flags, + (FT_Byte) strike->flags, character->char_code, &gps_offset, &gps_size ); @@ -624,7 +624,7 @@ if ( !error ) { glyph->root.format = FT_GLYPH_FORMAT_BITMAP; - + /* Set up glyph bitmap and metrics */ glyph->root.bitmap.width = (FT_Int)xsize; glyph->root.bitmap.rows = (FT_Int)ysize; @@ -645,11 +645,10 @@ /* Allocate and read bitmap data */ { - FT_Memory memory = face->root.memory; - FT_Long len = glyph->root.bitmap.pitch * ysize; + FT_ULong len = glyph->root.bitmap.pitch * ysize; - - if ( !FT_ALLOC( glyph->root.bitmap.buffer, len ) ) + error = ft_glyphslot_alloc_bitmap( &glyph->root, len ); + if ( !error ) { error = pfr_load_bitmap_bits( p, stream->limit, @@ -667,4 +666,4 @@ return error; } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrsbit.h b/src/libs/freetype2/pfr/pfrsbit.h index 015e9e6dad..2b66676694 100644 --- a/src/libs/freetype2/pfr/pfrsbit.h +++ b/src/libs/freetype2/pfr/pfrsbit.h @@ -33,4 +33,4 @@ FT_END_HEADER #endif /* __PFR_SBIT_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/pfrtypes.h b/src/libs/freetype2/pfr/pfrtypes.h index 3b419da5d9..d43d306e74 100644 --- a/src/libs/freetype2/pfr/pfrtypes.h +++ b/src/libs/freetype2/pfr/pfrtypes.h @@ -230,11 +230,17 @@ FT_BEGIN_HEADER FT_BBox bbox; FT_UInt flags; FT_UInt standard_advance; + + FT_Int ascent; /* optional, bbox.yMax if not present */ + FT_Int descent; /* optional, bbox.yMin if not present */ + FT_Int leading; /* optional, 0 if not present */ PFR_DimensionRec horizontal; PFR_DimensionRec vertical; FT_String* font_id; + FT_String* family_name; + FT_String* style_name; FT_UInt num_strikes; FT_UInt max_strikes; @@ -351,4 +357,4 @@ FT_END_HEADER #endif /* __PFRTYPES_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pfr/rules.mk b/src/libs/freetype2/pfr/rules.mk index fe2f6eb992..678b8561c4 100644 --- a/src/libs/freetype2/pfr/rules.mk +++ b/src/libs/freetype2/pfr/rules.mk @@ -68,4 +68,4 @@ $(OBJ_)%.$O: $(PFR_DIR_)%.c $(FREETYPE_H) $(PFR_DRV_H) DRV_OBJS_S += $(PFR_DRV_OBJ_S) DRV_OBJS_M += $(PFR_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/psaux/descrip.mms b/src/libs/freetype2/psaux/descrip.mms index bff019243d..403be66bb6 100644 --- a/src/libs/freetype2/psaux/descrip.mms +++ b/src/libs/freetype2/psaux/descrip.mms @@ -20,4 +20,4 @@ OBJS=psaux.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/psaux/module.mk b/src/libs/freetype2/psaux/module.mk index 29c3e28a91..107323ae54 100644 --- a/src/libs/freetype2/psaux/module.mk +++ b/src/libs/freetype2/psaux/module.mk @@ -19,4 +19,4 @@ add_psaux_module: $(OPEN_DRIVER)psaux_module_class$(CLOSE_DRIVER) $(ECHO_DRIVER)psaux $(ECHO_DRIVER_DESC)Postscript Type 1 & Type 2 helper module$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/psaux/psaux.c b/src/libs/freetype2/psaux/psaux.c index 9928184143..51f8cb19da 100644 --- a/src/libs/freetype2/psaux/psaux.c +++ b/src/libs/freetype2/psaux/psaux.c @@ -25,4 +25,4 @@ #include "t1cmap.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/psauxerr.h b/src/libs/freetype2/psaux/psauxerr.h index d0baa3cbb9..bbc955258c 100644 --- a/src/libs/freetype2/psaux/psauxerr.h +++ b/src/libs/freetype2/psaux/psauxerr.h @@ -38,4 +38,4 @@ #endif /* __PSAUXERR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/psauxmod.c b/src/libs/freetype2/psaux/psauxmod.c index fa0c4aa8ce..22df0ce6d4 100644 --- a/src/libs/freetype2/psaux/psauxmod.c +++ b/src/libs/freetype2/psaux/psauxmod.c @@ -115,4 +115,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/psauxmod.h b/src/libs/freetype2/psaux/psauxmod.h index 92ac056048..04fcd21b2b 100644 --- a/src/libs/freetype2/psaux/psauxmod.h +++ b/src/libs/freetype2/psaux/psauxmod.h @@ -35,4 +35,4 @@ FT_END_HEADER #endif /* __PSAUXMOD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/psobjs.c b/src/libs/freetype2/psaux/psobjs.c index 6035950625..ce4f291806 100644 --- a/src/libs/freetype2/psaux/psobjs.c +++ b/src/libs/freetype2/psaux/psobjs.c @@ -111,7 +111,10 @@ /* allocate new base block */ if ( FT_ALLOC( table->block, new_size ) ) + { + table->block = old_base; return error; + } /* copy elements and shift offsets */ if (old_base ) @@ -1400,4 +1403,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/psobjs.h b/src/libs/freetype2/psaux/psobjs.h index 9e81675bb1..54b4a0735d 100644 --- a/src/libs/freetype2/psaux/psobjs.h +++ b/src/libs/freetype2/psaux/psobjs.h @@ -201,4 +201,4 @@ FT_END_HEADER #endif /* __PSOBJS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/rules.mk b/src/libs/freetype2/psaux/rules.mk index 04730852fe..f67d7c1ecb 100644 --- a/src/libs/freetype2/psaux/rules.mk +++ b/src/libs/freetype2/psaux/rules.mk @@ -69,4 +69,4 @@ DRV_OBJS_S += $(PSAUX_DRV_OBJ_S) DRV_OBJS_M += $(PSAUX_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/psaux/t1cmap.c b/src/libs/freetype2/psaux/t1cmap.c index 0ddd3f5dae..39c22138d0 100644 --- a/src/libs/freetype2/psaux/t1cmap.c +++ b/src/libs/freetype2/psaux/t1cmap.c @@ -451,4 +451,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/t1cmap.h b/src/libs/freetype2/psaux/t1cmap.h index 0d68c999c1..7fd2fbf751 100644 --- a/src/libs/freetype2/psaux/t1cmap.h +++ b/src/libs/freetype2/psaux/t1cmap.h @@ -121,4 +121,4 @@ FT_END_HEADER #endif /* __T1CMAP_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/t1decode.c b/src/libs/freetype2/psaux/t1decode.c index 27b4e877c6..5f5caf10a7 100644 --- a/src/libs/freetype2/psaux/t1decode.c +++ b/src/libs/freetype2/psaux/t1decode.c @@ -1167,4 +1167,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/psaux/t1decode.h b/src/libs/freetype2/psaux/t1decode.h index fcb853ce80..d779f6135a 100644 --- a/src/libs/freetype2/psaux/t1decode.h +++ b/src/libs/freetype2/psaux/t1decode.h @@ -62,4 +62,4 @@ FT_END_HEADER #endif /* __T1DECODE_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/descrip.mms b/src/libs/freetype2/pshinter/descrip.mms index 205d6cfcc0..1e3079ebaf 100644 --- a/src/libs/freetype2/pshinter/descrip.mms +++ b/src/libs/freetype2/pshinter/descrip.mms @@ -20,4 +20,4 @@ OBJS=pshinter.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/pshinter/module.mk b/src/libs/freetype2/pshinter/module.mk index 63c7e217f1..3fac789192 100644 --- a/src/libs/freetype2/pshinter/module.mk +++ b/src/libs/freetype2/pshinter/module.mk @@ -19,4 +19,4 @@ add_pshinter_module: $(OPEN_DRIVER)pshinter_module_class$(CLOSE_DRIVER) $(ECHO_DRIVER)pshinter $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/pshinter/pshalgo.h b/src/libs/freetype2/pshinter/pshalgo.h index e79ad02955..767c00bfd7 100644 --- a/src/libs/freetype2/pshinter/pshalgo.h +++ b/src/libs/freetype2/pshinter/pshalgo.h @@ -50,4 +50,4 @@ FT_END_HEADER #endif /* __PSHALGO_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshalgo1.c b/src/libs/freetype2/pshinter/pshalgo1.c index 06da5977d0..4dea3e5caa 100644 --- a/src/libs/freetype2/pshinter/pshalgo1.c +++ b/src/libs/freetype2/pshinter/pshalgo1.c @@ -782,4 +782,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshalgo1.h b/src/libs/freetype2/pshinter/pshalgo1.h index 2f795a6a58..64d12dec18 100644 --- a/src/libs/freetype2/pshinter/pshalgo1.h +++ b/src/libs/freetype2/pshinter/pshalgo1.h @@ -107,4 +107,4 @@ FT_END_HEADER #endif /* __PSHALGO1_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshalgo2.c b/src/libs/freetype2/pshinter/pshalgo2.c index c0a9265b61..e24897f6dc 100644 --- a/src/libs/freetype2/pshinter/pshalgo2.c +++ b/src/libs/freetype2/pshinter/pshalgo2.c @@ -1554,4 +1554,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshalgo2.h b/src/libs/freetype2/pshinter/pshalgo2.h index 405d34b565..12b5a67cbd 100644 --- a/src/libs/freetype2/pshinter/pshalgo2.h +++ b/src/libs/freetype2/pshinter/pshalgo2.h @@ -200,4 +200,4 @@ FT_END_HEADER #endif /* __PSHALGO2_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshalgo3.c b/src/libs/freetype2/pshinter/pshalgo3.c index 4ee01715db..6d60475fcd 100644 --- a/src/libs/freetype2/pshinter/pshalgo3.c +++ b/src/libs/freetype2/pshinter/pshalgo3.c @@ -332,6 +332,7 @@ /*************************************************************************/ /*************************************************************************/ +#if 1 static FT_Pos psh3_dimension_quantize_len( PSH_Dimension dim, FT_Pos len, @@ -380,6 +381,7 @@ return len; } +#endif /* 0 */ #ifdef DEBUG_HINTER @@ -456,7 +458,9 @@ return; } - /* perform stem snapping when requested */ + /* perform stem snapping when requested - this is necessary + * for monochrome and LCD hinting modes only + */ do_snapping = ( dimension == 0 && glyph->do_horz_snapping ) || ( dimension == 1 && glyph->do_vert_snapping ); @@ -516,17 +520,29 @@ hint->cur_pos = pos; hint->cur_len = fit_len; - if ( len <= 64 ) + /* stem adjustment tries to snap stem widths to standard + * ones. this is important to prevent unpleasant rounding + * artefacts... + */ + if ( glyph->do_stem_adjust ) { - /* the stem is less than one pixel, we will center it */ - /* around the nearest pixel center */ - /* */ - pos = ( pos + ( (len >> 1) & -64 ) ); - len = 64; - } - else - { - len = psh3_dimension_quantize_len( dim, len, 0 ); + if ( len <= 64 ) + { + /* the stem is less than one pixel, we will center it + * around the nearest pixel center + */ +#if 1 + pos = ( pos + (len >> 1) ) & -64; +#else + /* this seems to be a bug !! */ + pos = ( pos + ( (len >> 1) & -64 ) ); +#endif + len = 64; + } + else + { + len = psh3_dimension_quantize_len( dim, len, 0 ); + } } /* now that we have a good hinted stem width, try to position */ @@ -584,6 +600,189 @@ } +#if 0 /* not used for now, experimental */ + + /* + * A variant to perform "light" hinting (i.e. FT_RENDER_MODE_LIGHT) + * of stems + */ + static void + psh3_hint_align_light( PSH3_Hint hint, + PSH_Globals globals, + FT_Int dimension, + PSH3_Glyph glyph ) + { + PSH_Dimension dim = &globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + + + if ( !psh3_hint_is_fitted(hint) ) + { + FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta; + FT_Pos len = FT_MulFix( hint->org_len, scale ); + + FT_Pos fit_len; + + PSH_AlignmentRec align; + + /* ignore stem alignments when requested through the hint flags */ + if ( ( dimension == 0 && !glyph->do_horz_hints ) || + ( dimension == 1 && !glyph->do_vert_hints ) ) + { + hint->cur_pos = pos; + hint->cur_len = len; + + psh3_hint_set_fitted( hint ); + return; + } + + fit_len = len; + + hint->cur_len = fit_len; + + /* check blue zones for horizontal stems */ + align.align = PSH_BLUE_ALIGN_NONE; + align.align_bot = align.align_top = 0; + + if ( dimension == 1 ) + psh_blues_snap_stem( &globals->blues, + hint->org_pos + hint->org_len, + hint->org_pos, + &align ); + + switch ( align.align ) + { + case PSH_BLUE_ALIGN_TOP: + /* the top of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_top - fit_len; + break; + + case PSH_BLUE_ALIGN_BOT: + /* the bottom of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_bot; + break; + + case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT: + /* both edges of the stem are aligned against blue zones */ + hint->cur_pos = align.align_bot; + hint->cur_len = align.align_top - align.align_bot; + break; + + default: + { + PSH3_Hint parent = hint->parent; + + + if ( parent ) + { + FT_Pos par_org_center, par_cur_center; + FT_Pos cur_org_center, cur_delta; + + + /* ensure that parent is already fitted */ + if ( !psh3_hint_is_fitted( parent ) ) + psh3_hint_align_light( parent, globals, dimension, glyph ); + + par_org_center = parent->org_pos + ( parent->org_len / 2); + par_cur_center = parent->cur_pos + ( parent->cur_len / 2); + cur_org_center = hint->org_pos + ( hint->org_len / 2); + + cur_delta = FT_MulFix( cur_org_center - par_org_center, scale ); + pos = par_cur_center + cur_delta - ( len >> 1 ); + } + + /* Stems less than one pixel wide are easy - we want to + * make them as dark as possible, so they must fall within + * one pixel. If the stem is split between two pixels + * then snap the edge that is nearer to the pixel boundary + * to the pixel boundary + */ + if (len <= 64) + { + if ( ( pos + len + 63 ) / 64 != pos / 64 + 1 ) + pos += psh3_hint_snap_stem_side_delta ( pos, len ); + } + /* Position stems other to minimize the amount of mid-grays. + * There are, in general, two positions that do this, + * illustrated as A) and B) below. + * + * + + + + + * + * A) |--------------------------------| + * B) |--------------------------------| + * C) |--------------------------------| + * + * Position A) (split the excess stem equally) should be better + * for stems of width N + f where f < 0.5 + * + * Position B) (split the deficiency equally) should be better + * for stems of width N + f where f > 0.5 + * + * It turns out though that minimizing the total number of lit + * pixels is also important, so position C), with one edge + * aligned with a pixel boundary is actually preferable + * to A). There are also more possibile positions for C) than + * for A) or B), so it involves less distortion of the overall + * character shape. + */ + else /* len > 64 */ + { + FT_Fixed frac_len = len & 63; + FT_Fixed center = pos + ( len >> 1 ); + FT_Fixed delta_a, delta_b; + + if ( ( len / 64 ) & 1 ) + { + delta_a = ( center & -64 ) + 32 - center; + delta_b = ( ( center + 32 ) & - 64 ) - center; + } + else + { + delta_a = ( ( center + 32 ) & - 64 ) - center; + delta_b = ( center & -64 ) + 32 - center; + } + + /* We choose between B) and C) above based on the amount + * of fractinal stem width; for small amounts, choose + * C) always, for large amounts, B) always, and inbetween, + * pick whichever one involves less stem movement. + */ + if (frac_len < 32) + { + pos += psh3_hint_snap_stem_side_delta ( pos, len ); + } + else if (frac_len < 48) + { + FT_Fixed side_delta = psh3_hint_snap_stem_side_delta ( pos, len ); + + if ( ABS( side_delta ) < ABS( delta_b ) ) + pos += side_delta; + else + pos += delta_b; + } + else + { + pos += delta_b; + } + } + + hint->cur_pos = pos; + } + } /* switch */ + + psh3_hint_set_fitted( hint ); + +#ifdef DEBUG_HINTER + if ( ps3_debug_hint_func ) + ps3_debug_hint_func( hint, dimension ); +#endif + } + } + +#endif /* 0 */ + + static void psh3_hint_table_align_hints( PSH3_Hint_Table table, PSH_Globals globals, @@ -1720,6 +1919,8 @@ glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || hint_mode == FT_RENDER_MODE_LCD_V ); + glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT ); + for ( dimension = 0; dimension < 2; dimension++ ) { /* load outline coordinates into glyph */ @@ -1754,4 +1955,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshalgo3.h b/src/libs/freetype2/pshinter/pshalgo3.h index 18f53741c4..70e35fe361 100644 --- a/src/libs/freetype2/pshinter/pshalgo3.h +++ b/src/libs/freetype2/pshinter/pshalgo3.h @@ -221,6 +221,7 @@ FT_BEGIN_HEADER FT_Bool do_vert_hints; FT_Bool do_horz_snapping; FT_Bool do_vert_snapping; + FT_Bool do_stem_adjust; } PSH3_GlyphRec, *PSH3_Glyph; @@ -251,4 +252,4 @@ FT_END_HEADER #endif /* __PSHALGO3_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshglob.c b/src/libs/freetype2/pshinter/pshglob.c index e5ead54510..c9d24808f1 100644 --- a/src/libs/freetype2/pshinter/pshglob.c +++ b/src/libs/freetype2/pshinter/pshglob.c @@ -740,4 +740,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshglob.h b/src/libs/freetype2/pshinter/pshglob.h index 0a3a96ab15..35bfafb202 100644 --- a/src/libs/freetype2/pshinter/pshglob.h +++ b/src/libs/freetype2/pshinter/pshglob.h @@ -184,4 +184,4 @@ FT_END_HEADER #endif /* __PSHGLOB_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshinter.c b/src/libs/freetype2/pshinter/pshinter.c index 180f6c89c4..e118d01b6f 100644 --- a/src/libs/freetype2/pshinter/pshinter.c +++ b/src/libs/freetype2/pshinter/pshinter.c @@ -27,4 +27,4 @@ #include "pshmod.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshmod.c b/src/libs/freetype2/pshinter/pshmod.c index 5b18684c75..2c53dc726c 100644 --- a/src/libs/freetype2/pshinter/pshmod.c +++ b/src/libs/freetype2/pshinter/pshmod.c @@ -117,4 +117,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshmod.h b/src/libs/freetype2/pshinter/pshmod.h index 1a91025b26..9d44db28b4 100644 --- a/src/libs/freetype2/pshinter/pshmod.h +++ b/src/libs/freetype2/pshinter/pshmod.h @@ -36,4 +36,4 @@ FT_END_HEADER #endif /* __PSHMOD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshrec.c b/src/libs/freetype2/pshinter/pshrec.c index 21ced1e298..38996b40ca 100644 --- a/src/libs/freetype2/pshinter/pshrec.c +++ b/src/libs/freetype2/pshinter/pshrec.c @@ -1208,4 +1208,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/pshrec.h b/src/libs/freetype2/pshinter/pshrec.h index 884aa5c5df..45bf893f64 100644 --- a/src/libs/freetype2/pshinter/pshrec.h +++ b/src/libs/freetype2/pshinter/pshrec.h @@ -177,4 +177,4 @@ FT_END_HEADER #endif /* __PS_HINTER_RECORD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/pshinter/rules.mk b/src/libs/freetype2/pshinter/rules.mk index 207d3494ae..12be69cf51 100644 --- a/src/libs/freetype2/pshinter/rules.mk +++ b/src/libs/freetype2/pshinter/rules.mk @@ -71,4 +71,4 @@ DRV_OBJS_S += $(PSHINTER_DRV_OBJ_S) DRV_OBJS_M += $(PSHINTER_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/psnames/descrip.mms b/src/libs/freetype2/psnames/descrip.mms index 6a66b9fa3e..859450ac8f 100644 --- a/src/libs/freetype2/psnames/descrip.mms +++ b/src/libs/freetype2/psnames/descrip.mms @@ -20,4 +20,4 @@ OBJS=psnames.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/psnames/module.mk b/src/libs/freetype2/psnames/module.mk index e1e59c46b6..0ed3572d4d 100644 --- a/src/libs/freetype2/psnames/module.mk +++ b/src/libs/freetype2/psnames/module.mk @@ -19,4 +19,4 @@ add_psnames_module: $(OPEN_DRIVER)psnames_module_class$(CLOSE_DRIVER) $(ECHO_DRIVER)psnames $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/psnames/psmodule.c b/src/libs/freetype2/psnames/psmodule.c index b2ddcb7e4d..433c379795 100644 --- a/src/libs/freetype2/psnames/psmodule.c +++ b/src/libs/freetype2/psnames/psmodule.c @@ -354,4 +354,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/psnames/psmodule.h b/src/libs/freetype2/psnames/psmodule.h index 232fdfb9a9..527cdba5a6 100644 --- a/src/libs/freetype2/psnames/psmodule.h +++ b/src/libs/freetype2/psnames/psmodule.h @@ -35,4 +35,4 @@ FT_END_HEADER #endif /* __PSMODULE_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/psnames/psnamerr.h b/src/libs/freetype2/psnames/psnamerr.h index ae1541d960..8c1d0a6e8d 100644 --- a/src/libs/freetype2/psnames/psnamerr.h +++ b/src/libs/freetype2/psnames/psnamerr.h @@ -38,4 +38,4 @@ #endif /* __PSNAMERR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/psnames/psnames.c b/src/libs/freetype2/psnames/psnames.c index d6ed998bfb..456078f0bc 100644 --- a/src/libs/freetype2/psnames/psnames.c +++ b/src/libs/freetype2/psnames/psnames.c @@ -22,4 +22,4 @@ #include "psmodule.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/psnames/pstables.h b/src/libs/freetype2/psnames/pstables.h index 39c838a123..a38dbe2034 100644 --- a/src/libs/freetype2/psnames/pstables.h +++ b/src/libs/freetype2/psnames/pstables.h @@ -2964,4 +2964,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/psnames/rules.mk b/src/libs/freetype2/psnames/rules.mk index 4a4b82e82f..4ce92f41e7 100644 --- a/src/libs/freetype2/psnames/rules.mk +++ b/src/libs/freetype2/psnames/rules.mk @@ -68,4 +68,4 @@ DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S) DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/raster/descrip.mms b/src/libs/freetype2/raster/descrip.mms index d0650ebbf7..c45451d18c 100644 --- a/src/libs/freetype2/raster/descrip.mms +++ b/src/libs/freetype2/raster/descrip.mms @@ -20,4 +20,4 @@ OBJS=raster.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/raster/ftraster.c b/src/libs/freetype2/raster/ftraster.c index 654a81ec37..d988610592 100644 --- a/src/libs/freetype2/raster/ftraster.c +++ b/src/libs/freetype2/raster/ftraster.c @@ -3285,4 +3285,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/raster/ftraster.h b/src/libs/freetype2/raster/ftraster.h index 80fe46deba..3714c4f3df 100644 --- a/src/libs/freetype2/raster/ftraster.h +++ b/src/libs/freetype2/raster/ftraster.h @@ -43,4 +43,4 @@ FT_END_HEADER #endif /* __FTRASTER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/raster/ftrend1.c b/src/libs/freetype2/raster/ftrend1.c index 86b170cfe9..bd15a2f2d9 100644 --- a/src/libs/freetype2/raster/ftrend1.c +++ b/src/libs/freetype2/raster/ftrend1.c @@ -270,4 +270,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/raster/ftrend1.h b/src/libs/freetype2/raster/ftrend1.h index 76e9a5f581..7cf6ce99b3 100644 --- a/src/libs/freetype2/raster/ftrend1.h +++ b/src/libs/freetype2/raster/ftrend1.h @@ -41,4 +41,4 @@ FT_END_HEADER #endif /* __FTREND1_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/raster/module.mk b/src/libs/freetype2/raster/module.mk index 8a3136413d..2f4064202c 100644 --- a/src/libs/freetype2/raster/module.mk +++ b/src/libs/freetype2/raster/module.mk @@ -19,4 +19,4 @@ add_raster_module: $(OPEN_DRIVER)ft_raster1_renderer_class$(CLOSE_DRIVER) $(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/raster/raster.c b/src/libs/freetype2/raster/raster.c index f13a67a209..fe764d234b 100644 --- a/src/libs/freetype2/raster/raster.c +++ b/src/libs/freetype2/raster/raster.c @@ -23,4 +23,4 @@ #include "ftrend1.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/raster/rasterrs.h b/src/libs/freetype2/raster/rasterrs.h index 5df9a7ab1e..615a270e4f 100644 --- a/src/libs/freetype2/raster/rasterrs.h +++ b/src/libs/freetype2/raster/rasterrs.h @@ -38,4 +38,4 @@ #endif /* __RASTERRS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/raster/rules.mk b/src/libs/freetype2/raster/rules.mk index 9fe4b8bd09..ebfaf12130 100644 --- a/src/libs/freetype2/raster/rules.mk +++ b/src/libs/freetype2/raster/rules.mk @@ -67,4 +67,4 @@ DRV_OBJS_S += $(RAS1_DRV_OBJ_S) DRV_OBJS_M += $(RAS1_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/sfnt/descrip.mms b/src/libs/freetype2/sfnt/descrip.mms index 811c8b3ee5..0f5f3edad8 100644 --- a/src/libs/freetype2/sfnt/descrip.mms +++ b/src/libs/freetype2/sfnt/descrip.mms @@ -20,4 +20,4 @@ OBJS=sfnt.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/sfnt/module.mk b/src/libs/freetype2/sfnt/module.mk index 52607e2afc..41a3211271 100644 --- a/src/libs/freetype2/sfnt/module.mk +++ b/src/libs/freetype2/sfnt/module.mk @@ -19,4 +19,4 @@ add_sfnt_module: $(OPEN_DRIVER)sfnt_module_class$(CLOSE_DRIVER) $(ECHO_DRIVER)sfnt $(ECHO_DRIVER_DESC)helper module for TrueType & OpenType formats$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/sfnt/rules.mk b/src/libs/freetype2/sfnt/rules.mk index c074a6afc1..08690f181c 100644 --- a/src/libs/freetype2/sfnt/rules.mk +++ b/src/libs/freetype2/sfnt/rules.mk @@ -72,4 +72,4 @@ DRV_OBJS_S += $(SFNT_DRV_OBJ_S) DRV_OBJS_M += $(SFNT_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/sfnt/sfdriver.c b/src/libs/freetype2/sfnt/sfdriver.c index f2fa7b46e8..72bbb74b20 100644 --- a/src/libs/freetype2/sfnt/sfdriver.c +++ b/src/libs/freetype2/sfnt/sfdriver.c @@ -228,6 +228,9 @@ if ( ft_strcmp( module_interface, "get_sfnt" ) == 0 ) return (FT_Module_Interface)get_sfnt_table; + if ( ft_strcmp( module_interface, "load_sfnt" ) == 0 ) + return (FT_Module_Interface)tt_face_load_any; + #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES if ( ft_strcmp( module_interface, "glyph_name" ) == 0 ) return (FT_Module_Interface)get_sfnt_glyph_name; @@ -329,4 +332,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/sfdriver.h b/src/libs/freetype2/sfnt/sfdriver.h index 92db79694d..83f647cda6 100644 --- a/src/libs/freetype2/sfnt/sfdriver.h +++ b/src/libs/freetype2/sfnt/sfdriver.h @@ -35,4 +35,4 @@ FT_END_HEADER #endif /* __SFDRIVER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/sferrors.h b/src/libs/freetype2/sfnt/sferrors.h index fd2736b6c8..71bddad8f5 100644 --- a/src/libs/freetype2/sfnt/sferrors.h +++ b/src/libs/freetype2/sfnt/sferrors.h @@ -36,4 +36,4 @@ #endif /* __SFERRORS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/sfnt.c b/src/libs/freetype2/sfnt/sfnt.c index 6e0757aa85..75a26eb7cb 100644 --- a/src/libs/freetype2/sfnt/sfnt.c +++ b/src/libs/freetype2/sfnt/sfnt.c @@ -34,4 +34,4 @@ #endif -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/sfobjs.c b/src/libs/freetype2/sfnt/sfobjs.c index adaca24403..331be8006d 100644 --- a/src/libs/freetype2/sfnt/sfobjs.c +++ b/src/libs/freetype2/sfnt/sfobjs.c @@ -826,4 +826,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/sfobjs.h b/src/libs/freetype2/sfnt/sfobjs.h index 6241c93b39..a083d3a08c 100644 --- a/src/libs/freetype2/sfnt/sfobjs.h +++ b/src/libs/freetype2/sfnt/sfobjs.h @@ -51,4 +51,4 @@ FT_END_HEADER #endif /* __SFDRIVER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttcmap.c b/src/libs/freetype2/sfnt/ttcmap.c index f6aabfeec2..c9289cc639 100644 --- a/src/libs/freetype2/sfnt/ttcmap.c +++ b/src/libs/freetype2/sfnt/ttcmap.c @@ -1107,4 +1107,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttcmap.h b/src/libs/freetype2/sfnt/ttcmap.h index cd19a6b734..8daa7ada19 100644 --- a/src/libs/freetype2/sfnt/ttcmap.h +++ b/src/libs/freetype2/sfnt/ttcmap.h @@ -42,4 +42,4 @@ FT_END_HEADER #endif /* __TTCMAP_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttcmap0.c b/src/libs/freetype2/sfnt/ttcmap0.c index 4053345779..6aaf140a15 100644 --- a/src/libs/freetype2/sfnt/ttcmap0.c +++ b/src/libs/freetype2/sfnt/ttcmap0.c @@ -1781,4 +1781,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttcmap0.h b/src/libs/freetype2/sfnt/ttcmap0.h index ff1276e09b..324fcbffd8 100644 --- a/src/libs/freetype2/sfnt/ttcmap0.h +++ b/src/libs/freetype2/sfnt/ttcmap0.h @@ -71,4 +71,4 @@ FT_END_HEADER #endif /* __TTCMAP0_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttload.c b/src/libs/freetype2/sfnt/ttload.c index 669f365e48..b50d752b61 100644 --- a/src/libs/freetype2/sfnt/ttload.c +++ b/src/libs/freetype2/sfnt/ttload.c @@ -213,7 +213,14 @@ has_head = 1; - if ( table.Length != 0x36 || + /* the table length should be 0x36, but certain font tools + * make it 0x38, so we will just check that it is greater. + * + * note that according to the specification, + * the table must be padded to 32-bit lengths, but this doesn't + * apply to the value of its "Length" field !! + */ + if ( table.Length < 0x36 || FT_STREAM_SEEK( table.Offset + 12 ) || FT_READ_ULONG( magic ) || magic != 0x5F0F3CF5UL ) @@ -831,6 +838,20 @@ error = face->goto_table( face, TTAG_hmtx, stream, &table_len ); 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; @@ -1085,7 +1106,7 @@ if ( FT_STREAM_READ_FIELDS( name_table_fields, table ) ) goto Exit; - /* Some popular asian fonts have an invalid `storageOffset' value */ + /* Some popular Asian fonts have an invalid `storageOffset' value */ /* (it should be at least "6 + 12*num_names"). However, the string */ /* offsets, computed as "storageOffset + entry->stringOffset", are */ /* valid pointers within the name table... */ @@ -1846,4 +1867,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttload.h b/src/libs/freetype2/sfnt/ttload.h index 27c41b50b9..198ad9d4b2 100644 --- a/src/libs/freetype2/sfnt/ttload.h +++ b/src/libs/freetype2/sfnt/ttload.h @@ -134,4 +134,4 @@ FT_END_HEADER #endif /* __TTLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttpost.c b/src/libs/freetype2/sfnt/ttpost.c index 486ba3dd25..b110d757b6 100644 --- a/src/libs/freetype2/sfnt/ttpost.c +++ b/src/libs/freetype2/sfnt/ttpost.c @@ -518,4 +518,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttpost.h b/src/libs/freetype2/sfnt/ttpost.h index 6f06d75a71..2286e40807 100644 --- a/src/libs/freetype2/sfnt/ttpost.h +++ b/src/libs/freetype2/sfnt/ttpost.h @@ -43,4 +43,4 @@ FT_END_HEADER #endif /* __TTPOST_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttsbit.c b/src/libs/freetype2/sfnt/ttsbit.c index a554060d19..b67e482d83 100644 --- a/src/libs/freetype2/sfnt/ttsbit.c +++ b/src/libs/freetype2/sfnt/ttsbit.c @@ -1212,14 +1212,16 @@ TT_SBit_Range range, FT_ULong ebdt_pos, FT_ULong glyph_offset, - FT_Bitmap* map, + FT_GlyphSlot slot, FT_Int x_offset, FT_Int y_offset, FT_Stream stream, - TT_SBit_Metrics metrics ) + TT_SBit_Metrics metrics, + FT_Int depth ) { - FT_Memory memory = stream->memory; - FT_Error error; + FT_Memory memory = stream->memory; + FT_Bitmap* map = &slot->bitmap; + FT_Error error; /* place stream at beginning of glyph data and read metrics */ @@ -1230,11 +1232,10 @@ if ( error ) goto Exit; - /* this function is recursive. At the top-level call, the */ - /* field map.buffer is NULL. We thus begin by finding the */ - /* dimensions of the higher-level glyph to allocate the */ - /* final pixmap buffer */ - if ( map->buffer == 0 ) + /* this function is recursive. At the top-level call, we */ + /* compute the dimensions of the higher-level glyph to */ + /* allocate the final pixmap buffer */ + if ( depth == 0 ) { FT_Long size; @@ -1274,7 +1275,8 @@ if ( size == 0 ) goto Exit; /* exit successfully! */ - if ( FT_ALLOC( map->buffer, size ) ) + error = ft_glyphslot_alloc_bitmap( slot, size ); + if (error) goto Exit; } @@ -1348,11 +1350,12 @@ elem_range, ebdt_pos, elem_offset, - map, + slot, x_offset + comp->x_offset, y_offset + comp->y_offset, stream, - &elem_metrics ); + &elem_metrics, + depth+1 ); if ( error ) goto Fail_Memory; } @@ -1409,7 +1412,6 @@ TT_SBit_MetricsRec *metrics ) { FT_Error error; - FT_Memory memory = stream->memory; FT_ULong ebdt_pos, glyph_offset; TT_SBit_Strike strike; @@ -1432,20 +1434,11 @@ ebdt_pos = FT_STREAM_POS(); - /* clear the bitmap & load the bitmap */ - if ( face->root.glyph->flags & FT_GLYPH_OWN_BITMAP ) - FT_FREE( map->buffer ); - - map->rows = map->pitch = map->width = 0; - error = Load_SBit_Image( strike, range, ebdt_pos, glyph_offset, - map, 0, 0, stream, metrics ); + face->root.glyph, 0, 0, stream, metrics, 0 ); if ( error ) goto Exit; - /* the glyph slot owns this bitmap buffer */ - face->root.glyph->flags |= FT_GLYPH_OWN_BITMAP; - /* setup vertical metrics if needed */ if ( strike->flags & 1 ) { @@ -1471,4 +1464,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/sfnt/ttsbit.h b/src/libs/freetype2/sfnt/ttsbit.h index edc858a60c..26207783ce 100644 --- a/src/libs/freetype2/sfnt/ttsbit.h +++ b/src/libs/freetype2/sfnt/ttsbit.h @@ -56,4 +56,4 @@ FT_END_HEADER #endif /* __TTSBIT_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/smooth/descrip.mms b/src/libs/freetype2/smooth/descrip.mms index 9ebc7ff221..8d37fd886f 100644 --- a/src/libs/freetype2/smooth/descrip.mms +++ b/src/libs/freetype2/smooth/descrip.mms @@ -20,4 +20,4 @@ OBJS=smooth.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/smooth/ftgrays.c b/src/libs/freetype2/smooth/ftgrays.c index f6723af678..e1ff104bd1 100644 --- a/src/libs/freetype2/smooth/ftgrays.c +++ b/src/libs/freetype2/smooth/ftgrays.c @@ -857,7 +857,7 @@ if ( y < min ) min = y; if ( y > max ) max = y; - if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < 0 ) + if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) goto Draw; gray_split_conic( arc ); @@ -1827,9 +1827,9 @@ gray_convert_glyph( RAS_ARG ) { TBand bands[40]; - volatile TBand* band; - volatile int n, num_bands; - volatile TPos min, max, max_y; + TBand* volatile band; + int volatile n, num_bands; + TPos volatile min, max, max_y; FT_BBox* clip; @@ -2156,4 +2156,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/smooth/ftgrays.h b/src/libs/freetype2/smooth/ftgrays.h index 2d409543dc..783fb51ad4 100644 --- a/src/libs/freetype2/smooth/ftgrays.h +++ b/src/libs/freetype2/smooth/ftgrays.h @@ -54,4 +54,4 @@ #endif /* __FTGRAYS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/smooth/ftsmerrs.h b/src/libs/freetype2/smooth/ftsmerrs.h index 0c2a2ecd90..027ec6734b 100644 --- a/src/libs/freetype2/smooth/ftsmerrs.h +++ b/src/libs/freetype2/smooth/ftsmerrs.h @@ -38,4 +38,4 @@ #endif /* __FTSMERRS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/smooth/ftsmooth.c b/src/libs/freetype2/smooth/ftsmooth.c index 131b17eba0..1605d2fe97 100644 --- a/src/libs/freetype2/smooth/ftsmooth.c +++ b/src/libs/freetype2/smooth/ftsmooth.c @@ -368,4 +368,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/smooth/ftsmooth.h b/src/libs/freetype2/smooth/ftsmooth.h index 62cced4487..4107ead2db 100644 --- a/src/libs/freetype2/smooth/ftsmooth.h +++ b/src/libs/freetype2/smooth/ftsmooth.h @@ -46,4 +46,4 @@ FT_END_HEADER #endif /* __FTSMOOTH_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/smooth/module.mk b/src/libs/freetype2/smooth/module.mk index ead77cf30b..2eba7fe315 100644 --- a/src/libs/freetype2/smooth/module.mk +++ b/src/libs/freetype2/smooth/module.mk @@ -19,4 +19,4 @@ add_smooth_renderer: $(OPEN_DRIVER)ft_smooth_renderer_class$(CLOSE_DRIVER) $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/smooth/rules.mk b/src/libs/freetype2/smooth/rules.mk index 457f1e5f4e..a4713dca0c 100644 --- a/src/libs/freetype2/smooth/rules.mk +++ b/src/libs/freetype2/smooth/rules.mk @@ -67,4 +67,4 @@ DRV_OBJS_S += $(SMOOTH_DRV_OBJ_S) DRV_OBJS_M += $(SMOOTH_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/smooth/smooth.c b/src/libs/freetype2/smooth/smooth.c index ff6be3e400..22d9c17433 100644 --- a/src/libs/freetype2/smooth/smooth.c +++ b/src/libs/freetype2/smooth/smooth.c @@ -23,4 +23,4 @@ #include "ftsmooth.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/tools/docmaker/content.py b/src/libs/freetype2/tools/docmaker/content.py index 6d33b5db27..ba77a114d4 100644 --- a/src/libs/freetype2/tools/docmaker/content.py +++ b/src/libs/freetype2/tools/docmaker/content.py @@ -1,547 +1,547 @@ -# -# this file contains routines used to parse the content of documentation -# comment block and build a more structured objects out of them -# - -from sources import * -from utils import * -import string, re - - -# this regular expresion is used to detect code sequences. these -# are simply code fragments embedded in '{' and '}' like in: -# -# { -# x = y + z; -# if ( zookoo == 2 ) -# { -# foobar(); -# } -# } -# -# note that identation of the starting and ending accolades must be -# exactly the same. the code sequence can contain accolades at greater -# indentation -# -re_code_start = re.compile( r"(\s*){\s*$" ) -re_code_end = re.compile( r"(\s*)}\s*$" ) - - -# this regular expression is used to isolate identifiers from -# other text -# -re_identifier = re.compile( r'(\w*)' ) - - -############################################################################# -# -# The DocCode class is used to store source code lines. -# -# 'self.lines' contains a set of source code lines that will be dumped as -# HTML in a
 tag.
-#
-#   The object is filled line by line by the parser; it strips the leading
-#   "margin" space from each input line before storing it in 'self.lines'.
-#
-class DocCode:
-
-    def __init__( self, margin, lines ):
-        self.lines  = []
-        self.words  = None
-
-        # remove margin spaces
-        for l in lines:
-            if string.strip( l[:margin] ) == "":
-                l = l[margin:]
-            self.lines.append( l )
-
-    def dump( self, prefix = "", width=60 ):
-        for l in self.lines:
-            print prefix + l
-
-
-#############################################################################
-#
-# The DocPara class is used to store "normal" text paragraph.
-#
-#   'self.words' contains the list of words that make up the paragraph
-#
-class DocPara:
-
-    def __init__( self, lines ):
-        self.lines = None
-        self.words = []
-        for l in lines:
-            l = string.strip(l)
-            self.words.extend( string.split( l ) )
-
-    def dump( self, prefix = "", width = 60 ):
-        cur  = ""  # current line
-        col  = 0   # current width
-
-        for word in self.words:
-            ln = len(word)
-            if col > 0:
-                ln = ln+1
-
-            if col + ln > width:
-                print prefix + cur
-                cur = word
-                col = len(word)
-            else:
-                if col > 0:
-                    cur = cur + " "
-                cur = cur + word
-                col = col + ln
-
-        if col > 0:
-            print prefix + cur
-
-
-
-#############################################################################
-#
-#  The DocField class is used to store a list containing either DocPara or
-#  DocCode objects. Each DocField also has an optional "name" which is used
-#  when the object corresponds to a field of value definition
-#
-class DocField:
-
-    def __init__( self, name, lines ):
-
-        self.name  = name  # can be None for normal paragraphs/sources
-        self.items = []     # list of items
-
-        mode_none  = 0   # start parsing mode
-        mode_code  = 1   # parsing code sequences
-        mode_para  = 3   # parsing normal paragraph
-
-        margin     = -1  # current code sequence indentation
-        cur_lines  = []
-
-        # now analyze the markup lines to see if they contain paragraphs,
-        # code sequences or fields definitions
-        #
-        start = 0
-        mode  = mode_none
-        for l in lines:
-
-            # are we parsing a code sequence ?
-            if mode == mode_code:
-
-                m = re_code_end.match( l )
-                if m and len(m.group(1)) <= margin:
-                    # that's it, we finised the code sequence
-                    code = DocCode( 0, cur_lines )
-                    self.items.append( code )
-                    margin    = -1
-                    cur_lines = []
-                    mode      = mode_none
-                else:
-                    # nope, continue the code sequence
-                    cur_lines.append( l[margin:] )
-            else:
-                # start of code sequence ?
-                m = re_code_start.match( l )
-                if m:
-                    # save current lines
-                    if cur_lines:
-                        para = DocPara( cur_lines )
-                        self.items.append( para )
-                        cur_lines = []
-
-                    # switch to code extraction mode
-                    margin = len(m.group(1))
-                    mode   = mode_code
-
-                else:
-                    if not string.split( l ) and cur_lines:
-                        # if the line is empty, we end the current paragraph,
-                        # if any
-                        para = DocPara( cur_lines )
-                        self.items.append( para )
-                        cur_lines = []
-                    else:
-                        # otherwise, simply add the line to the current
-                        # paragraph
-                        cur_lines.append( l )
-
-        if mode == mode_code:
-            # unexpected end of code sequence
-            code = DocCode( margin, cur_lines )
-            self.items.append( code )
-
-        elif cur_lines:
-            para = DocPara( cur_lines )
-            self.items.append( para )
-
-    def dump( self, prefix = "" ):
-        if self.field:
-            print prefix + self.field + " ::"
-            prefix = prefix + "----"
-
-        first = 1
-        for p in self.items:
-            if not first:
-                print ""
-            p.dump( prefix )
-            first = 0
-
-
-# this regular expression is used to detect field definitions
-#
-re_field  = re.compile( r"\s*(\w*)\s*::" )
-
-
-
-class DocMarkup:
-
-    def __init__( self, tag, lines ):
-        self.tag       = string.lower(tag)
-        self.fields    = []
-
-        cur_lines = []
-        field     = None
-        mode      = 0
-
-        for l in lines:
-            m = re_field.match( l )
-            if m:
-                # we detected the start of a new field definition
-
-                # first, save the current one
-                if cur_lines:
-                    f = DocField( field, cur_lines )
-                    self.fields.append( f )
-                    cur_lines = []
-                    field     = None
-
-                field     = m.group(1)   # record field name
-                ln        = len(m.group(0))
-                l         = " "*ln + l[ln:]
-                cur_lines = [ l ]
-            else:
-                cur_lines.append( l )
-
-        if field or cur_lines:
-            f = DocField( field, cur_lines )
-            self.fields.append( f )
-
-    def get_name( self ):
-        try:
-            return self.fields[0].items[0].words[0]
-
-        except:
-            return None
-
-    def dump( self, margin ):
-        print " "*margin + "<" + self.tag + ">"
-        for f in self.fields:
-            f.dump( "  " )
-        print " "*margin + ""
-
-
-
-
-class DocChapter:
-
-    def __init__( self, block ):
-        self.block    = block
-        self.sections = []
-        if block:
-            self.name     = block.name
-            self.title    = block.get_markup_words( "title" )
-            self.order    = block.get_markup_words( "sections" )
-        else:
-            self.name     = "Other"
-            self.title    = string.split( "Miscellaneous" )
-            self.order    = []
-
-
-
-class DocSection:
-
-    def __init__( self, name = "Other" ):
-        self.name        = name
-        self.blocks      = {}
-        self.block_names = []  # ordered block names in section
-        self.defs        = []
-        self.abstract    = ""
-        self.description = ""
-        self.order       = []
-        self.title       = "ERROR"
-        self.chapter     = None
-
-    def add_def( self, block ):
-        self.defs.append( block )
-
-    def add_block( self, block ):
-        self.block_names.append( block.name )
-        self.blocks[ block.name ] = block
-
-    def process( self ):
-        # lookup one block that contains a valid section description
-        for block in self.defs:
-            title = block.get_markup_text( "Title" )
-            if title:
-                self.title       = title
-                self.abstract    = block.get_markup_words( "abstract" )
-                self.description = block.get_markup_items( "description" )
-                self.order       = block.get_markup_words( "order" )
-                return
-
-    def reorder( self ):
-
-        self.block_names = sort_order_list( self.block_names, self.order )
-
-
-class ContentProcessor:
-
-    def __init__( self ):
-        """initialize a block content processor"""
-        self.reset()
-
-        self.sections = {}    # dictionary of documentation sections
-        self.section  = None  # current documentation section
-
-        self.chapters = []        # list of chapters
-
-    def set_section( self, section_name ):
-        """set current section during parsing"""
-        if not self.sections.has_key( section_name ):
-            section = DocSection( section_name )
-            self.sections[ section_name ] = section
-            self.section                  = section
-        else:
-            self.section = self.sections[ section_name ]
-
-    def add_chapter( self, block ):
-        chapter = DocChapter( block )
-        self.chapters.append( chapter )
-
-
-    def reset( self ):
-        """reset the content processor for a new block"""
-        self.markups      = []
-        self.markup       = None
-        self.markup_lines = []
-
-    def add_markup( self ):
-        """add a new markup section"""
-        if self.markup and self.markup_lines:
-
-            # get rid of last line of markup if it's empty
-            marks = self.markup_lines
-            if len(marks) > 0 and not string.strip(marks[-1]):
-                self.markup_lines = marks[:-1]
-
-            m = DocMarkup( self.markup, self.markup_lines )
-
-            self.markups.append( m )
-
-            self.markup       = None
-            self.markup_lines = []
-
-
-    def process_content( self, content ):
-        """process a block content and return a list of DocMarkup objects
-           corresponding to it"""
-        markup       = None
-        markup_lines = []
-        first        = 1
-
-        for line in content:
-            found = None
-            for t in re_markup_tags:
-                m = t.match( line )
-                if m:
-                    found  = string.lower(m.group(1))
-                    prefix = len(m.group(0))
-                    line   = " "*prefix + line[prefix:]   # remove markup from line
-                    break
-
-            # is it the start of a new markup section ?
-            if found:
-                first = 0
-                self.add_markup()  # add current markup content
-                self.markup = found
-                if len(string.strip( line )) > 0:
-                    self.markup_lines.append( line )
-            elif first == 0:
-                self.markup_lines.append( line )
-
-        self.add_markup()
-
-        return self.markups
-
-
-    def  parse_sources( self, source_processor ):
-        blocks = source_processor.blocks
-        count  = len(blocks)
-        for n in range(count):
-
-            source = blocks[n]
-            if source.content:
-                # this is a documentation comment, we need to catch
-                # all following normal blocks in the "follow" list
-                #
-                follow = []
-                m = n+1
-                while m < count and not blocks[m].content:
-                    follow.append( blocks[m] )
-                    m = m+1
-
-                doc_block = DocBlock( source, follow, self )
-
-
-    def  finish( self ):
-
-        # process all sections to extract their abstract, description
-        # and ordered list of items
-        #
-        for sec in self.sections.values():
-            sec.process()
-
-        # process chapters to check that all sections are correctly
-        # listed there
-        for chap in self.chapters:
-            for sec in chap.order:
-                if self.sections.has_key(sec):
-                    section = self.sections[ sec ]
-                    section.chapter = chap
-                    section.reorder()
-                    chap.sections.append( section )
-                else:
-                    sys.stderr.write( "WARNING: chapter '" +
-                        chap.name + "' in " + chap.block.location() + \
-                        " lists unknown section '" + sec + "'\n" )
-
-        # check that all sections are in a chapter
-        #
-        others = []
-        for sec in self.sections.values():
-            if not sec.chapter:
-                others.append(sec)
-
-        # create a new special chapter for all remaining sections
-        # when necessary
-        #
-        if others:
-            chap = DocChapter( None )
-            chap.sections = others
-            self.chapters.append( chap )
-
-
-
-class DocBlock:
-
-    def __init__( self, source, follow, processor ):
-
-        processor.reset()
-
-        self.source    = source
-        self.code      = []
-        self.type      = "ERRTYPE"
-        self.name      = "ERRNAME"
-        self.section   = processor.section
-        self.markups   = processor.process_content( source.content )
-
-        # compute block type from first markup tag
-        try:
-            self.type = self.markups[0].tag
-        except:
-            pass
-
-
-        # compute block name from first markup paragraph
-        try:
-            markup = self.markups[0]
-            para   = markup.fields[0].items[0]
-            name   = para.words[0]
-            m = re_identifier.match( name )
-            if m:
-                name = m.group(1)
-            self.name = name
-        except:
-            pass
-
-        # detect new section starts
-        if self.type == "section":
-            processor.set_section( self.name )
-            processor.section.add_def( self )
-
-        # detect new chapter
-        elif self.type == "chapter":
-            processor.add_chapter( self )
-
-        else:
-            processor.section.add_block( self )
-
-        # now, compute the source lines relevant to this documentation
-        # block. We keep normal comments in for obvious reasons (??)
-        source = []
-        for b in follow:
-            if b.format:
-                break
-            for l in b.lines:
-                # we use "/* */" as a separator
-                if re_source_sep.match( l ):
-                    break
-                source.append( l )
-
-        # now strip the leading and trailing empty lines from the sources
-        start = 0
-        end   = len( source )-1
-
-        while start < end and not string.strip( source[start] ):
-            start = start + 1
-
-        while start < end and not string.strip( source[end] ):
-            end = end - 1
-
-        source = source[start:end+1]
-
-        self.code = source
-
-
-    def location( self ):
-        return self.source.location()
-
-
-
-    def get_markup( self, tag_name ):
-        """return the DocMarkup corresponding to a given tag in a block"""
-        for m in self.markups:
-            if m.tag == string.lower(tag_name):
-                return m
-        return None
-
-
-    def get_markup_name( self, tag_name ):
-        """return the name of a given primary markup in a block"""
-        try:
-            m = self.get_markup( tag_name )
-            return m.get_name()
-        except:
-            return None
-
-
-    def get_markup_words( self, tag_name ):
-        try:
-            m = self.get_markup( tag_name )
-            return m.fields[0].items[0].words
-        except:
-            return []
-
-
-    def get_markup_text( self, tag_name ):
-        result = self.get_markup_words( tag_name )
-        return string.join( result )
-
-
-    def get_markup_items( self, tag_name ):
-        try:
-            m = self.get_markup( tag_name )
-            return m.fields[0].items
-        except:
+#
+#  this file contains routines used to parse the content of documentation
+#  comment block and build a more structured objects out of them
+#
+
+from sources import *
+from utils import *
+import string, re
+
+
+# this regular expresion is used to detect code sequences. these
+# are simply code fragments embedded in '{' and '}' like in:
+#
+#  {
+#    x = y + z;
+#    if ( zookoo == 2 )
+#    {
+#      foobar();
+#    }
+#  }
+#
+# note that identation of the starting and ending accolades must be
+# exactly the same. the code sequence can contain accolades at greater
+# indentation
+#
+re_code_start = re.compile( r"(\s*){\s*$" )
+re_code_end   = re.compile( r"(\s*)}\s*$" )
+
+
+# this regular expression is used to isolate identifiers from
+# other text
+#
+re_identifier = re.compile( r'(\w*)' )
+
+
+#############################################################################
+#
+# The DocCode class is used to store source code lines.
+#
+#   'self.lines' contains a set of source code lines that will be dumped as
+#   HTML in a 
 tag.
+#
+#   The object is filled line by line by the parser; it strips the leading
+#   "margin" space from each input line before storing it in 'self.lines'.
+#
+class DocCode:
+
+    def __init__( self, margin, lines ):
+        self.lines  = []
+        self.words  = None
+
+        # remove margin spaces
+        for l in lines:
+            if string.strip( l[:margin] ) == "":
+                l = l[margin:]
+            self.lines.append( l )
+
+    def dump( self, prefix = "", width=60 ):
+        for l in self.lines:
+            print prefix + l
+
+
+#############################################################################
+#
+# The DocPara class is used to store "normal" text paragraph.
+#
+#   'self.words' contains the list of words that make up the paragraph
+#
+class DocPara:
+
+    def __init__( self, lines ):
+        self.lines = None
+        self.words = []
+        for l in lines:
+            l = string.strip(l)
+            self.words.extend( string.split( l ) )
+
+    def dump( self, prefix = "", width = 60 ):
+        cur  = ""  # current line
+        col  = 0   # current width
+
+        for word in self.words:
+            ln = len(word)
+            if col > 0:
+                ln = ln+1
+
+            if col + ln > width:
+                print prefix + cur
+                cur = word
+                col = len(word)
+            else:
+                if col > 0:
+                    cur = cur + " "
+                cur = cur + word
+                col = col + ln
+
+        if col > 0:
+            print prefix + cur
+
+
+
+#############################################################################
+#
+#  The DocField class is used to store a list containing either DocPara or
+#  DocCode objects. Each DocField also has an optional "name" which is used
+#  when the object corresponds to a field of value definition
+#
+class DocField:
+
+    def __init__( self, name, lines ):
+
+        self.name  = name  # can be None for normal paragraphs/sources
+        self.items = []     # list of items
+
+        mode_none  = 0   # start parsing mode
+        mode_code  = 1   # parsing code sequences
+        mode_para  = 3   # parsing normal paragraph
+
+        margin     = -1  # current code sequence indentation
+        cur_lines  = []
+
+        # now analyze the markup lines to see if they contain paragraphs,
+        # code sequences or fields definitions
+        #
+        start = 0
+        mode  = mode_none
+        for l in lines:
+
+            # are we parsing a code sequence ?
+            if mode == mode_code:
+
+                m = re_code_end.match( l )
+                if m and len(m.group(1)) <= margin:
+                    # that's it, we finised the code sequence
+                    code = DocCode( 0, cur_lines )
+                    self.items.append( code )
+                    margin    = -1
+                    cur_lines = []
+                    mode      = mode_none
+                else:
+                    # nope, continue the code sequence
+                    cur_lines.append( l[margin:] )
+            else:
+                # start of code sequence ?
+                m = re_code_start.match( l )
+                if m:
+                    # save current lines
+                    if cur_lines:
+                        para = DocPara( cur_lines )
+                        self.items.append( para )
+                        cur_lines = []
+
+                    # switch to code extraction mode
+                    margin = len(m.group(1))
+                    mode   = mode_code
+
+                else:
+                    if not string.split( l ) and cur_lines:
+                        # if the line is empty, we end the current paragraph,
+                        # if any
+                        para = DocPara( cur_lines )
+                        self.items.append( para )
+                        cur_lines = []
+                    else:
+                        # otherwise, simply add the line to the current
+                        # paragraph
+                        cur_lines.append( l )
+
+        if mode == mode_code:
+            # unexpected end of code sequence
+            code = DocCode( margin, cur_lines )
+            self.items.append( code )
+
+        elif cur_lines:
+            para = DocPara( cur_lines )
+            self.items.append( para )
+
+    def dump( self, prefix = "" ):
+        if self.field:
+            print prefix + self.field + " ::"
+            prefix = prefix + "----"
+
+        first = 1
+        for p in self.items:
+            if not first:
+                print ""
+            p.dump( prefix )
+            first = 0
+
+
+# this regular expression is used to detect field definitions
+#
+re_field  = re.compile( r"\s*(\w*)\s*::" )
+
+
+
+class DocMarkup:
+
+    def __init__( self, tag, lines ):
+        self.tag       = string.lower(tag)
+        self.fields    = []
+
+        cur_lines = []
+        field     = None
+        mode      = 0
+
+        for l in lines:
+            m = re_field.match( l )
+            if m:
+                # we detected the start of a new field definition
+
+                # first, save the current one
+                if cur_lines:
+                    f = DocField( field, cur_lines )
+                    self.fields.append( f )
+                    cur_lines = []
+                    field     = None
+
+                field     = m.group(1)   # record field name
+                ln        = len(m.group(0))
+                l         = " "*ln + l[ln:]
+                cur_lines = [ l ]
+            else:
+                cur_lines.append( l )
+
+        if field or cur_lines:
+            f = DocField( field, cur_lines )
+            self.fields.append( f )
+
+    def get_name( self ):
+        try:
+            return self.fields[0].items[0].words[0]
+
+        except:
+            return None
+
+    def dump( self, margin ):
+        print " "*margin + "<" + self.tag + ">"
+        for f in self.fields:
+            f.dump( "  " )
+        print " "*margin + ""
+
+
+
+
+class DocChapter:
+
+    def __init__( self, block ):
+        self.block    = block
+        self.sections = []
+        if block:
+            self.name     = block.name
+            self.title    = block.get_markup_words( "title" )
+            self.order    = block.get_markup_words( "sections" )
+        else:
+            self.name     = "Other"
+            self.title    = string.split( "Miscellaneous" )
+            self.order    = []
+
+
+
+class DocSection:
+
+    def __init__( self, name = "Other" ):
+        self.name        = name
+        self.blocks      = {}
+        self.block_names = []  # ordered block names in section
+        self.defs        = []
+        self.abstract    = ""
+        self.description = ""
+        self.order       = []
+        self.title       = "ERROR"
+        self.chapter     = None
+
+    def add_def( self, block ):
+        self.defs.append( block )
+
+    def add_block( self, block ):
+        self.block_names.append( block.name )
+        self.blocks[ block.name ] = block
+
+    def process( self ):
+        # lookup one block that contains a valid section description
+        for block in self.defs:
+            title = block.get_markup_text( "Title" )
+            if title:
+                self.title       = title
+                self.abstract    = block.get_markup_words( "abstract" )
+                self.description = block.get_markup_items( "description" )
+                self.order       = block.get_markup_words( "order" )
+                return
+
+    def reorder( self ):
+
+        self.block_names = sort_order_list( self.block_names, self.order )
+
+
+class ContentProcessor:
+
+    def __init__( self ):
+        """initialize a block content processor"""
+        self.reset()
+
+        self.sections = {}    # dictionary of documentation sections
+        self.section  = None  # current documentation section
+
+        self.chapters = []        # list of chapters
+
+    def set_section( self, section_name ):
+        """set current section during parsing"""
+        if not self.sections.has_key( section_name ):
+            section = DocSection( section_name )
+            self.sections[ section_name ] = section
+            self.section                  = section
+        else:
+            self.section = self.sections[ section_name ]
+
+    def add_chapter( self, block ):
+        chapter = DocChapter( block )
+        self.chapters.append( chapter )
+
+
+    def reset( self ):
+        """reset the content processor for a new block"""
+        self.markups      = []
+        self.markup       = None
+        self.markup_lines = []
+
+    def add_markup( self ):
+        """add a new markup section"""
+        if self.markup and self.markup_lines:
+
+            # get rid of last line of markup if it's empty
+            marks = self.markup_lines
+            if len(marks) > 0 and not string.strip(marks[-1]):
+                self.markup_lines = marks[:-1]
+
+            m = DocMarkup( self.markup, self.markup_lines )
+
+            self.markups.append( m )
+
+            self.markup       = None
+            self.markup_lines = []
+
+
+    def process_content( self, content ):
+        """process a block content and return a list of DocMarkup objects
+           corresponding to it"""
+        markup       = None
+        markup_lines = []
+        first        = 1
+
+        for line in content:
+            found = None
+            for t in re_markup_tags:
+                m = t.match( line )
+                if m:
+                    found  = string.lower(m.group(1))
+                    prefix = len(m.group(0))
+                    line   = " "*prefix + line[prefix:]   # remove markup from line
+                    break
+
+            # is it the start of a new markup section ?
+            if found:
+                first = 0
+                self.add_markup()  # add current markup content
+                self.markup = found
+                if len(string.strip( line )) > 0:
+                    self.markup_lines.append( line )
+            elif first == 0:
+                self.markup_lines.append( line )
+
+        self.add_markup()
+
+        return self.markups
+
+
+    def  parse_sources( self, source_processor ):
+        blocks = source_processor.blocks
+        count  = len(blocks)
+        for n in range(count):
+
+            source = blocks[n]
+            if source.content:
+                # this is a documentation comment, we need to catch
+                # all following normal blocks in the "follow" list
+                #
+                follow = []
+                m = n+1
+                while m < count and not blocks[m].content:
+                    follow.append( blocks[m] )
+                    m = m+1
+
+                doc_block = DocBlock( source, follow, self )
+
+
+    def  finish( self ):
+
+        # process all sections to extract their abstract, description
+        # and ordered list of items
+        #
+        for sec in self.sections.values():
+            sec.process()
+
+        # process chapters to check that all sections are correctly
+        # listed there
+        for chap in self.chapters:
+            for sec in chap.order:
+                if self.sections.has_key(sec):
+                    section = self.sections[ sec ]
+                    section.chapter = chap
+                    section.reorder()
+                    chap.sections.append( section )
+                else:
+                    sys.stderr.write( "WARNING: chapter '" +
+                        chap.name + "' in " + chap.block.location() + \
+                        " lists unknown section '" + sec + "'\n" )
+
+        # check that all sections are in a chapter
+        #
+        others = []
+        for sec in self.sections.values():
+            if not sec.chapter:
+                others.append(sec)
+
+        # create a new special chapter for all remaining sections
+        # when necessary
+        #
+        if others:
+            chap = DocChapter( None )
+            chap.sections = others
+            self.chapters.append( chap )
+
+
+
+class DocBlock:
+
+    def __init__( self, source, follow, processor ):
+
+        processor.reset()
+
+        self.source    = source
+        self.code      = []
+        self.type      = "ERRTYPE"
+        self.name      = "ERRNAME"
+        self.section   = processor.section
+        self.markups   = processor.process_content( source.content )
+
+        # compute block type from first markup tag
+        try:
+            self.type = self.markups[0].tag
+        except:
+            pass
+
+
+        # compute block name from first markup paragraph
+        try:
+            markup = self.markups[0]
+            para   = markup.fields[0].items[0]
+            name   = para.words[0]
+            m = re_identifier.match( name )
+            if m:
+                name = m.group(1)
+            self.name = name
+        except:
+            pass
+
+        # detect new section starts
+        if self.type == "section":
+            processor.set_section( self.name )
+            processor.section.add_def( self )
+
+        # detect new chapter
+        elif self.type == "chapter":
+            processor.add_chapter( self )
+
+        else:
+            processor.section.add_block( self )
+
+        # now, compute the source lines relevant to this documentation
+        # block. We keep normal comments in for obvious reasons (??)
+        source = []
+        for b in follow:
+            if b.format:
+                break
+            for l in b.lines:
+                # we use "/* */" as a separator
+                if re_source_sep.match( l ):
+                    break
+                source.append( l )
+
+        # now strip the leading and trailing empty lines from the sources
+        start = 0
+        end   = len( source )-1
+
+        while start < end and not string.strip( source[start] ):
+            start = start + 1
+
+        while start < end and not string.strip( source[end] ):
+            end = end - 1
+
+        source = source[start:end+1]
+
+        self.code = source
+
+
+    def location( self ):
+        return self.source.location()
+
+
+
+    def get_markup( self, tag_name ):
+        """return the DocMarkup corresponding to a given tag in a block"""
+        for m in self.markups:
+            if m.tag == string.lower(tag_name):
+                return m
+        return None
+
+
+    def get_markup_name( self, tag_name ):
+        """return the name of a given primary markup in a block"""
+        try:
+            m = self.get_markup( tag_name )
+            return m.get_name()
+        except:
+            return None
+
+
+    def get_markup_words( self, tag_name ):
+        try:
+            m = self.get_markup( tag_name )
+            return m.fields[0].items[0].words
+        except:
+            return []
+
+
+    def get_markup_text( self, tag_name ):
+        result = self.get_markup_words( tag_name )
+        return string.join( result )
+
+
+    def get_markup_items( self, tag_name ):
+        try:
+            m = self.get_markup( tag_name )
+            return m.fields[0].items
+        except:
             return None
\ No newline at end of file
diff --git a/src/libs/freetype2/tools/docmaker/docmaker.py b/src/libs/freetype2/tools/docmaker/docmaker.py
index 285bcd6a21..bf2fa8b0d2 100644
--- a/src/libs/freetype2/tools/docmaker/docmaker.py
+++ b/src/libs/freetype2/tools/docmaker/docmaker.py
@@ -1,149 +1,149 @@
-#!/usr/bin/env python
-#
-#  DocMaker 0.2 (c) 2002 David Turner 
-#
-# This program is a re-write of the original DocMaker took used
-# to generate the API Reference of the FreeType font engine
-# by converting in-source comments into structured HTML
-#
-# This new version is capable of outputting XML data, as well
-# as accepts more liberal formatting options
-#
-# It also uses regular expression matching and substitution
-# to speed things significantly
-#
-
-from sources   import *
-from content   import *
-from utils     import *
-from formatter import *
-from tohtml    import *
-
-import utils
-
-import sys, os, time, string, glob, getopt
-
-
-def file_exists( pathname ):
-    """checks that a given file exists"""
-    result = 1
-    try:
-        file = open( pathname, "r" )
-        file.close()
-    except:
-        result = None
-        sys.stderr.write( pathname + " couldn't be accessed\n" )
-
-    return result
-
-
-def make_file_list( args = None ):
-    """builds a list of input files from command-line arguments"""
-
-    file_list = []
-    # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' )
-
-    if not args:
-        args = sys.argv[1 :]
-
-    for pathname in args:
-        if string.find( pathname, '*' ) >= 0:
-            newpath = glob.glob( pathname )
-            newpath.sort()  # sort files -- this is important because
-                            # of the order of files
-        else:
-            newpath = [pathname]
-            
-        file_list.extend( newpath )
-
-    if len( file_list ) == 0:
-        file_list = None
-    else:
-        # now filter the file list to remove non-existing ones
-        file_list = filter( file_exists, file_list )
-    
-    return file_list
-
-
-
-def usage():
-    print "\nDocMaker 0.2 Usage information\n"
-    print "  docmaker [options] file1 [ file2 ... ]\n"
-    print "using the following options:\n"
-    print "  -h : print this page"
-    print "  -t : set project title, as in '-t \"My Project\"'"
-    print "  -o : set output directory, as in '-o mydir'"
-    print "  -p : set documentation prefix, as in '-p ft2'"
-    print ""
-    print "  --title  : same as -t, as in '--title=\"My Project\"'"
-    print "  --output : same as -o, as in '--output=mydir'"
-    print "  --prefix : same as -p, as in '--prefix=ft2'"
-    
-
-def main( argv ):
-    """main program loop"""
-
-    global output_dir
-
-    try:
-        opts, args = getopt.getopt( sys.argv[1:],
-                                    "ht:o:p:",
-                                    [ "help", "title=", "output=", "prefix=" ] )
-
-    except getopt.GetoptError:
-        usage()
-        sys.exit( 2 )
-
-    if args == []:
-        usage()
-        sys.exit( 1 )
-
-    # process options
-    #
-    project_title  = "Project"
-    project_prefix = None
-    output_dir     = None
-
-    for opt in opts:
-        if opt[0] in ( "-h", "--help" ):
-            usage()
-            sys.exit( 0 )
-
-        if opt[0] in ( "-t", "--title" ):
-            project_title = opt[1]
-
-        if opt[0] in ( "-o", "--output" ):
-            utils.output_dir = opt[1]
-
-        if opt[0] in ( "-p", "--prefix" ):
-            project_prefix = opt[1]
-
-    check_output( )
-
-    # create context and processor
-    source_processor  = SourceProcessor()
-    content_processor = ContentProcessor()
-
-    # retrieve the list of files to process
-    file_list = make_file_list( args )
-    for filename in file_list:
-        source_processor.parse_file( filename )
-        content_processor.parse_sources( source_processor )
-        
-    # process sections
-    content_processor.finish()
-
-    formatter = HtmlFormatter( content_processor, project_title, project_prefix )
-
-    formatter.toc_dump()
-    formatter.index_dump()
-    formatter.section_dump_all()
-
-
-# if called from the command line
-#
-if __name__ == '__main__':
-    main( sys.argv )
-
-
-# eof
+#!/usr/bin/env python
+#
+#  DocMaker 0.2 (c) 2002 David Turner 
+#
+# This program is a re-write of the original DocMaker took used
+# to generate the API Reference of the FreeType font engine
+# by converting in-source comments into structured HTML
+#
+# This new version is capable of outputting XML data, as well
+# as accepts more liberal formatting options
+#
+# It also uses regular expression matching and substitution
+# to speed things significantly
+#
+
+from sources   import *
+from content   import *
+from utils     import *
+from formatter import *
+from tohtml    import *
+
+import utils
+
+import sys, os, time, string, glob, getopt
+
+
+def file_exists( pathname ):
+    """checks that a given file exists"""
+    result = 1
+    try:
+        file = open( pathname, "r" )
+        file.close()
+    except:
+        result = None
+        sys.stderr.write( pathname + " couldn't be accessed\n" )
+
+    return result
+
+
+def make_file_list( args = None ):
+    """builds a list of input files from command-line arguments"""
+
+    file_list = []
+    # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' )
+
+    if not args:
+        args = sys.argv[1 :]
+
+    for pathname in args:
+        if string.find( pathname, '*' ) >= 0:
+            newpath = glob.glob( pathname )
+            newpath.sort()  # sort files -- this is important because
+                            # of the order of files
+        else:
+            newpath = [pathname]
+            
+        file_list.extend( newpath )
+
+    if len( file_list ) == 0:
+        file_list = None
+    else:
+        # now filter the file list to remove non-existing ones
+        file_list = filter( file_exists, file_list )
+    
+    return file_list
+
+
+
+def usage():
+    print "\nDocMaker 0.2 Usage information\n"
+    print "  docmaker [options] file1 [ file2 ... ]\n"
+    print "using the following options:\n"
+    print "  -h : print this page"
+    print "  -t : set project title, as in '-t \"My Project\"'"
+    print "  -o : set output directory, as in '-o mydir'"
+    print "  -p : set documentation prefix, as in '-p ft2'"
+    print ""
+    print "  --title  : same as -t, as in '--title=\"My Project\"'"
+    print "  --output : same as -o, as in '--output=mydir'"
+    print "  --prefix : same as -p, as in '--prefix=ft2'"
+    
+
+def main( argv ):
+    """main program loop"""
+
+    global output_dir
+
+    try:
+        opts, args = getopt.getopt( sys.argv[1:],
+                                    "ht:o:p:",
+                                    [ "help", "title=", "output=", "prefix=" ] )
+
+    except getopt.GetoptError:
+        usage()
+        sys.exit( 2 )
+
+    if args == []:
+        usage()
+        sys.exit( 1 )
+
+    # process options
+    #
+    project_title  = "Project"
+    project_prefix = None
+    output_dir     = None
+
+    for opt in opts:
+        if opt[0] in ( "-h", "--help" ):
+            usage()
+            sys.exit( 0 )
+
+        if opt[0] in ( "-t", "--title" ):
+            project_title = opt[1]
+
+        if opt[0] in ( "-o", "--output" ):
+            utils.output_dir = opt[1]
+
+        if opt[0] in ( "-p", "--prefix" ):
+            project_prefix = opt[1]
+
+    check_output( )
+
+    # create context and processor
+    source_processor  = SourceProcessor()
+    content_processor = ContentProcessor()
+
+    # retrieve the list of files to process
+    file_list = make_file_list( args )
+    for filename in file_list:
+        source_processor.parse_file( filename )
+        content_processor.parse_sources( source_processor )
+        
+    # process sections
+    content_processor.finish()
+
+    formatter = HtmlFormatter( content_processor, project_title, project_prefix )
+
+    formatter.toc_dump()
+    formatter.index_dump()
+    formatter.section_dump_all()
+
+
+# if called from the command line
+#
+if __name__ == '__main__':
+    main( sys.argv )
+
+
+# eof
diff --git a/src/libs/freetype2/tools/docmaker/formatter.py b/src/libs/freetype2/tools/docmaker/formatter.py
index 36d72aeca0..67d620b12a 100644
--- a/src/libs/freetype2/tools/docmaker/formatter.py
+++ b/src/libs/freetype2/tools/docmaker/formatter.py
@@ -1,194 +1,194 @@
-from sources import *
-from content import *
-from utils   import *
-
-class Formatter:
-
-    def __init__( self, processor ):
-
-        self.processor   = processor
-        self.identifiers = {}
-        self.chapters    = processor.chapters
-        self.sections    = processor.sections.values()
-        self.block_index = []
-
-        # store all blocks in a dictionary
-        self.blocks      = []
-        for section in self.sections:
-            for block in section.blocks.values():
-                self.add_identifier( block.name, block )
-                    
-                # add enumeration values to the index, since this is useful
-                for markup in block.markups:
-                    if markup.tag == 'values':
-                        for field in markup.fields:
-                            self.add_identifier( field.name, block )
-
-
-        self.block_index = self.identifiers.keys()
-        self.block_index.sort( index_sort )
-
-
-    def add_identifier( self, name, block ):
-        if self.identifiers.has_key( name ):
-            # duplicate name !!
-            sys.stderr.write( \
-               "WARNING: duplicate definition for '" + name + "' in " + \
-               block.location() + ", previous definition in " +         \
-               self.identifiers[ name ].location() + "\n" )
-        else:
-            self.identifiers[name] = block
-              
-
-    #
-    #  Formatting the table of contents
-    #
-
-    def  toc_enter( self ):
-        pass
-    
-    def  toc_chapter_enter( self, chapter ):
-        pass
-    
-    def  toc_section_enter( self, section ):
-        pass
-        
-    def  toc_section_exit( self, section ):
-        pass
-        
-    def  toc_chapter_exit( self, chapter ):
-        pass
-
-    def  toc_index( self, index_filename ):
-        pass
-    
-    def  toc_exit( self ):
-        pass
-
-    def  toc_dump( self, toc_filename = None, index_filename = None ):
-        
-        output = None
-        if toc_filename:
-            output = open_output( toc_filename )
-        
-        self.toc_enter()
-    
-        for chap in self.processor.chapters:
-    
-            self.toc_chapter_enter( chap )
-    
-            for section in chap.sections:
-                self.toc_section_enter( section )
-                self.toc_section_exit( section )
-    
-            self.toc_chapter_exit ( chap )
-    
-        self.toc_index( index_filename )
-    
-        self.toc_exit()
-
-        if output:
-            close_output( output )
-    
-    #
-    #  Formatting the index
-    #
-
-    def  index_enter( self ):
-        pass
-
-    def  index_name_enter( self, name ):
-        pass
-
-    def  index_name_exit( self, name ):
-        pass
-
-    def  index_exit( self ):
-        pass
-
-    def  index_dump( self, index_filename = None ):
-        
-        output = None
-        if index_filename:
-            output = open_output( index_filename )
-
-        self.index_enter()
-
-        for name in self.block_index:
-            self.index_name_enter( name )
-            self.index_name_exit ( name )
-
-        self.index_exit()
-     
-        if output:
-            close_output( output )
-     
-    #
-    #  Formatting a section
-    #
-    def  section_enter( self, section ):
-        pass
-    
-    def  block_enter( self, block ):
-        pass
-    
-    def  markup_enter( self, markup, block = None ):
-        pass
-    
-    def  field_enter( self, field, markup = None, block = None ):
-        pass
-        
-    def  field_exit( self, field, markup = None, block = None ):
-        pass
-    
-    def  markup_exit( self, markup, block = None ):
-        pass
-        
-    def  block_exit( self, block ):
-        pass
-
-    def  section_exit( self, section ):
-        pass
-
-
-    def  section_dump( self, section, section_filename = None ):
-        
-        output = None
-        if section_filename:
-            output = open_output( section_filename )
-        
-        self.section_enter( section )
-
-        for name in section.block_names:
-            block = self.identifiers[ name ]
-            self.block_enter( block )
-
-            for markup in block.markups[1:]:   # always ignore first markup !!
-                self.markup_enter( markup, block )
-
-                for field in markup.fields:
-                    self.field_enter( field, markup, block )
-
-                    self.field_exit ( field, markup, block )
-
-                self.markup_exit( markup, block )
-
-            self.block_exit( block )
-
-        self.section_exit ( section )
-
-        if output:
-            close_output( output )
-
-
-    def section_dump_all( self ):
-        for section in self.sections:
-            self.section_dump( section )
-
-    #
-    #  Formatting a block
-    #
-
-
-
-
+from sources import *
+from content import *
+from utils   import *
+
+class Formatter:
+
+    def __init__( self, processor ):
+
+        self.processor   = processor
+        self.identifiers = {}
+        self.chapters    = processor.chapters
+        self.sections    = processor.sections.values()
+        self.block_index = []
+
+        # store all blocks in a dictionary
+        self.blocks      = []
+        for section in self.sections:
+            for block in section.blocks.values():
+                self.add_identifier( block.name, block )
+                    
+                # add enumeration values to the index, since this is useful
+                for markup in block.markups:
+                    if markup.tag == 'values':
+                        for field in markup.fields:
+                            self.add_identifier( field.name, block )
+
+
+        self.block_index = self.identifiers.keys()
+        self.block_index.sort( index_sort )
+
+
+    def add_identifier( self, name, block ):
+        if self.identifiers.has_key( name ):
+            # duplicate name !!
+            sys.stderr.write( \
+               "WARNING: duplicate definition for '" + name + "' in " + \
+               block.location() + ", previous definition in " +         \
+               self.identifiers[ name ].location() + "\n" )
+        else:
+            self.identifiers[name] = block
+              
+
+    #
+    #  Formatting the table of contents
+    #
+
+    def  toc_enter( self ):
+        pass
+    
+    def  toc_chapter_enter( self, chapter ):
+        pass
+    
+    def  toc_section_enter( self, section ):
+        pass
+        
+    def  toc_section_exit( self, section ):
+        pass
+        
+    def  toc_chapter_exit( self, chapter ):
+        pass
+
+    def  toc_index( self, index_filename ):
+        pass
+    
+    def  toc_exit( self ):
+        pass
+
+    def  toc_dump( self, toc_filename = None, index_filename = None ):
+        
+        output = None
+        if toc_filename:
+            output = open_output( toc_filename )
+        
+        self.toc_enter()
+    
+        for chap in self.processor.chapters:
+    
+            self.toc_chapter_enter( chap )
+    
+            for section in chap.sections:
+                self.toc_section_enter( section )
+                self.toc_section_exit( section )
+    
+            self.toc_chapter_exit ( chap )
+    
+        self.toc_index( index_filename )
+    
+        self.toc_exit()
+
+        if output:
+            close_output( output )
+    
+    #
+    #  Formatting the index
+    #
+
+    def  index_enter( self ):
+        pass
+
+    def  index_name_enter( self, name ):
+        pass
+
+    def  index_name_exit( self, name ):
+        pass
+
+    def  index_exit( self ):
+        pass
+
+    def  index_dump( self, index_filename = None ):
+        
+        output = None
+        if index_filename:
+            output = open_output( index_filename )
+
+        self.index_enter()
+
+        for name in self.block_index:
+            self.index_name_enter( name )
+            self.index_name_exit ( name )
+
+        self.index_exit()
+     
+        if output:
+            close_output( output )
+     
+    #
+    #  Formatting a section
+    #
+    def  section_enter( self, section ):
+        pass
+    
+    def  block_enter( self, block ):
+        pass
+    
+    def  markup_enter( self, markup, block = None ):
+        pass
+    
+    def  field_enter( self, field, markup = None, block = None ):
+        pass
+        
+    def  field_exit( self, field, markup = None, block = None ):
+        pass
+    
+    def  markup_exit( self, markup, block = None ):
+        pass
+        
+    def  block_exit( self, block ):
+        pass
+
+    def  section_exit( self, section ):
+        pass
+
+
+    def  section_dump( self, section, section_filename = None ):
+        
+        output = None
+        if section_filename:
+            output = open_output( section_filename )
+        
+        self.section_enter( section )
+
+        for name in section.block_names:
+            block = self.identifiers[ name ]
+            self.block_enter( block )
+
+            for markup in block.markups[1:]:   # always ignore first markup !!
+                self.markup_enter( markup, block )
+
+                for field in markup.fields:
+                    self.field_enter( field, markup, block )
+
+                    self.field_exit ( field, markup, block )
+
+                self.markup_exit( markup, block )
+
+            self.block_exit( block )
+
+        self.section_exit ( section )
+
+        if output:
+            close_output( output )
+
+
+    def section_dump_all( self ):
+        for section in self.sections:
+            self.section_dump( section )
+
+    #
+    #  Formatting a block
+    #
+
+
+
+
diff --git a/src/libs/freetype2/tools/docmaker/sources.py b/src/libs/freetype2/tools/docmaker/sources.py
index 9828aa6421..5145ba5ed2 100644
--- a/src/libs/freetype2/tools/docmaker/sources.py
+++ b/src/libs/freetype2/tools/docmaker/sources.py
@@ -1,355 +1,355 @@
-#
-# this file contains definitions of classes needed to decompose
-# C sources files into a series of multi-line "blocks". There are
-# two kinds of blocks:
-#
-#   - normal blocks, which contain source code or ordinary comments
-#
-#   - documentation blocks, which have restricted formatting, and
-#     whose text always start with a documentation markup tag like
-#     "", "", etc..
-#
-# the routines used to process the content of documentation blocks
-# are not contained here, but in "content.py"
-#
-# the classes and methods found here only deal with text parsing
-# and basic documentation block extraction
-#
-import fileinput, re, sys, os, string
-
-
-
-
-
-
-################################################################
-##
-##  BLOCK FORMAT PATTERN
-##
-##   A simple class containing compiled regular expressions used
-##   to detect potential documentation format block comments within
-##   C source code
-##
-##   note that the 'column' pattern must contain a group that will
-##   be used to "unbox" the content of documentation comment blocks
-##
-class SourceBlockFormat:
-
-    def __init__( self, id, start, column, end ):
-        """create a block pattern, used to recognize special documentation blocks"""
-
-        self.id     = id
-        self.start  = re.compile( start, re.VERBOSE )
-        self.column = re.compile( column, re.VERBOSE )
-        self.end    = re.compile( end, re.VERBOSE )
-
-
-
-#
-# format 1 documentation comment blocks look like the following:
-#
-#    /************************************/
-#    /*                                  */
-#    /*                                  */
-#    /*                                  */
-#    /************************************/
-#
-# we define a few regular expressions here to detect them
-#
-
-start = r'''
-  \s*       # any number of whitespace
-  /\*{2,}/  # followed by '/' and at least two asterisks then '/'
-  \s*$      # eventually followed by whitespace
-'''
-
-column = r'''
-  \s*      # any number of whitespace
-  /\*{1}   # followed by '/' and precisely one asterisk
-  ([^*].*) # followed by anything (group 1)
-  \*{1}/   # followed by one asterisk and a '/'
-  \s*$     # enventually followed by whitespace
-'''
-
-re_source_block_format1 = SourceBlockFormat( 1, start, column, start )
-
-#
-# format 2 documentation comment blocks look like the following:
-#
-#    /************************************ (at least 2 asterisks)
-#     *
-#     *
-#     *
-#     *
-#     **/       (1 or more asterisks at the end)
-#
-# we define a few regular expressions here to detect them
-#
-start = r'''
-  \s*     # any number of whitespace
-  /\*{2,} # followed by '/' and at least two asterisks
-  \s*$    # eventually followed by whitespace
-'''
-
-column = r'''
-  \s*         # any number of whitespace
-  \*{1}       # followed by precisely one asterisk
-  (.*)        # then anything (group1)
-'''
-
-end = r'''
-  \s*     # any number of whitespace
-  \*+/    # followed by at least one asterisk, then '/'
-'''
-
-re_source_block_format2 = SourceBlockFormat( 2, start, column, end )
-
-#
-# the list of supported documentation block formats, we could add new ones
-# relatively easily
-#
-re_source_block_formats = [ re_source_block_format1, re_source_block_format2 ]
-
-
-#
-# the following regular expressions corresponds to markup tags
-# within the documentation comment blocks. they're equivalent
-# despite their different syntax
-#
-# notice how each markup tag _must_ begin a new line
-#
-re_markup_tag1 = re.compile( r'''\s*<(\w*)>''' )  #  format
-re_markup_tag2 = re.compile( r'''\s*@(\w*):''' )  # @xxxx: format
-
-#
-# the list of supported markup tags, we could add new ones relatively
-# easily
-#
-re_markup_tags = [ re_markup_tag1, re_markup_tag2 ]
-
-#
-# used to detect a cross-reference, after markup tags have been stripped
-#
-re_crossref = re.compile( r'@(\w*)' )
-
-#
-# used to detect italic and bold styles in paragraph text
-#
-re_italic = re.compile( r'_(\w+)_' )
-re_bold   = re.compile( r'\*(\w+)\*' )
-
-#
-# used to detect the end of commented source lines
-#
-re_source_sep = re.compile( r'\s*/\*\s*\*/' )
-
-#
-# used to perform cross-reference within source output
-#
-re_source_crossref = re.compile( r'(\W*)(\w*)' )
-
-#
-# a list of reserved source keywords
-#
-re_source_keywords = re.compile( '''( typedef |
-                                       struct |
-                                       enum   |
-                                       union  |
-                                       const  |
-                                       char   |
-                                       int    |
-                                       short  |
-                                       long   |
-                                       void   |
-                                       signed |
-                                       unsigned |
-                                       \#include |
-                                       \#define  |
-                                       \#undef   |
-                                       \#if      |
-                                       \#ifdef   |
-                                       \#ifndef  |
-                                       \#else    |
-                                       \#endif   )''', re.VERBOSE )
-
-################################################################
-##
-##  SOURCE BLOCK CLASS
-##
-##   A SourceProcessor is in charge or reading a C source file
-##   and decomposing it into a series of different "SourceBlocks".
-##   each one of these blocks can be made of the following data:
-##
-##   - A documentation comment block that starts with "/**" and
-##     whose exact format will be discussed later
-##
-##   - normal sources lines, include comments
-##
-##   the important fields in a text block are the following ones:
-##
-##     self.lines   : a list of text lines for the corresponding block
-##
-##     self.content : for documentation comment blocks only, this is the
-##                    block content that has been "unboxed" from its
-##                    decoration. This is None for all other blocks
-##                    (i.e. sources or ordinary comments with no starting
-##                     markup tag)
-##
-class SourceBlock:
-    def __init__( self, processor, filename, lineno, lines ):
-        self.processor = processor
-        self.filename  = filename
-        self.lineno    = lineno
-        self.lines     = lines
-        self.format    = processor.format
-        self.content   = []
-
-        if self.format == None:
-            return
-
-        words = []
-
-        # extract comment lines
-        lines = []
-
-        for line0 in self.lines[1:]:
-            m = self.format.column.match( line0 )
-            if m:
-                lines.append( m.group(1) )
-
-        # now, look for a markup tag
-        for l in lines:
-            l = string.strip(l)
-            if len(l) > 0:
-                for tag in re_markup_tags:
-                    if tag.match( l ):
-                        self.content = lines
-                return
-
-    def location( self ):
-        return "(" + self.filename + ":" + repr(self.lineno) + ")"
-
-
-    # debugging only - not used in normal operations
-    def dump( self ):
-
-        if self.content:
-            print "{{{content start---"
-            for l in self.content:
-                print l
-            print "---content end}}}"
-            return
-
-        fmt = ""
-        if self.format:
-            fmt = repr(self.format.id) + " "
-
-        for line in self.lines:
-            print line
-
-
-################################################################
-##
-##  SOURCE PROCESSOR CLASS
-##
-##   The SourceProcessor is in charge or reading a C source file
-##   and decomposing it into a series of different "SourceBlock"
-##   objects.
-##
-##   each one of these blocks can be made of the following data:
-##
-##   - A documentation comment block that starts with "/**" and
-##     whose exact format will be discussed later
-##
-##   - normal sources lines, include comments
-##
-##
-class SourceProcessor:
-
-    def  __init__( self ):
-        """initialize a source processor"""
-        self.blocks   = []
-        self.filename = None
-        self.format   = None
-        self.lines    = []
-
-    def  reset( self ):
-        """reset a block processor, clean all its blocks"""
-        self.blocks = []
-        self.format = None
-
-
-    def  parse_file( self, filename ):
-        """parse a C source file, and adds its blocks to the processor's list"""
-
-        self.reset()
-
-        self.filename = filename
-
-        fileinput.close()
-        self.format    = None
-        self.lineno    = 0
-        self.lines     = []
-
-        for line in fileinput.input( filename ):
-
-            # strip trailing newlines, important on Windows machines !!
-            if  line[-1] == '\012':
-                line = line[0:-1]
-
-            if self.format == None:
-                self.process_normal_line( line )
-
-            else:
-                if self.format.end.match( line ):
-                    # that's a normal block end, add it to lines and
-                    # create a new block
-                    # self.lines.append( line )
-                    self.add_block_lines()
-
-                elif self.format.column.match( line ):
-                    # that's a normal column line, add it to 'lines'
-                    self.lines.append( line )
-
-                else:
-                    # humm.. this is an unexcepted block end,
-                    # create a new block, but don't process the line
-                    self.add_block_lines()
-
-                    # we need to process the line again
-                    self.process_normal_line( line )
-
-        # record the last lines
-        self.add_block_lines()
-
-
-
-    def process_normal_line( self, line ):
-        """process a normal line and check if it's the start of a new block"""
-        for f in re_source_block_formats:
-          if f.start.match( line ):
-            self.add_block_lines()
-            self.format = f
-            self.lineno = fileinput.filelineno()
-
-        self.lines.append( line )
-
-
-
-    def add_block_lines( self ):
-        """add the current accumulated lines, and create a new block"""
-        if self.lines != []:
-            block = SourceBlock( self, self.filename, self.lineno, self.lines )
-
-            self.blocks.append( block )
-            self.format = None
-            self.lines  = []
-
-
-    # debugging only, not used in normal operations
-    def dump( self ):
-        """print all blocks in a processor"""
-        for b in self.blocks:
-            b.dump()
-
-# eof
+#
+# this file contains definitions of classes needed to decompose
+# C sources files into a series of multi-line "blocks". There are
+# two kinds of blocks:
+#
+#   - normal blocks, which contain source code or ordinary comments
+#
+#   - documentation blocks, which have restricted formatting, and
+#     whose text always start with a documentation markup tag like
+#     "", "", etc..
+#
+# the routines used to process the content of documentation blocks
+# are not contained here, but in "content.py"
+#
+# the classes and methods found here only deal with text parsing
+# and basic documentation block extraction
+#
+import fileinput, re, sys, os, string
+
+
+
+
+
+
+################################################################
+##
+##  BLOCK FORMAT PATTERN
+##
+##   A simple class containing compiled regular expressions used
+##   to detect potential documentation format block comments within
+##   C source code
+##
+##   note that the 'column' pattern must contain a group that will
+##   be used to "unbox" the content of documentation comment blocks
+##
+class SourceBlockFormat:
+
+    def __init__( self, id, start, column, end ):
+        """create a block pattern, used to recognize special documentation blocks"""
+
+        self.id     = id
+        self.start  = re.compile( start, re.VERBOSE )
+        self.column = re.compile( column, re.VERBOSE )
+        self.end    = re.compile( end, re.VERBOSE )
+
+
+
+#
+# format 1 documentation comment blocks look like the following:
+#
+#    /************************************/
+#    /*                                  */
+#    /*                                  */
+#    /*                                  */
+#    /************************************/
+#
+# we define a few regular expressions here to detect them
+#
+
+start = r'''
+  \s*       # any number of whitespace
+  /\*{2,}/  # followed by '/' and at least two asterisks then '/'
+  \s*$      # eventually followed by whitespace
+'''
+
+column = r'''
+  \s*      # any number of whitespace
+  /\*{1}   # followed by '/' and precisely one asterisk
+  ([^*].*) # followed by anything (group 1)
+  \*{1}/   # followed by one asterisk and a '/'
+  \s*$     # enventually followed by whitespace
+'''
+
+re_source_block_format1 = SourceBlockFormat( 1, start, column, start )
+
+#
+# format 2 documentation comment blocks look like the following:
+#
+#    /************************************ (at least 2 asterisks)
+#     *
+#     *
+#     *
+#     *
+#     **/       (1 or more asterisks at the end)
+#
+# we define a few regular expressions here to detect them
+#
+start = r'''
+  \s*     # any number of whitespace
+  /\*{2,} # followed by '/' and at least two asterisks
+  \s*$    # eventually followed by whitespace
+'''
+
+column = r'''
+  \s*         # any number of whitespace
+  \*{1}       # followed by precisely one asterisk
+  (.*)        # then anything (group1)
+'''
+
+end = r'''
+  \s*     # any number of whitespace
+  \*+/    # followed by at least one asterisk, then '/'
+'''
+
+re_source_block_format2 = SourceBlockFormat( 2, start, column, end )
+
+#
+# the list of supported documentation block formats, we could add new ones
+# relatively easily
+#
+re_source_block_formats = [ re_source_block_format1, re_source_block_format2 ]
+
+
+#
+# the following regular expressions corresponds to markup tags
+# within the documentation comment blocks. they're equivalent
+# despite their different syntax
+#
+# notice how each markup tag _must_ begin a new line
+#
+re_markup_tag1 = re.compile( r'''\s*<(\w*)>''' )  #  format
+re_markup_tag2 = re.compile( r'''\s*@(\w*):''' )  # @xxxx: format
+
+#
+# the list of supported markup tags, we could add new ones relatively
+# easily
+#
+re_markup_tags = [ re_markup_tag1, re_markup_tag2 ]
+
+#
+# used to detect a cross-reference, after markup tags have been stripped
+#
+re_crossref = re.compile( r'@(\w*)' )
+
+#
+# used to detect italic and bold styles in paragraph text
+#
+re_italic = re.compile( r'_(\w+)_' )
+re_bold   = re.compile( r'\*(\w+)\*' )
+
+#
+# used to detect the end of commented source lines
+#
+re_source_sep = re.compile( r'\s*/\*\s*\*/' )
+
+#
+# used to perform cross-reference within source output
+#
+re_source_crossref = re.compile( r'(\W*)(\w*)' )
+
+#
+# a list of reserved source keywords
+#
+re_source_keywords = re.compile( '''( typedef |
+                                       struct |
+                                       enum   |
+                                       union  |
+                                       const  |
+                                       char   |
+                                       int    |
+                                       short  |
+                                       long   |
+                                       void   |
+                                       signed |
+                                       unsigned |
+                                       \#include |
+                                       \#define  |
+                                       \#undef   |
+                                       \#if      |
+                                       \#ifdef   |
+                                       \#ifndef  |
+                                       \#else    |
+                                       \#endif   )''', re.VERBOSE )
+
+################################################################
+##
+##  SOURCE BLOCK CLASS
+##
+##   A SourceProcessor is in charge or reading a C source file
+##   and decomposing it into a series of different "SourceBlocks".
+##   each one of these blocks can be made of the following data:
+##
+##   - A documentation comment block that starts with "/**" and
+##     whose exact format will be discussed later
+##
+##   - normal sources lines, include comments
+##
+##   the important fields in a text block are the following ones:
+##
+##     self.lines   : a list of text lines for the corresponding block
+##
+##     self.content : for documentation comment blocks only, this is the
+##                    block content that has been "unboxed" from its
+##                    decoration. This is None for all other blocks
+##                    (i.e. sources or ordinary comments with no starting
+##                     markup tag)
+##
+class SourceBlock:
+    def __init__( self, processor, filename, lineno, lines ):
+        self.processor = processor
+        self.filename  = filename
+        self.lineno    = lineno
+        self.lines     = lines
+        self.format    = processor.format
+        self.content   = []
+
+        if self.format == None:
+            return
+
+        words = []
+
+        # extract comment lines
+        lines = []
+
+        for line0 in self.lines[1:]:
+            m = self.format.column.match( line0 )
+            if m:
+                lines.append( m.group(1) )
+
+        # now, look for a markup tag
+        for l in lines:
+            l = string.strip(l)
+            if len(l) > 0:
+                for tag in re_markup_tags:
+                    if tag.match( l ):
+                        self.content = lines
+                return
+
+    def location( self ):
+        return "(" + self.filename + ":" + repr(self.lineno) + ")"
+
+
+    # debugging only - not used in normal operations
+    def dump( self ):
+
+        if self.content:
+            print "{{{content start---"
+            for l in self.content:
+                print l
+            print "---content end}}}"
+            return
+
+        fmt = ""
+        if self.format:
+            fmt = repr(self.format.id) + " "
+
+        for line in self.lines:
+            print line
+
+
+################################################################
+##
+##  SOURCE PROCESSOR CLASS
+##
+##   The SourceProcessor is in charge or reading a C source file
+##   and decomposing it into a series of different "SourceBlock"
+##   objects.
+##
+##   each one of these blocks can be made of the following data:
+##
+##   - A documentation comment block that starts with "/**" and
+##     whose exact format will be discussed later
+##
+##   - normal sources lines, include comments
+##
+##
+class SourceProcessor:
+
+    def  __init__( self ):
+        """initialize a source processor"""
+        self.blocks   = []
+        self.filename = None
+        self.format   = None
+        self.lines    = []
+
+    def  reset( self ):
+        """reset a block processor, clean all its blocks"""
+        self.blocks = []
+        self.format = None
+
+
+    def  parse_file( self, filename ):
+        """parse a C source file, and adds its blocks to the processor's list"""
+
+        self.reset()
+
+        self.filename = filename
+
+        fileinput.close()
+        self.format    = None
+        self.lineno    = 0
+        self.lines     = []
+
+        for line in fileinput.input( filename ):
+
+            # strip trailing newlines, important on Windows machines !!
+            if  line[-1] == '\012':
+                line = line[0:-1]
+
+            if self.format == None:
+                self.process_normal_line( line )
+
+            else:
+                if self.format.end.match( line ):
+                    # that's a normal block end, add it to lines and
+                    # create a new block
+                    # self.lines.append( line )
+                    self.add_block_lines()
+
+                elif self.format.column.match( line ):
+                    # that's a normal column line, add it to 'lines'
+                    self.lines.append( line )
+
+                else:
+                    # humm.. this is an unexcepted block end,
+                    # create a new block, but don't process the line
+                    self.add_block_lines()
+
+                    # we need to process the line again
+                    self.process_normal_line( line )
+
+        # record the last lines
+        self.add_block_lines()
+
+
+
+    def process_normal_line( self, line ):
+        """process a normal line and check if it's the start of a new block"""
+        for f in re_source_block_formats:
+          if f.start.match( line ):
+            self.add_block_lines()
+            self.format = f
+            self.lineno = fileinput.filelineno()
+
+        self.lines.append( line )
+
+
+
+    def add_block_lines( self ):
+        """add the current accumulated lines, and create a new block"""
+        if self.lines != []:
+            block = SourceBlock( self, self.filename, self.lineno, self.lines )
+
+            self.blocks.append( block )
+            self.format = None
+            self.lines  = []
+
+
+    # debugging only, not used in normal operations
+    def dump( self ):
+        """print all blocks in a processor"""
+        for b in self.blocks:
+            b.dump()
+
+# eof
diff --git a/src/libs/freetype2/tools/docmaker/tohtml.py b/src/libs/freetype2/tools/docmaker/tohtml.py
index 75e5db0689..5b8f31b726 100644
--- a/src/libs/freetype2/tools/docmaker/tohtml.py
+++ b/src/libs/freetype2/tools/docmaker/tohtml.py
@@ -1,476 +1,476 @@
-from sources import *
-from content import *
-from formatter import *
-
-import time
-
-# The following defines the HTML header used by all generated pages.
-#
-html_header_1 = """\
-
-
-""" - -html_header_2= """ API Reference - - -
- -

""" - -html_header_3=""" API Reference

-""" - - - -# The HTML footer used by all generated pages. -# -html_footer = """\ - -""" - -# The header and footer used for each section. -# -section_title_header = "

" -section_title_footer = "

" - -# The header and footer used for code segments. -# -code_header = "
"
-code_footer = "
" - -# Paragraph header and footer. -# -para_header = "

" -para_footer = "

" - -# Block header and footer. -# -block_header = "
" -block_footer = "

" - -# Description header/footer. -# -description_header = "
" -description_footer = "

" - -# Marker header/inter/footer combination. -# -marker_header = "
" -marker_inter = "
" -marker_footer = "
" - -# Source code extracts header/footer. -# -source_header = "
\n"
-source_footer = "\n

" - -# Chapter header/inter/footer. -# -chapter_header = "

" -chapter_inter = "

    " -chapter_footer = "
" - - -# source language keyword coloration/styling -# -keyword_prefix = '' -keyword_suffix = '' - -section_synopsis_header = '

Synopsys

' -section_synopsis_footer = '' - -# Translate a single line of source to HTML. This will convert -# a "<" into "<.", ">" into ">.", etc. -# -def html_quote( line ): - result = string.replace( line, "&", "&" ) - result = string.replace( result, "<", "<" ) - result = string.replace( result, ">", ">" ) - return result - - -# same as 'html_quote', but ignores left and right brackets -# -def html_quote0( line ): - return string.replace( line, "&", "&" ) - - -def dump_html_code( lines, prefix = "" ): - # clean the last empty lines - # - l = len( self.lines ) - while l > 0 and string.strip( self.lines[l - 1] ) == "": - l = l - 1 - - # The code footer should be directly appended to the last code - # line to avoid an additional blank line. - # - print prefix + code_header, - for line in self.lines[0 : l+1]: - print '\n' + prefix + html_quote(line), - print prefix + code_footer, - - - -class HtmlFormatter(Formatter): - - def __init__( self, processor, project_title, file_prefix ): - - Formatter.__init__( self, processor ) - - global html_header_1, html_header_2, html_header_3, html_footer - - if file_prefix: - file_prefix = file_prefix + "-" - else: - file_prefix = "" - - self.project_title = project_title - self.file_prefix = file_prefix - self.html_header = html_header_1 + project_title + html_header_2 + \ - project_title + html_header_3 - - self.html_footer = "

generated on " + \ - time.asctime( time.localtime( time.time() ) ) + \ - "

" + html_footer - - self.columns = 3 - - def make_section_url( self, section ): - return self.file_prefix + section.name + ".html" - - - def make_block_url( self, block ): - return self.make_section_url( block.section ) + "#" + block.name - - - def make_html_words( self, words ): - """ convert a series of simple words into some HTML text """ - line = "" - if words: - line = html_quote( words[0] ) - for w in words[1:]: - line = line + " " + html_quote( w ) - - return line - - - def make_html_word( self, word ): - """analyze a simple word to detect cross-references and styling""" - # look for cross-references - # - m = re_crossref.match( word ) - if m: - try: - name = m.group(1) - block = self.identifiers[ name ] - url = self.make_block_url( block ) - return '' + name + '' - except: - return '?' + name + '?' - - # look for italics and bolds - m = re_italic.match( word ) - if m: - name = m.group(1) - return ''+name+'' - - m = re_bold.match( word ) - if m: - name = m.group(1) - return ''+name+'' - - return html_quote(word) - - - def make_html_para( self, words ): - """ convert a paragraph's words into tagged HTML text, handle xrefs """ - line = "" - if words: - line = self.make_html_word( words[0] ) - for word in words[1:]: - line = line + " " + self.make_html_word( word ) - - return "

" + line + "

" - - - def make_html_code( self, lines ): - """ convert a code sequence to HTML """ - line = code_header + '\n' - for l in lines: - line = line + html_quote( l ) + '\n' - - return line + code_footer - - - def make_html_items( self, items ): - """ convert a field's content into some valid HTML """ - lines = [] - for item in items: - if item.lines: - lines.append( self.make_html_code( item.lines ) ) - else: - lines.append( self.make_html_para( item.words ) ) - - return string.join( lines, '\n' ) - - - def print_html_items( self, items ): - print self.make_html_items( items ) - - - def print_html_field( self, field ): - if field.name: - print "
"+field.name+"" - - print self.make_html_items( field.items ) - - if field.name: - print "
" - - - def html_source_quote( self, line, block_name = None ): - result = "" - while line: - m = re_source_crossref.match( line ) - if m: - name = m.group(2) - prefix = html_quote( m.group(1) ) - length = len( m.group(0) ) - - if name == block_name: - # this is the current block name, if any - result = result + prefix + '' + name + '' - - elif re_source_keywords.match(name): - # this is a C keyword - result = result + prefix + keyword_prefix + name + keyword_suffix - - elif self.identifiers.has_key(name): - # this is a known identifier - block = self.identifiers[name] - result = result + prefix + '' + name + '' - else: - result = result + html_quote(line[ : length ]) - - line = line[ length : ] - else: - result = result + html_quote(line) - line = [] - - return result - - - def print_html_field_list( self, fields ): - print "" - for field in fields: - print "" - print "
" + field.name + "" - self.print_html_items( field.items ) - print "
" - - - def print_html_markup( self, markup ): - table_fields = [] - for field in markup.fields: - if field.name: - # we begin a new series of field or value definitions, we - # will record them in the 'table_fields' list before outputting - # all of them as a single table - # - table_fields.append( field ) - - else: - if table_fields: - self.print_html_field_list( table_fields ) - table_fields = [] - - self.print_html_items( field.items ) - - if table_fields: - self.print_html_field_list( table_fields ) - - # - # Formatting the index - # - - def index_enter( self ): - print self.html_header - self.index_items = {} - - def index_name_enter( self, name ): - block = self.identifiers[ name ] - url = self.make_block_url( block ) - self.index_items[ name ] = url - - def index_exit( self ): - - # block_index already contains the sorted list of index names - count = len( self.block_index ) - rows = (count + self.columns - 1)/self.columns - - print "
" - for r in range(rows): - line = "" - for c in range(self.columns): - i = r + c*rows - if i < count: - bname = self.block_index[ r + c*rows ] - url = self.index_items[ bname ] - line = line + '' - else: - line = line + '' - line = line + "" - print line - - print "
' + bname + '
" - print self.html_footer - self.index_items = {} - - def index_dump( self, index_filename = None ): - - if index_filename == None: - index_filename = self.file_prefix + "index.html" - - Formatter.index_dump( self, index_filename ) - - # - # Formatting the table of content - # - def toc_enter( self ): - print self.html_header - print "

Table of Contents

" - - def toc_chapter_enter( self, chapter ): - print chapter_header + string.join(chapter.title) + chapter_inter - print "" - - def toc_section_enter( self, section ): - print "" - - def toc_chapter_exit( self, chapter ): - print "
" - print '' + \ - section.title + '' - - print self.make_html_para( section.abstract ) - - def toc_section_exit( self, section ): - print "
" - print chapter_footer - - def toc_index( self, index_filename ): - print chapter_header + 'Global Index' + chapter_inter + chapter_footer - - def toc_exit( self ): - print "" - print self.html_footer - - def toc_dump( self, toc_filename = None, index_filename = None ): - if toc_filename == None: - toc_filename = self.file_prefix + "toc.html" - - if index_filename == None: - index_filename = self.file_prefix + "index.html" - - Formatter.toc_dump( self, toc_filename, index_filename ) - - # - # Formatting sections - # - def section_enter( self, section ): - print self.html_header - - print section_title_header - print section.title - print section_title_footer - - # print section synopsys - print section_synopsis_header - print "
" - - maxwidth = 0 - for b in section.blocks.values(): - if len(b.name) > maxwidth: - maxwidth = len(b.name) - - width = 70 # XXX magic number - columns = width / maxwidth - if columns < 1: - columns = 1 - - count = len(section.block_names) - rows = (count + columns-1)/columns - for r in range(rows): - line = "" - for c in range(columns): - i = r + c*rows - line = line + '' - line = line + "" - print line - - print "
' - if i < count: - name = section.block_names[i] - line = line + '' + name + '' - - line = line + '


" - print section_synopsis_footer - - print description_header - print self.make_html_items( section.description ) - print description_footer - - def block_enter( self, block ): - print block_header - - # place html anchor if needed - if block.name: - print '' - print "

" + block.name + "

" - print "
" - - # dump the block C source lines now - if block.code: - print source_header - for l in block.code: - print self.html_source_quote( l, block.name ) - print source_footer - - - def markup_enter( self, markup, block ): - if markup.tag == "description": - print description_header - else: - print marker_header + markup.tag + marker_inter - - self.print_html_markup( markup ) - - def markup_exit( self, markup, block ): - if markup.tag == "description": - print description_footer - else: - print marker_footer - - def block_exit( self, block ): - print block_footer - - - def section_exit( self, section ): - print html_footer - - - def section_dump_all( self ): - for section in self.sections: - self.section_dump( section, self.file_prefix + section.name + '.html' ) +from sources import * +from content import * +from formatter import * + +import time + +# The following defines the HTML header used by all generated pages. +# +html_header_1 = """\ + +
+""" + +html_header_2= """ API Reference + + +
+ +

""" + +html_header_3=""" API Reference

+""" + + + +# The HTML footer used by all generated pages. +# +html_footer = """\ + +""" + +# The header and footer used for each section. +# +section_title_header = "

" +section_title_footer = "

" + +# The header and footer used for code segments. +# +code_header = "
"
+code_footer = "
" + +# Paragraph header and footer. +# +para_header = "

" +para_footer = "

" + +# Block header and footer. +# +block_header = "
" +block_footer = "

" + +# Description header/footer. +# +description_header = "
" +description_footer = "

" + +# Marker header/inter/footer combination. +# +marker_header = "
" +marker_inter = "
" +marker_footer = "
" + +# Source code extracts header/footer. +# +source_header = "
\n"
+source_footer = "\n

" + +# Chapter header/inter/footer. +# +chapter_header = "

" +chapter_inter = "

    " +chapter_footer = "
" + + +# source language keyword coloration/styling +# +keyword_prefix = '' +keyword_suffix = '' + +section_synopsis_header = '

Synopsys

' +section_synopsis_footer = '' + +# Translate a single line of source to HTML. This will convert +# a "<" into "<.", ">" into ">.", etc. +# +def html_quote( line ): + result = string.replace( line, "&", "&" ) + result = string.replace( result, "<", "<" ) + result = string.replace( result, ">", ">" ) + return result + + +# same as 'html_quote', but ignores left and right brackets +# +def html_quote0( line ): + return string.replace( line, "&", "&" ) + + +def dump_html_code( lines, prefix = "" ): + # clean the last empty lines + # + l = len( self.lines ) + while l > 0 and string.strip( self.lines[l - 1] ) == "": + l = l - 1 + + # The code footer should be directly appended to the last code + # line to avoid an additional blank line. + # + print prefix + code_header, + for line in self.lines[0 : l+1]: + print '\n' + prefix + html_quote(line), + print prefix + code_footer, + + + +class HtmlFormatter(Formatter): + + def __init__( self, processor, project_title, file_prefix ): + + Formatter.__init__( self, processor ) + + global html_header_1, html_header_2, html_header_3, html_footer + + if file_prefix: + file_prefix = file_prefix + "-" + else: + file_prefix = "" + + self.project_title = project_title + self.file_prefix = file_prefix + self.html_header = html_header_1 + project_title + html_header_2 + \ + project_title + html_header_3 + + self.html_footer = "

generated on " + \ + time.asctime( time.localtime( time.time() ) ) + \ + "

" + html_footer + + self.columns = 3 + + def make_section_url( self, section ): + return self.file_prefix + section.name + ".html" + + + def make_block_url( self, block ): + return self.make_section_url( block.section ) + "#" + block.name + + + def make_html_words( self, words ): + """ convert a series of simple words into some HTML text """ + line = "" + if words: + line = html_quote( words[0] ) + for w in words[1:]: + line = line + " " + html_quote( w ) + + return line + + + def make_html_word( self, word ): + """analyze a simple word to detect cross-references and styling""" + # look for cross-references + # + m = re_crossref.match( word ) + if m: + try: + name = m.group(1) + block = self.identifiers[ name ] + url = self.make_block_url( block ) + return '' + name + '' + except: + return '?' + name + '?' + + # look for italics and bolds + m = re_italic.match( word ) + if m: + name = m.group(1) + return ''+name+'' + + m = re_bold.match( word ) + if m: + name = m.group(1) + return ''+name+'' + + return html_quote(word) + + + def make_html_para( self, words ): + """ convert a paragraph's words into tagged HTML text, handle xrefs """ + line = "" + if words: + line = self.make_html_word( words[0] ) + for word in words[1:]: + line = line + " " + self.make_html_word( word ) + + return "

" + line + "

" + + + def make_html_code( self, lines ): + """ convert a code sequence to HTML """ + line = code_header + '\n' + for l in lines: + line = line + html_quote( l ) + '\n' + + return line + code_footer + + + def make_html_items( self, items ): + """ convert a field's content into some valid HTML """ + lines = [] + for item in items: + if item.lines: + lines.append( self.make_html_code( item.lines ) ) + else: + lines.append( self.make_html_para( item.words ) ) + + return string.join( lines, '\n' ) + + + def print_html_items( self, items ): + print self.make_html_items( items ) + + + def print_html_field( self, field ): + if field.name: + print "
"+field.name+"" + + print self.make_html_items( field.items ) + + if field.name: + print "
" + + + def html_source_quote( self, line, block_name = None ): + result = "" + while line: + m = re_source_crossref.match( line ) + if m: + name = m.group(2) + prefix = html_quote( m.group(1) ) + length = len( m.group(0) ) + + if name == block_name: + # this is the current block name, if any + result = result + prefix + '' + name + '' + + elif re_source_keywords.match(name): + # this is a C keyword + result = result + prefix + keyword_prefix + name + keyword_suffix + + elif self.identifiers.has_key(name): + # this is a known identifier + block = self.identifiers[name] + result = result + prefix + '' + name + '' + else: + result = result + html_quote(line[ : length ]) + + line = line[ length : ] + else: + result = result + html_quote(line) + line = [] + + return result + + + def print_html_field_list( self, fields ): + print "" + for field in fields: + print "" + print "
" + field.name + "" + self.print_html_items( field.items ) + print "
" + + + def print_html_markup( self, markup ): + table_fields = [] + for field in markup.fields: + if field.name: + # we begin a new series of field or value definitions, we + # will record them in the 'table_fields' list before outputting + # all of them as a single table + # + table_fields.append( field ) + + else: + if table_fields: + self.print_html_field_list( table_fields ) + table_fields = [] + + self.print_html_items( field.items ) + + if table_fields: + self.print_html_field_list( table_fields ) + + # + # Formatting the index + # + + def index_enter( self ): + print self.html_header + self.index_items = {} + + def index_name_enter( self, name ): + block = self.identifiers[ name ] + url = self.make_block_url( block ) + self.index_items[ name ] = url + + def index_exit( self ): + + # block_index already contains the sorted list of index names + count = len( self.block_index ) + rows = (count + self.columns - 1)/self.columns + + print "
" + for r in range(rows): + line = "" + for c in range(self.columns): + i = r + c*rows + if i < count: + bname = self.block_index[ r + c*rows ] + url = self.index_items[ bname ] + line = line + '' + else: + line = line + '' + line = line + "" + print line + + print "
' + bname + '
" + print self.html_footer + self.index_items = {} + + def index_dump( self, index_filename = None ): + + if index_filename == None: + index_filename = self.file_prefix + "index.html" + + Formatter.index_dump( self, index_filename ) + + # + # Formatting the table of content + # + def toc_enter( self ): + print self.html_header + print "

Table of Contents

" + + def toc_chapter_enter( self, chapter ): + print chapter_header + string.join(chapter.title) + chapter_inter + print "" + + def toc_section_enter( self, section ): + print "" + + def toc_chapter_exit( self, chapter ): + print "
" + print '' + \ + section.title + '' + + print self.make_html_para( section.abstract ) + + def toc_section_exit( self, section ): + print "
" + print chapter_footer + + def toc_index( self, index_filename ): + print chapter_header + 'Global Index' + chapter_inter + chapter_footer + + def toc_exit( self ): + print "" + print self.html_footer + + def toc_dump( self, toc_filename = None, index_filename = None ): + if toc_filename == None: + toc_filename = self.file_prefix + "toc.html" + + if index_filename == None: + index_filename = self.file_prefix + "index.html" + + Formatter.toc_dump( self, toc_filename, index_filename ) + + # + # Formatting sections + # + def section_enter( self, section ): + print self.html_header + + print section_title_header + print section.title + print section_title_footer + + # print section synopsys + print section_synopsis_header + print "
" + + maxwidth = 0 + for b in section.blocks.values(): + if len(b.name) > maxwidth: + maxwidth = len(b.name) + + width = 70 # XXX magic number + columns = width / maxwidth + if columns < 1: + columns = 1 + + count = len(section.block_names) + rows = (count + columns-1)/columns + for r in range(rows): + line = "" + for c in range(columns): + i = r + c*rows + line = line + '' + line = line + "" + print line + + print "
' + if i < count: + name = section.block_names[i] + line = line + '' + name + '' + + line = line + '


" + print section_synopsis_footer + + print description_header + print self.make_html_items( section.description ) + print description_footer + + def block_enter( self, block ): + print block_header + + # place html anchor if needed + if block.name: + print '' + print "

" + block.name + "

" + print "
" + + # dump the block C source lines now + if block.code: + print source_header + for l in block.code: + print self.html_source_quote( l, block.name ) + print source_footer + + + def markup_enter( self, markup, block ): + if markup.tag == "description": + print description_header + else: + print marker_header + markup.tag + marker_inter + + self.print_html_markup( markup ) + + def markup_exit( self, markup, block ): + if markup.tag == "description": + print description_footer + else: + print marker_footer + + def block_exit( self, block ): + print block_footer + + + def section_exit( self, section ): + print html_footer + + + def section_dump_all( self ): + for section in self.sections: + self.section_dump( section, self.file_prefix + section.name + '.html' ) \ No newline at end of file diff --git a/src/libs/freetype2/tools/docmaker/utils.py b/src/libs/freetype2/tools/docmaker/utils.py index 6d4653db52..6c6715d9b3 100644 --- a/src/libs/freetype2/tools/docmaker/utils.py +++ b/src/libs/freetype2/tools/docmaker/utils.py @@ -1,87 +1,87 @@ -import string, sys, os - -# current output directory -# -output_dir = None - - -# This function is used to sort the index. It is a simple lexicographical -# sort, except that it places capital letters before lowercase ones. -# -def index_sort( s1, s2 ): - if not s1: - return -1 - - if not s2: - return 1 - - l1 = len( s1 ) - l2 = len( s2 ) - m1 = string.lower( s1 ) - m2 = string.lower( s2 ) - - for i in range( l1 ): - if i >= l2 or m1[i] > m2[i]: - return 1 - - if m1[i] < m2[i]: - return -1 - - if s1[i] < s2[i]: - return -1 - - if s1[i] > s2[i]: - return 1 - - if l2 > l1: - return -1 - - return 0 - -# Sort input_list, placing the elements of order_list in front. -# -def sort_order_list( input_list, order_list ): - new_list = order_list[:] - for id in input_list: - if not id in order_list: - new_list.append( id ) - return new_list - - - -# Open the standard output to a given project documentation file. Use -# "output_dir" to determine the filename location if necessary and save the -# old stdout in a tuple that is returned by this function. -# -def open_output( filename ): - global output_dir - - if output_dir and output_dir != "": - filename = output_dir + os.sep + filename - - old_stdout = sys.stdout - new_file = open( filename, "w" ) - sys.stdout = new_file - - return ( new_file, old_stdout ) - - -# Close the output that was returned by "close_output". -# -def close_output( output ): - output[0].close() - sys.stdout = output[1] - - -# Check output directory. -# -def check_output( ): - global output_dir - if output_dir: - if output_dir != "": - if not os.path.isdir( output_dir ): - sys.stderr.write( "argument" + " '" + output_dir + "' " + - "is not a valid directory" ) - sys.exit( 2 ) - else: - output_dir = None +import string, sys, os + +# current output directory +# +output_dir = None + + +# This function is used to sort the index. It is a simple lexicographical +# sort, except that it places capital letters before lowercase ones. +# +def index_sort( s1, s2 ): + if not s1: + return -1 + + if not s2: + return 1 + + l1 = len( s1 ) + l2 = len( s2 ) + m1 = string.lower( s1 ) + m2 = string.lower( s2 ) + + for i in range( l1 ): + if i >= l2 or m1[i] > m2[i]: + return 1 + + if m1[i] < m2[i]: + return -1 + + if s1[i] < s2[i]: + return -1 + + if s1[i] > s2[i]: + return 1 + + if l2 > l1: + return -1 + + return 0 + +# Sort input_list, placing the elements of order_list in front. +# +def sort_order_list( input_list, order_list ): + new_list = order_list[:] + for id in input_list: + if not id in order_list: + new_list.append( id ) + return new_list + + + +# Open the standard output to a given project documentation file. Use +# "output_dir" to determine the filename location if necessary and save the +# old stdout in a tuple that is returned by this function. +# +def open_output( filename ): + global output_dir + + if output_dir and output_dir != "": + filename = output_dir + os.sep + filename + + old_stdout = sys.stdout + new_file = open( filename, "w" ) + sys.stdout = new_file + + return ( new_file, old_stdout ) + + +# Close the output that was returned by "close_output". +# +def close_output( output ): + output[0].close() + sys.stdout = output[1] + + +# Check output directory. +# +def check_output( ): + global output_dir + if output_dir: + if output_dir != "": + if not os.path.isdir( output_dir ): + sys.stderr.write( "argument" + " '" + output_dir + "' " + + "is not a valid directory" ) + sys.exit( 2 ) + else: + output_dir = None diff --git a/src/libs/freetype2/tools/glnames.py b/src/libs/freetype2/tools/glnames.py index e377cd0d32..e8a835447a 100755 --- a/src/libs/freetype2/tools/glnames.py +++ b/src/libs/freetype2/tools/glnames.py @@ -1,1722 +1,1722 @@ -#!/usr/bin/env python -# - -# -# FreeType 2 glyph name 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. - - -"""\ - -usage: %s - - This very simple python script is used to generate 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 - - -# This table is used to name the glyph according to the Macintosh -# specification. It is used by the TrueType Postscript names table -# -# see http://fonts.apple.com/TTRefMan/RM06/Chap6post.html -# for the official list -# -mac_standard_names = \ -[ - # 0 - ".notdef", ".null", "nonmarkingreturn", "space", "exclam", - "quotedbl", "numbersign", "dollar", "percent", "ampersand", - - # 10 - "quotesingle", "parenleft", "parenright", "asterisk", "plus", - "comma", "hyphen", "period", "slash", "zero", - - # 20 - "one", "two", "three", "four", "five", - "six", "seven", "eight", "nine", "colon", - - # 30 - "semicolon", "less", "equal", "greater", "question", - "at", "A", "B", "C", "D", - - # 40 - "E", "F", "G", "H", "I", - "J", "K", "L", "M", "N", - - # 50 - "O", "P", "Q", "R", "S", - "T", "U", "V", "W", "X", - - # 60 - "Y", "Z", "bracketleft", "backslash", "bracketright", - "asciicircum", "underscore", "grave", "a", "b", - - # 70 - "c", "d", "e", "f", "g", - "h", "i", "j", "k", "l", - - # 80 - "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", - - # 90 - "w", "x", "y", "z", "braceleft", - "bar", "braceright", "asciitilde", "Adieresis", "Aring", - - # 100 - "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", - "aacute", "agrave", "acircumflex", "adieresis", "atilde", - - # 110 - "aring", "ccedilla", "eacute", "egrave", "ecircumflex", - "edieresis", "iacute", "igrave", "icircumflex", "idieresis", - - # 120 - "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", - "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", - - # 130 - "dagger", "degree", "cent", "sterling", "section", - "bullet", "paragraph", "germandbls", "registered", "copyright", - - # 140 - "trademark", "acute", "dieresis", "notequal", "AE", - "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", - - # 150 - "yen", "mu", "partialdiff", "summation", "product", - "pi", "integral", "ordfeminine", "ordmasculine", "Omega", - - # 160 - "ae", "oslash", "questiondown", "exclamdown", "logicalnot", - "radical", "florin", "approxequal", "Delta", "guillemotleft", - - # 170 - "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", - "Otilde", "OE", "oe", "endash", "emdash", - - # 180 - "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", - "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", - - # 190 - "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", - "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", - "Acircumflex", - - # 200 - "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", - "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", - - # 210 - "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", - "dotlessi", "circumflex", "tilde", "macron", "breve", - - # 220 - "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", - "caron", "Lslash", "lslash", "Scaron", "scaron", - - # 230 - "Zcaron", "zcaron", "brokenbar", "Eth", "eth", - "Yacute", "yacute", "Thorn", "thorn", "minus", - - # 240 - "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", - "onequarter", "threequarters", "franc", "Gbreve", "gbreve", - - # 250 - "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", - "Ccaron", "ccaron", "dcroat" -] - - -# 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 -# -sid_standard_names = \ -[ - # 0 - ".notdef", "space", "exclam", "quotedbl", "numbersign", - "dollar", "percent", "ampersand", "quoteright", "parenleft", - - # 10 - "parenright", "asterisk", "plus", "comma", "hyphen", - "period", "slash", "zero", "one", "two", - - # 20 - "three", "four", "five", "six", "seven", - "eight", "nine", "colon", "semicolon", "less", - - # 30 - "equal", "greater", "question", "at", "A", - "B", "C", "D", "E", "F", - - # 40 - "G", "H", "I", "J", "K", - "L", "M", "N", "O", "P", - - # 50 - "Q", "R", "S", "T", "U", - "V", "W", "X", "Y", "Z", - - # 60 - "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", - "quoteleft", "a", "b", "c", "d", - - # 70 - "e", "f", "g", "h", "i", - "j", "k", "l", "m", "n", - - # 80 - "o", "p", "q", "r", "s", - "t", "u", "v", "w", "x", - - # 90 - "y", "z", "braceleft", "bar", "braceright", - "asciitilde", "exclamdown", "cent", "sterling", "fraction", - - # 100 - "yen", "florin", "section", "currency", "quotesingle", - "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", - - # 110 - "fl", "endash", "dagger", "daggerdbl", "periodcentered", - "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", - - # 120 - "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", - "acute", "circumflex", "tilde", "macron", "breve", - - # 130 - "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", - "ogonek", "caron", "emdash", "AE", "ordfeminine", - - # 140 - "Lslash", "Oslash", "OE", "ordmasculine", "ae", - "dotlessi", "lslash", "oslash", "oe", "germandbls", - - # 150 - "onesuperior", "logicalnot", "mu", "trademark", "Eth", - "onehalf", "plusminus", "Thorn", "onequarter", "divide", - - # 160 - "brokenbar", "degree", "thorn", "threequarters", "twosuperior", - "registered", "minus", "eth", "multiply", "threesuperior", - - # 170 - "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", - "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", - - # 180 - "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", - "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", - - # 190 - "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", - "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", - - # 200 - "aacute", "acircumflex", "adieresis", "agrave", "aring", - "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", - - # 210 - "egrave", "iacute", "icircumflex", "idieresis", "igrave", - "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", - - # 220 - "otilde", "scaron", "uacute", "ucircumflex", "udieresis", - "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", - - # 230 - "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", - "Acutesmall", - "parenleftsuperior", "parenrightsuperior", "twodotenleader", - "onedotenleader", "zerooldstyle", - - # 240 - "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", - "commasuperior", - - # 250 - "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", - "bsuperior", - "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", - - # 260 - "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", - "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", - - # 270 - "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", - "Asmall", - "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", - - # 280 - "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", - "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", - - # 290 - "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", - "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", - - # 300 - "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", - "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", - "Dieresissmall", - - # 310 - "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", - "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", - "questiondownsmall", - - # 320 - "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", - "twothirds", "zerosuperior", "foursuperior", "fivesuperior", - "sixsuperior", - - # 330 - "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", - "oneinferior", - "twoinferior", "threeinferior", "fourinferior", "fiveinferior", - "sixinferior", - - # 340 - "seveninferior", "eightinferior", "nineinferior", "centinferior", - "dollarinferior", - "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", - "Acircumflexsmall", - - # 350 - "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", - "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", - "Igravesmall", - - # 360 - "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", - "Ntildesmall", - "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", - "Odieresissmall", - - # 370 - "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", - "Ucircumflexsmall", - "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", - "001.000", - - # 380 - "001.001", "001.002", "001.003", "Black", "Bold", - "Book", "Light", "Medium", "Regular", "Roman", - - # 390 - "Semibold" -] - - -# this table maps character code of the Adobe Standard Type 1 -# encoding to glyph indexes in the sid_standard_names table -# -t1_standard_encoding = \ -[ - 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 -] - - -# this table maps character code of the Adobe Expert Type 1 -# encoding to glyph indexes in the sid_standard_names table -# -t1_expert_encoding = \ -[ - 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 data has been taken literally from the file `glyphlist.txt', -# version 1.2, 22 Oct 1998. It is available from -# -# http://partners.adobe.com/asn/developer/typeforum/unicodegn.html -# -adobe_glyph_list = """\ -0041;A;LATIN CAPITAL LETTER A -00C6;AE;LATIN CAPITAL LETTER AE -01FC;AEacute;LATIN CAPITAL LETTER AE WITH ACUTE -F7E6;AEsmall;LATIN SMALL CAPITAL LETTER AE -00C1;Aacute;LATIN CAPITAL LETTER A WITH ACUTE -F7E1;Aacutesmall;LATIN SMALL CAPITAL LETTER A WITH ACUTE -0102;Abreve;LATIN CAPITAL LETTER A WITH BREVE -00C2;Acircumflex;LATIN CAPITAL LETTER A WITH CIRCUMFLEX -F7E2;Acircumflexsmall;LATIN SMALL CAPITAL LETTER A WITH CIRCUMFLEX -F6C9;Acute;CAPITAL ACUTE ACCENT -F7B4;Acutesmall;SMALL CAPITAL ACUTE ACCENT -00C4;Adieresis;LATIN CAPITAL LETTER A WITH DIAERESIS -F7E4;Adieresissmall;LATIN SMALL CAPITAL LETTER A WITH DIAERESIS -00C0;Agrave;LATIN CAPITAL LETTER A WITH GRAVE -F7E0;Agravesmall;LATIN SMALL CAPITAL LETTER A WITH GRAVE -0391;Alpha;GREEK CAPITAL LETTER ALPHA -0386;Alphatonos;GREEK CAPITAL LETTER ALPHA WITH TONOS -0100;Amacron;LATIN CAPITAL LETTER A WITH MACRON -0104;Aogonek;LATIN CAPITAL LETTER A WITH OGONEK -00C5;Aring;LATIN CAPITAL LETTER A WITH RING ABOVE -01FA;Aringacute;LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE -F7E5;Aringsmall;LATIN SMALL CAPITAL LETTER A WITH RING ABOVE -F761;Asmall;LATIN SMALL CAPITAL LETTER A -00C3;Atilde;LATIN CAPITAL LETTER A WITH TILDE -F7E3;Atildesmall;LATIN SMALL CAPITAL LETTER A WITH TILDE -0042;B;LATIN CAPITAL LETTER B -0392;Beta;GREEK CAPITAL LETTER BETA -F6F4;Brevesmall;SMALL CAPITAL BREVE -F762;Bsmall;LATIN SMALL CAPITAL LETTER B -0043;C;LATIN CAPITAL LETTER C -0106;Cacute;LATIN CAPITAL LETTER C WITH ACUTE -F6CA;Caron;CAPITAL CARON -F6F5;Caronsmall;SMALL CAPITAL CARON -010C;Ccaron;LATIN CAPITAL LETTER C WITH CARON -00C7;Ccedilla;LATIN CAPITAL LETTER C WITH CEDILLA -F7E7;Ccedillasmall;LATIN SMALL CAPITAL LETTER C WITH CEDILLA -0108;Ccircumflex;LATIN CAPITAL LETTER C WITH CIRCUMFLEX -010A;Cdotaccent;LATIN CAPITAL LETTER C WITH DOT ABOVE -F7B8;Cedillasmall;SMALL CAPITAL CEDILLA -03A7;Chi;GREEK CAPITAL LETTER CHI -F6F6;Circumflexsmall;SMALL CAPITAL MODIFIER LETTER CIRCUMFLEX ACCENT -F763;Csmall;LATIN SMALL CAPITAL LETTER C -0044;D;LATIN CAPITAL LETTER D -010E;Dcaron;LATIN CAPITAL LETTER D WITH CARON -0110;Dcroat;LATIN CAPITAL LETTER D WITH STROKE -2206;Delta;INCREMENT -0394;Delta;GREEK CAPITAL LETTER DELTA;Duplicate -F6CB;Dieresis;CAPITAL DIAERESIS -F6CC;DieresisAcute;CAPITAL DIAERESIS ACUTE ACCENT -F6CD;DieresisGrave;CAPITAL DIAERESIS GRAVE ACCENT -F7A8;Dieresissmall;SMALL CAPITAL DIAERESIS -F6F7;Dotaccentsmall;SMALL CAPITAL DOT ABOVE -F764;Dsmall;LATIN SMALL CAPITAL LETTER D -0045;E;LATIN CAPITAL LETTER E -00C9;Eacute;LATIN CAPITAL LETTER E WITH ACUTE -F7E9;Eacutesmall;LATIN SMALL CAPITAL LETTER E WITH ACUTE -0114;Ebreve;LATIN CAPITAL LETTER E WITH BREVE -011A;Ecaron;LATIN CAPITAL LETTER E WITH CARON -00CA;Ecircumflex;LATIN CAPITAL LETTER E WITH CIRCUMFLEX -F7EA;Ecircumflexsmall;LATIN SMALL CAPITAL LETTER E WITH CIRCUMFLEX -00CB;Edieresis;LATIN CAPITAL LETTER E WITH DIAERESIS -F7EB;Edieresissmall;LATIN SMALL CAPITAL LETTER E WITH DIAERESIS -0116;Edotaccent;LATIN CAPITAL LETTER E WITH DOT ABOVE -00C8;Egrave;LATIN CAPITAL LETTER E WITH GRAVE -F7E8;Egravesmall;LATIN SMALL CAPITAL LETTER E WITH GRAVE -0112;Emacron;LATIN CAPITAL LETTER E WITH MACRON -014A;Eng;LATIN CAPITAL LETTER ENG -0118;Eogonek;LATIN CAPITAL LETTER E WITH OGONEK -0395;Epsilon;GREEK CAPITAL LETTER EPSILON -0388;Epsilontonos;GREEK CAPITAL LETTER EPSILON WITH TONOS -F765;Esmall;LATIN SMALL CAPITAL LETTER E -0397;Eta;GREEK CAPITAL LETTER ETA -0389;Etatonos;GREEK CAPITAL LETTER ETA WITH TONOS -00D0;Eth;LATIN CAPITAL LETTER ETH -F7F0;Ethsmall;LATIN SMALL CAPITAL LETTER ETH -20AC;Euro;EURO SIGN -0046;F;LATIN CAPITAL LETTER F -F766;Fsmall;LATIN SMALL CAPITAL LETTER F -0047;G;LATIN CAPITAL LETTER G -0393;Gamma;GREEK CAPITAL LETTER GAMMA -011E;Gbreve;LATIN CAPITAL LETTER G WITH BREVE -01E6;Gcaron;LATIN CAPITAL LETTER G WITH CARON -011C;Gcircumflex;LATIN CAPITAL LETTER G WITH CIRCUMFLEX -0122;Gcommaaccent;LATIN CAPITAL LETTER G WITH CEDILLA -0120;Gdotaccent;LATIN CAPITAL LETTER G WITH DOT ABOVE -F6CE;Grave;CAPITAL GRAVE ACCENT -F760;Gravesmall;SMALL CAPITAL GRAVE ACCENT -F767;Gsmall;LATIN SMALL CAPITAL LETTER G -0048;H;LATIN CAPITAL LETTER H -25CF;H18533;BLACK CIRCLE -25AA;H18543;BLACK SMALL SQUARE -25AB;H18551;WHITE SMALL SQUARE -25A1;H22073;WHITE SQUARE -0126;Hbar;LATIN CAPITAL LETTER H WITH STROKE -0124;Hcircumflex;LATIN CAPITAL LETTER H WITH CIRCUMFLEX -F768;Hsmall;LATIN SMALL CAPITAL LETTER H -F6CF;Hungarumlaut;CAPITAL DOUBLE ACUTE ACCENT -F6F8;Hungarumlautsmall;SMALL CAPITAL DOUBLE ACUTE ACCENT -0049;I;LATIN CAPITAL LETTER I -0132;IJ;LATIN CAPITAL LIGATURE IJ -00CD;Iacute;LATIN CAPITAL LETTER I WITH ACUTE -F7ED;Iacutesmall;LATIN SMALL CAPITAL LETTER I WITH ACUTE -012C;Ibreve;LATIN CAPITAL LETTER I WITH BREVE -00CE;Icircumflex;LATIN CAPITAL LETTER I WITH CIRCUMFLEX -F7EE;Icircumflexsmall;LATIN SMALL CAPITAL LETTER I WITH CIRCUMFLEX -00CF;Idieresis;LATIN CAPITAL LETTER I WITH DIAERESIS -F7EF;Idieresissmall;LATIN SMALL CAPITAL LETTER I WITH DIAERESIS -0130;Idotaccent;LATIN CAPITAL LETTER I WITH DOT ABOVE -2111;Ifraktur;BLACK-LETTER CAPITAL I -00CC;Igrave;LATIN CAPITAL LETTER I WITH GRAVE -F7EC;Igravesmall;LATIN SMALL CAPITAL LETTER I WITH GRAVE -012A;Imacron;LATIN CAPITAL LETTER I WITH MACRON -012E;Iogonek;LATIN CAPITAL LETTER I WITH OGONEK -0399;Iota;GREEK CAPITAL LETTER IOTA -03AA;Iotadieresis;GREEK CAPITAL LETTER IOTA WITH DIALYTIKA -038A;Iotatonos;GREEK CAPITAL LETTER IOTA WITH TONOS -F769;Ismall;LATIN SMALL CAPITAL LETTER I -0128;Itilde;LATIN CAPITAL LETTER I WITH TILDE -004A;J;LATIN CAPITAL LETTER J -0134;Jcircumflex;LATIN CAPITAL LETTER J WITH CIRCUMFLEX -F76A;Jsmall;LATIN SMALL CAPITAL LETTER J -004B;K;LATIN CAPITAL LETTER K -039A;Kappa;GREEK CAPITAL LETTER KAPPA -0136;Kcommaaccent;LATIN CAPITAL LETTER K WITH CEDILLA -F76B;Ksmall;LATIN SMALL CAPITAL LETTER K -004C;L;LATIN CAPITAL LETTER L -F6BF;LL;LATIN CAPITAL LETTER LL -0139;Lacute;LATIN CAPITAL LETTER L WITH ACUTE -039B;Lambda;GREEK CAPITAL LETTER LAMDA -013D;Lcaron;LATIN CAPITAL LETTER L WITH CARON -013B;Lcommaaccent;LATIN CAPITAL LETTER L WITH CEDILLA -013F;Ldot;LATIN CAPITAL LETTER L WITH MIDDLE DOT -0141;Lslash;LATIN CAPITAL LETTER L WITH STROKE -F6F9;Lslashsmall;LATIN SMALL CAPITAL LETTER L WITH STROKE -F76C;Lsmall;LATIN SMALL CAPITAL LETTER L -004D;M;LATIN CAPITAL LETTER M -F6D0;Macron;CAPITAL MACRON -F7AF;Macronsmall;SMALL CAPITAL MACRON -F76D;Msmall;LATIN SMALL CAPITAL LETTER M -039C;Mu;GREEK CAPITAL LETTER MU -004E;N;LATIN CAPITAL LETTER N -0143;Nacute;LATIN CAPITAL LETTER N WITH ACUTE -0147;Ncaron;LATIN CAPITAL LETTER N WITH CARON -0145;Ncommaaccent;LATIN CAPITAL LETTER N WITH CEDILLA -F76E;Nsmall;LATIN SMALL CAPITAL LETTER N -00D1;Ntilde;LATIN CAPITAL LETTER N WITH TILDE -F7F1;Ntildesmall;LATIN SMALL CAPITAL LETTER N WITH TILDE -039D;Nu;GREEK CAPITAL LETTER NU -004F;O;LATIN CAPITAL LETTER O -0152;OE;LATIN CAPITAL LIGATURE OE -F6FA;OEsmall;LATIN SMALL CAPITAL LIGATURE OE -00D3;Oacute;LATIN CAPITAL LETTER O WITH ACUTE -F7F3;Oacutesmall;LATIN SMALL CAPITAL LETTER O WITH ACUTE -014E;Obreve;LATIN CAPITAL LETTER O WITH BREVE -00D4;Ocircumflex;LATIN CAPITAL LETTER O WITH CIRCUMFLEX -F7F4;Ocircumflexsmall;LATIN SMALL CAPITAL LETTER O WITH CIRCUMFLEX -00D6;Odieresis;LATIN CAPITAL LETTER O WITH DIAERESIS -F7F6;Odieresissmall;LATIN SMALL CAPITAL LETTER O WITH DIAERESIS -F6FB;Ogoneksmall;SMALL CAPITAL OGONEK -00D2;Ograve;LATIN CAPITAL LETTER O WITH GRAVE -F7F2;Ogravesmall;LATIN SMALL CAPITAL LETTER O WITH GRAVE -01A0;Ohorn;LATIN CAPITAL LETTER O WITH HORN -0150;Ohungarumlaut;LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -014C;Omacron;LATIN CAPITAL LETTER O WITH MACRON -2126;Omega;OHM SIGN -03A9;Omega;GREEK CAPITAL LETTER OMEGA;Duplicate -038F;Omegatonos;GREEK CAPITAL LETTER OMEGA WITH TONOS -039F;Omicron;GREEK CAPITAL LETTER OMICRON -038C;Omicrontonos;GREEK CAPITAL LETTER OMICRON WITH TONOS -00D8;Oslash;LATIN CAPITAL LETTER O WITH STROKE -01FE;Oslashacute;LATIN CAPITAL LETTER O WITH STROKE AND ACUTE -F7F8;Oslashsmall;LATIN SMALL CAPITAL LETTER O WITH STROKE -F76F;Osmall;LATIN SMALL CAPITAL LETTER O -00D5;Otilde;LATIN CAPITAL LETTER O WITH TILDE -F7F5;Otildesmall;LATIN SMALL CAPITAL LETTER O WITH TILDE -0050;P;LATIN CAPITAL LETTER P -03A6;Phi;GREEK CAPITAL LETTER PHI -03A0;Pi;GREEK CAPITAL LETTER PI -03A8;Psi;GREEK CAPITAL LETTER PSI -F770;Psmall;LATIN SMALL CAPITAL LETTER P -0051;Q;LATIN CAPITAL LETTER Q -F771;Qsmall;LATIN SMALL CAPITAL LETTER Q -0052;R;LATIN CAPITAL LETTER R -0154;Racute;LATIN CAPITAL LETTER R WITH ACUTE -0158;Rcaron;LATIN CAPITAL LETTER R WITH CARON -0156;Rcommaaccent;LATIN CAPITAL LETTER R WITH CEDILLA -211C;Rfraktur;BLACK-LETTER CAPITAL R -03A1;Rho;GREEK CAPITAL LETTER RHO -F6FC;Ringsmall;SMALL CAPITAL RING ABOVE -F772;Rsmall;LATIN SMALL CAPITAL LETTER R -0053;S;LATIN CAPITAL LETTER S -250C;SF010000;BOX DRAWINGS LIGHT DOWN AND RIGHT -2514;SF020000;BOX DRAWINGS LIGHT UP AND RIGHT -2510;SF030000;BOX DRAWINGS LIGHT DOWN AND LEFT -2518;SF040000;BOX DRAWINGS LIGHT UP AND LEFT -253C;SF050000;BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL -252C;SF060000;BOX DRAWINGS LIGHT DOWN AND HORIZONTAL -2534;SF070000;BOX DRAWINGS LIGHT UP AND HORIZONTAL -251C;SF080000;BOX DRAWINGS LIGHT VERTICAL AND RIGHT -2524;SF090000;BOX DRAWINGS LIGHT VERTICAL AND LEFT -2500;SF100000;BOX DRAWINGS LIGHT HORIZONTAL -2502;SF110000;BOX DRAWINGS LIGHT VERTICAL -2561;SF190000;BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE -2562;SF200000;BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE -2556;SF210000;BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE -2555;SF220000;BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE -2563;SF230000;BOX DRAWINGS DOUBLE VERTICAL AND LEFT -2551;SF240000;BOX DRAWINGS DOUBLE VERTICAL -2557;SF250000;BOX DRAWINGS DOUBLE DOWN AND LEFT -255D;SF260000;BOX DRAWINGS DOUBLE UP AND LEFT -255C;SF270000;BOX DRAWINGS UP DOUBLE AND LEFT SINGLE -255B;SF280000;BOX DRAWINGS UP SINGLE AND LEFT DOUBLE -255E;SF360000;BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE -255F;SF370000;BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE -255A;SF380000;BOX DRAWINGS DOUBLE UP AND RIGHT -2554;SF390000;BOX DRAWINGS DOUBLE DOWN AND RIGHT -2569;SF400000;BOX DRAWINGS DOUBLE UP AND HORIZONTAL -2566;SF410000;BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL -2560;SF420000;BOX DRAWINGS DOUBLE VERTICAL AND RIGHT -2550;SF430000;BOX DRAWINGS DOUBLE HORIZONTAL -256C;SF440000;BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL -2567;SF450000;BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE -2568;SF460000;BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE -2564;SF470000;BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE -2565;SF480000;BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE -2559;SF490000;BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE -2558;SF500000;BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE -2552;SF510000;BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE -2553;SF520000;BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE -256B;SF530000;BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE -256A;SF540000;BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE -015A;Sacute;LATIN CAPITAL LETTER S WITH ACUTE -0160;Scaron;LATIN CAPITAL LETTER S WITH CARON -F6FD;Scaronsmall;LATIN SMALL CAPITAL LETTER S WITH CARON -015E;Scedilla;LATIN CAPITAL LETTER S WITH CEDILLA -F6C1;Scedilla;LATIN CAPITAL LETTER S WITH CEDILLA;Duplicate -015C;Scircumflex;LATIN CAPITAL LETTER S WITH CIRCUMFLEX -0218;Scommaaccent;LATIN CAPITAL LETTER S WITH COMMA BELOW -03A3;Sigma;GREEK CAPITAL LETTER SIGMA -F773;Ssmall;LATIN SMALL CAPITAL LETTER S -0054;T;LATIN CAPITAL LETTER T -03A4;Tau;GREEK CAPITAL LETTER TAU -0166;Tbar;LATIN CAPITAL LETTER T WITH STROKE -0164;Tcaron;LATIN CAPITAL LETTER T WITH CARON -0162;Tcommaaccent;LATIN CAPITAL LETTER T WITH CEDILLA -021A;Tcommaaccent;LATIN CAPITAL LETTER T WITH COMMA BELOW;Duplicate -0398;Theta;GREEK CAPITAL LETTER THETA -00DE;Thorn;LATIN CAPITAL LETTER THORN -F7FE;Thornsmall;LATIN SMALL CAPITAL LETTER THORN -F6FE;Tildesmall;SMALL CAPITAL SMALL TILDE -F774;Tsmall;LATIN SMALL CAPITAL LETTER T -0055;U;LATIN CAPITAL LETTER U -00DA;Uacute;LATIN CAPITAL LETTER U WITH ACUTE -F7FA;Uacutesmall;LATIN SMALL CAPITAL LETTER U WITH ACUTE -016C;Ubreve;LATIN CAPITAL LETTER U WITH BREVE -00DB;Ucircumflex;LATIN CAPITAL LETTER U WITH CIRCUMFLEX -F7FB;Ucircumflexsmall;LATIN SMALL CAPITAL LETTER U WITH CIRCUMFLEX -00DC;Udieresis;LATIN CAPITAL LETTER U WITH DIAERESIS -F7FC;Udieresissmall;LATIN SMALL CAPITAL LETTER U WITH DIAERESIS -00D9;Ugrave;LATIN CAPITAL LETTER U WITH GRAVE -F7F9;Ugravesmall;LATIN SMALL CAPITAL LETTER U WITH GRAVE -01AF;Uhorn;LATIN CAPITAL LETTER U WITH HORN -0170;Uhungarumlaut;LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -016A;Umacron;LATIN CAPITAL LETTER U WITH MACRON -0172;Uogonek;LATIN CAPITAL LETTER U WITH OGONEK -03A5;Upsilon;GREEK CAPITAL LETTER UPSILON -03D2;Upsilon1;GREEK UPSILON WITH HOOK SYMBOL -03AB;Upsilondieresis;GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA -038E;Upsilontonos;GREEK CAPITAL LETTER UPSILON WITH TONOS -016E;Uring;LATIN CAPITAL LETTER U WITH RING ABOVE -F775;Usmall;LATIN SMALL CAPITAL LETTER U -0168;Utilde;LATIN CAPITAL LETTER U WITH TILDE -0056;V;LATIN CAPITAL LETTER V -F776;Vsmall;LATIN SMALL CAPITAL LETTER V -0057;W;LATIN CAPITAL LETTER W -1E82;Wacute;LATIN CAPITAL LETTER W WITH ACUTE -0174;Wcircumflex;LATIN CAPITAL LETTER W WITH CIRCUMFLEX -1E84;Wdieresis;LATIN CAPITAL LETTER W WITH DIAERESIS -1E80;Wgrave;LATIN CAPITAL LETTER W WITH GRAVE -F777;Wsmall;LATIN SMALL CAPITAL LETTER W -0058;X;LATIN CAPITAL LETTER X -039E;Xi;GREEK CAPITAL LETTER XI -F778;Xsmall;LATIN SMALL CAPITAL LETTER X -0059;Y;LATIN CAPITAL LETTER Y -00DD;Yacute;LATIN CAPITAL LETTER Y WITH ACUTE -F7FD;Yacutesmall;LATIN SMALL CAPITAL LETTER Y WITH ACUTE -0176;Ycircumflex;LATIN CAPITAL LETTER Y WITH CIRCUMFLEX -0178;Ydieresis;LATIN CAPITAL LETTER Y WITH DIAERESIS -F7FF;Ydieresissmall;LATIN SMALL CAPITAL LETTER Y WITH DIAERESIS -1EF2;Ygrave;LATIN CAPITAL LETTER Y WITH GRAVE -F779;Ysmall;LATIN SMALL CAPITAL LETTER Y -005A;Z;LATIN CAPITAL LETTER Z -0179;Zacute;LATIN CAPITAL LETTER Z WITH ACUTE -017D;Zcaron;LATIN CAPITAL LETTER Z WITH CARON -F6FF;Zcaronsmall;LATIN SMALL CAPITAL LETTER Z WITH CARON -017B;Zdotaccent;LATIN CAPITAL LETTER Z WITH DOT ABOVE -0396;Zeta;GREEK CAPITAL LETTER ZETA -F77A;Zsmall;LATIN SMALL CAPITAL LETTER Z -0061;a;LATIN SMALL LETTER A -00E1;aacute;LATIN SMALL LETTER A WITH ACUTE -0103;abreve;LATIN SMALL LETTER A WITH BREVE -00E2;acircumflex;LATIN SMALL LETTER A WITH CIRCUMFLEX -00B4;acute;ACUTE ACCENT -0301;acutecomb;COMBINING ACUTE ACCENT -00E4;adieresis;LATIN SMALL LETTER A WITH DIAERESIS -00E6;ae;LATIN SMALL LETTER AE -01FD;aeacute;LATIN SMALL LETTER AE WITH ACUTE -2015;afii00208;HORIZONTAL BAR -0410;afii10017;CYRILLIC CAPITAL LETTER A -0411;afii10018;CYRILLIC CAPITAL LETTER BE -0412;afii10019;CYRILLIC CAPITAL LETTER VE -0413;afii10020;CYRILLIC CAPITAL LETTER GHE -0414;afii10021;CYRILLIC CAPITAL LETTER DE -0415;afii10022;CYRILLIC CAPITAL LETTER IE -0401;afii10023;CYRILLIC CAPITAL LETTER IO -0416;afii10024;CYRILLIC CAPITAL LETTER ZHE -0417;afii10025;CYRILLIC CAPITAL LETTER ZE -0418;afii10026;CYRILLIC CAPITAL LETTER I -0419;afii10027;CYRILLIC CAPITAL LETTER SHORT I -041A;afii10028;CYRILLIC CAPITAL LETTER KA -041B;afii10029;CYRILLIC CAPITAL LETTER EL -041C;afii10030;CYRILLIC CAPITAL LETTER EM -041D;afii10031;CYRILLIC CAPITAL LETTER EN -041E;afii10032;CYRILLIC CAPITAL LETTER O -041F;afii10033;CYRILLIC CAPITAL LETTER PE -0420;afii10034;CYRILLIC CAPITAL LETTER ER -0421;afii10035;CYRILLIC CAPITAL LETTER ES -0422;afii10036;CYRILLIC CAPITAL LETTER TE -0423;afii10037;CYRILLIC CAPITAL LETTER U -0424;afii10038;CYRILLIC CAPITAL LETTER EF -0425;afii10039;CYRILLIC CAPITAL LETTER HA -0426;afii10040;CYRILLIC CAPITAL LETTER TSE -0427;afii10041;CYRILLIC CAPITAL LETTER CHE -0428;afii10042;CYRILLIC CAPITAL LETTER SHA -0429;afii10043;CYRILLIC CAPITAL LETTER SHCHA -042A;afii10044;CYRILLIC CAPITAL LETTER HARD SIGN -042B;afii10045;CYRILLIC CAPITAL LETTER YERU -042C;afii10046;CYRILLIC CAPITAL LETTER SOFT SIGN -042D;afii10047;CYRILLIC CAPITAL LETTER E -042E;afii10048;CYRILLIC CAPITAL LETTER YU -042F;afii10049;CYRILLIC CAPITAL LETTER YA -0490;afii10050;CYRILLIC CAPITAL LETTER GHE WITH UPTURN -0402;afii10051;CYRILLIC CAPITAL LETTER DJE -0403;afii10052;CYRILLIC CAPITAL LETTER GJE -0404;afii10053;CYRILLIC CAPITAL LETTER UKRAINIAN IE -0405;afii10054;CYRILLIC CAPITAL LETTER DZE -0406;afii10055;CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I -0407;afii10056;CYRILLIC CAPITAL LETTER YI -0408;afii10057;CYRILLIC CAPITAL LETTER JE -0409;afii10058;CYRILLIC CAPITAL LETTER LJE -040A;afii10059;CYRILLIC CAPITAL LETTER NJE -040B;afii10060;CYRILLIC CAPITAL LETTER TSHE -040C;afii10061;CYRILLIC CAPITAL LETTER KJE -040E;afii10062;CYRILLIC CAPITAL LETTER SHORT U -F6C4;afii10063;CYRILLIC SMALL LETTER GHE VARIANT -F6C5;afii10064;CYRILLIC SMALL LETTER BE VARIANT -0430;afii10065;CYRILLIC SMALL LETTER A -0431;afii10066;CYRILLIC SMALL LETTER BE -0432;afii10067;CYRILLIC SMALL LETTER VE -0433;afii10068;CYRILLIC SMALL LETTER GHE -0434;afii10069;CYRILLIC SMALL LETTER DE -0435;afii10070;CYRILLIC SMALL LETTER IE -0451;afii10071;CYRILLIC SMALL LETTER IO -0436;afii10072;CYRILLIC SMALL LETTER ZHE -0437;afii10073;CYRILLIC SMALL LETTER ZE -0438;afii10074;CYRILLIC SMALL LETTER I -0439;afii10075;CYRILLIC SMALL LETTER SHORT I -043A;afii10076;CYRILLIC SMALL LETTER KA -043B;afii10077;CYRILLIC SMALL LETTER EL -043C;afii10078;CYRILLIC SMALL LETTER EM -043D;afii10079;CYRILLIC SMALL LETTER EN -043E;afii10080;CYRILLIC SMALL LETTER O -043F;afii10081;CYRILLIC SMALL LETTER PE -0440;afii10082;CYRILLIC SMALL LETTER ER -0441;afii10083;CYRILLIC SMALL LETTER ES -0442;afii10084;CYRILLIC SMALL LETTER TE -0443;afii10085;CYRILLIC SMALL LETTER U -0444;afii10086;CYRILLIC SMALL LETTER EF -0445;afii10087;CYRILLIC SMALL LETTER HA -0446;afii10088;CYRILLIC SMALL LETTER TSE -0447;afii10089;CYRILLIC SMALL LETTER CHE -0448;afii10090;CYRILLIC SMALL LETTER SHA -0449;afii10091;CYRILLIC SMALL LETTER SHCHA -044A;afii10092;CYRILLIC SMALL LETTER HARD SIGN -044B;afii10093;CYRILLIC SMALL LETTER YERU -044C;afii10094;CYRILLIC SMALL LETTER SOFT SIGN -044D;afii10095;CYRILLIC SMALL LETTER E -044E;afii10096;CYRILLIC SMALL LETTER YU -044F;afii10097;CYRILLIC SMALL LETTER YA -0491;afii10098;CYRILLIC SMALL LETTER GHE WITH UPTURN -0452;afii10099;CYRILLIC SMALL LETTER DJE -0453;afii10100;CYRILLIC SMALL LETTER GJE -0454;afii10101;CYRILLIC SMALL LETTER UKRAINIAN IE -0455;afii10102;CYRILLIC SMALL LETTER DZE -0456;afii10103;CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -0457;afii10104;CYRILLIC SMALL LETTER YI -0458;afii10105;CYRILLIC SMALL LETTER JE -0459;afii10106;CYRILLIC SMALL LETTER LJE -045A;afii10107;CYRILLIC SMALL LETTER NJE -045B;afii10108;CYRILLIC SMALL LETTER TSHE -045C;afii10109;CYRILLIC SMALL LETTER KJE -045E;afii10110;CYRILLIC SMALL LETTER SHORT U -040F;afii10145;CYRILLIC CAPITAL LETTER DZHE -0462;afii10146;CYRILLIC CAPITAL LETTER YAT -0472;afii10147;CYRILLIC CAPITAL LETTER FITA -0474;afii10148;CYRILLIC CAPITAL LETTER IZHITSA -F6C6;afii10192;CYRILLIC SMALL LETTER DE VARIANT -045F;afii10193;CYRILLIC SMALL LETTER DZHE -0463;afii10194;CYRILLIC SMALL LETTER YAT -0473;afii10195;CYRILLIC SMALL LETTER FITA -0475;afii10196;CYRILLIC SMALL LETTER IZHITSA -F6C7;afii10831;CYRILLIC SMALL LETTER PE VARIANT -F6C8;afii10832;CYRILLIC SMALL LETTER TE VARIANT -04D9;afii10846;CYRILLIC SMALL LETTER SCHWA -200E;afii299;LEFT-TO-RIGHT MARK -200F;afii300;RIGHT-TO-LEFT MARK -200D;afii301;ZERO WIDTH JOINER -066A;afii57381;ARABIC PERCENT SIGN -060C;afii57388;ARABIC COMMA -0660;afii57392;ARABIC-INDIC DIGIT ZERO -0661;afii57393;ARABIC-INDIC DIGIT ONE -0662;afii57394;ARABIC-INDIC DIGIT TWO -0663;afii57395;ARABIC-INDIC DIGIT THREE -0664;afii57396;ARABIC-INDIC DIGIT FOUR -0665;afii57397;ARABIC-INDIC DIGIT FIVE -0666;afii57398;ARABIC-INDIC DIGIT SIX -0667;afii57399;ARABIC-INDIC DIGIT SEVEN -0668;afii57400;ARABIC-INDIC DIGIT EIGHT -0669;afii57401;ARABIC-INDIC DIGIT NINE -061B;afii57403;ARABIC SEMICOLON -061F;afii57407;ARABIC QUESTION MARK -0621;afii57409;ARABIC LETTER HAMZA -0622;afii57410;ARABIC LETTER ALEF WITH MADDA ABOVE -0623;afii57411;ARABIC LETTER ALEF WITH HAMZA ABOVE -0624;afii57412;ARABIC LETTER WAW WITH HAMZA ABOVE -0625;afii57413;ARABIC LETTER ALEF WITH HAMZA BELOW -0626;afii57414;ARABIC LETTER YEH WITH HAMZA ABOVE -0627;afii57415;ARABIC LETTER ALEF -0628;afii57416;ARABIC LETTER BEH -0629;afii57417;ARABIC LETTER TEH MARBUTA -062A;afii57418;ARABIC LETTER TEH -062B;afii57419;ARABIC LETTER THEH -062C;afii57420;ARABIC LETTER JEEM -062D;afii57421;ARABIC LETTER HAH -062E;afii57422;ARABIC LETTER KHAH -062F;afii57423;ARABIC LETTER DAL -0630;afii57424;ARABIC LETTER THAL -0631;afii57425;ARABIC LETTER REH -0632;afii57426;ARABIC LETTER ZAIN -0633;afii57427;ARABIC LETTER SEEN -0634;afii57428;ARABIC LETTER SHEEN -0635;afii57429;ARABIC LETTER SAD -0636;afii57430;ARABIC LETTER DAD -0637;afii57431;ARABIC LETTER TAH -0638;afii57432;ARABIC LETTER ZAH -0639;afii57433;ARABIC LETTER AIN -063A;afii57434;ARABIC LETTER GHAIN -0640;afii57440;ARABIC TATWEEL -0641;afii57441;ARABIC LETTER FEH -0642;afii57442;ARABIC LETTER QAF -0643;afii57443;ARABIC LETTER KAF -0644;afii57444;ARABIC LETTER LAM -0645;afii57445;ARABIC LETTER MEEM -0646;afii57446;ARABIC LETTER NOON -0648;afii57448;ARABIC LETTER WAW -0649;afii57449;ARABIC LETTER ALEF MAKSURA -064A;afii57450;ARABIC LETTER YEH -064B;afii57451;ARABIC FATHATAN -064C;afii57452;ARABIC DAMMATAN -064D;afii57453;ARABIC KASRATAN -064E;afii57454;ARABIC FATHA -064F;afii57455;ARABIC DAMMA -0650;afii57456;ARABIC KASRA -0651;afii57457;ARABIC SHADDA -0652;afii57458;ARABIC SUKUN -0647;afii57470;ARABIC LETTER HEH -06A4;afii57505;ARABIC LETTER VEH -067E;afii57506;ARABIC LETTER PEH -0686;afii57507;ARABIC LETTER TCHEH -0698;afii57508;ARABIC LETTER JEH -06AF;afii57509;ARABIC LETTER GAF -0679;afii57511;ARABIC LETTER TTEH -0688;afii57512;ARABIC LETTER DDAL -0691;afii57513;ARABIC LETTER RREH -06BA;afii57514;ARABIC LETTER NOON GHUNNA -06D2;afii57519;ARABIC LETTER YEH BARREE -06D5;afii57534;ARABIC LETTER AE -20AA;afii57636;NEW SHEQEL SIGN -05BE;afii57645;HEBREW PUNCTUATION MAQAF -05C3;afii57658;HEBREW PUNCTUATION SOF PASUQ -05D0;afii57664;HEBREW LETTER ALEF -05D1;afii57665;HEBREW LETTER BET -05D2;afii57666;HEBREW LETTER GIMEL -05D3;afii57667;HEBREW LETTER DALET -05D4;afii57668;HEBREW LETTER HE -05D5;afii57669;HEBREW LETTER VAV -05D6;afii57670;HEBREW LETTER ZAYIN -05D7;afii57671;HEBREW LETTER HET -05D8;afii57672;HEBREW LETTER TET -05D9;afii57673;HEBREW LETTER YOD -05DA;afii57674;HEBREW LETTER FINAL KAF -05DB;afii57675;HEBREW LETTER KAF -05DC;afii57676;HEBREW LETTER LAMED -05DD;afii57677;HEBREW LETTER FINAL MEM -05DE;afii57678;HEBREW LETTER MEM -05DF;afii57679;HEBREW LETTER FINAL NUN -05E0;afii57680;HEBREW LETTER NUN -05E1;afii57681;HEBREW LETTER SAMEKH -05E2;afii57682;HEBREW LETTER AYIN -05E3;afii57683;HEBREW LETTER FINAL PE -05E4;afii57684;HEBREW LETTER PE -05E5;afii57685;HEBREW LETTER FINAL TSADI -05E6;afii57686;HEBREW LETTER TSADI -05E7;afii57687;HEBREW LETTER QOF -05E8;afii57688;HEBREW LETTER RESH -05E9;afii57689;HEBREW LETTER SHIN -05EA;afii57690;HEBREW LETTER TAV -FB2A;afii57694;HEBREW LETTER SHIN WITH SHIN DOT -FB2B;afii57695;HEBREW LETTER SHIN WITH SIN DOT -FB4B;afii57700;HEBREW LETTER VAV WITH HOLAM -FB1F;afii57705;HEBREW LIGATURE YIDDISH YOD YOD PATAH -05F0;afii57716;HEBREW LIGATURE YIDDISH DOUBLE VAV -05F1;afii57717;HEBREW LIGATURE YIDDISH VAV YOD -05F2;afii57718;HEBREW LIGATURE YIDDISH DOUBLE YOD -FB35;afii57723;HEBREW LETTER VAV WITH DAGESH -05B4;afii57793;HEBREW POINT HIRIQ -05B5;afii57794;HEBREW POINT TSERE -05B6;afii57795;HEBREW POINT SEGOL -05BB;afii57796;HEBREW POINT QUBUTS -05B8;afii57797;HEBREW POINT QAMATS -05B7;afii57798;HEBREW POINT PATAH -05B0;afii57799;HEBREW POINT SHEVA -05B2;afii57800;HEBREW POINT HATAF PATAH -05B1;afii57801;HEBREW POINT HATAF SEGOL -05B3;afii57802;HEBREW POINT HATAF QAMATS -05C2;afii57803;HEBREW POINT SIN DOT -05C1;afii57804;HEBREW POINT SHIN DOT -05B9;afii57806;HEBREW POINT HOLAM -05BC;afii57807;HEBREW POINT DAGESH OR MAPIQ -05BD;afii57839;HEBREW POINT METEG -05BF;afii57841;HEBREW POINT RAFE -05C0;afii57842;HEBREW PUNCTUATION PASEQ -02BC;afii57929;MODIFIER LETTER APOSTROPHE -2105;afii61248;CARE OF -2113;afii61289;SCRIPT SMALL L -2116;afii61352;NUMERO SIGN -202C;afii61573;POP DIRECTIONAL FORMATTING -202D;afii61574;LEFT-TO-RIGHT OVERRIDE -202E;afii61575;RIGHT-TO-LEFT OVERRIDE -200C;afii61664;ZERO WIDTH NON-JOINER -066D;afii63167;ARABIC FIVE POINTED STAR -02BD;afii64937;MODIFIER LETTER REVERSED COMMA -00E0;agrave;LATIN SMALL LETTER A WITH GRAVE -2135;aleph;ALEF SYMBOL -03B1;alpha;GREEK SMALL LETTER ALPHA -03AC;alphatonos;GREEK SMALL LETTER ALPHA WITH TONOS -0101;amacron;LATIN SMALL LETTER A WITH MACRON -0026;ampersand;AMPERSAND -F726;ampersandsmall;SMALL CAPITAL AMPERSAND -2220;angle;ANGLE -2329;angleleft;LEFT-POINTING ANGLE BRACKET -232A;angleright;RIGHT-POINTING ANGLE BRACKET -0387;anoteleia;GREEK ANO TELEIA -0105;aogonek;LATIN SMALL LETTER A WITH OGONEK -2248;approxequal;ALMOST EQUAL TO -00E5;aring;LATIN SMALL LETTER A WITH RING ABOVE -01FB;aringacute;LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE -2194;arrowboth;LEFT RIGHT ARROW -21D4;arrowdblboth;LEFT RIGHT DOUBLE ARROW -21D3;arrowdbldown;DOWNWARDS DOUBLE ARROW -21D0;arrowdblleft;LEFTWARDS DOUBLE ARROW -21D2;arrowdblright;RIGHTWARDS DOUBLE ARROW -21D1;arrowdblup;UPWARDS DOUBLE ARROW -2193;arrowdown;DOWNWARDS ARROW -F8E7;arrowhorizex;HORIZONTAL ARROW EXTENDER -2190;arrowleft;LEFTWARDS ARROW -2192;arrowright;RIGHTWARDS ARROW -2191;arrowup;UPWARDS ARROW -2195;arrowupdn;UP DOWN ARROW -21A8;arrowupdnbse;UP DOWN ARROW WITH BASE -F8E6;arrowvertex;VERTICAL ARROW EXTENDER -005E;asciicircum;CIRCUMFLEX ACCENT -007E;asciitilde;TILDE -002A;asterisk;ASTERISK -2217;asteriskmath;ASTERISK OPERATOR -F6E9;asuperior;SUPERSCRIPT LATIN SMALL LETTER A -0040;at;COMMERCIAL AT -00E3;atilde;LATIN SMALL LETTER A WITH TILDE -0062;b;LATIN SMALL LETTER B -005C;backslash;REVERSE SOLIDUS -007C;bar;VERTICAL LINE -03B2;beta;GREEK SMALL LETTER BETA -2588;block;FULL BLOCK -F8F4;braceex;CURLY BRACKET EXTENDER -007B;braceleft;LEFT CURLY BRACKET -F8F3;braceleftbt;LEFT CURLY BRACKET BOTTOM -F8F2;braceleftmid;LEFT CURLY BRACKET MID -F8F1;bracelefttp;LEFT CURLY BRACKET TOP -007D;braceright;RIGHT CURLY BRACKET -F8FE;bracerightbt;RIGHT CURLY BRACKET BOTTOM -F8FD;bracerightmid;RIGHT CURLY BRACKET MID -F8FC;bracerighttp;RIGHT CURLY BRACKET TOP -005B;bracketleft;LEFT SQUARE BRACKET -F8F0;bracketleftbt;LEFT SQUARE BRACKET BOTTOM -F8EF;bracketleftex;LEFT SQUARE BRACKET EXTENDER -F8EE;bracketlefttp;LEFT SQUARE BRACKET TOP -005D;bracketright;RIGHT SQUARE BRACKET -F8FB;bracketrightbt;RIGHT SQUARE BRACKET BOTTOM -F8FA;bracketrightex;RIGHT SQUARE BRACKET EXTENDER -F8F9;bracketrighttp;RIGHT SQUARE BRACKET TOP -02D8;breve;BREVE -00A6;brokenbar;BROKEN BAR -F6EA;bsuperior;SUPERSCRIPT LATIN SMALL LETTER B -2022;bullet;BULLET -0063;c;LATIN SMALL LETTER C -0107;cacute;LATIN SMALL LETTER C WITH ACUTE -02C7;caron;CARON -21B5;carriagereturn;DOWNWARDS ARROW WITH CORNER LEFTWARDS -010D;ccaron;LATIN SMALL LETTER C WITH CARON -00E7;ccedilla;LATIN SMALL LETTER C WITH CEDILLA -0109;ccircumflex;LATIN SMALL LETTER C WITH CIRCUMFLEX -010B;cdotaccent;LATIN SMALL LETTER C WITH DOT ABOVE -00B8;cedilla;CEDILLA -00A2;cent;CENT SIGN -F6DF;centinferior;SUBSCRIPT CENT SIGN -F7A2;centoldstyle;OLDSTYLE CENT SIGN -F6E0;centsuperior;SUPERSCRIPT CENT SIGN -03C7;chi;GREEK SMALL LETTER CHI -25CB;circle;WHITE CIRCLE -2297;circlemultiply;CIRCLED TIMES -2295;circleplus;CIRCLED PLUS -02C6;circumflex;MODIFIER LETTER CIRCUMFLEX ACCENT -2663;club;BLACK CLUB SUIT -003A;colon;COLON -20A1;colonmonetary;COLON SIGN -002C;comma;COMMA -F6C3;commaaccent;COMMA BELOW -F6E1;commainferior;SUBSCRIPT COMMA -F6E2;commasuperior;SUPERSCRIPT COMMA -2245;congruent;APPROXIMATELY EQUAL TO -00A9;copyright;COPYRIGHT SIGN -F8E9;copyrightsans;COPYRIGHT SIGN SANS SERIF -F6D9;copyrightserif;COPYRIGHT SIGN SERIF -00A4;currency;CURRENCY SIGN -F6D1;cyrBreve;CAPITAL CYRILLIC BREVE -F6D2;cyrFlex;CAPITAL CYRILLIC CIRCUMFLEX -F6D4;cyrbreve;CYRILLIC BREVE -F6D5;cyrflex;CYRILLIC CIRCUMFLEX -0064;d;LATIN SMALL LETTER D -2020;dagger;DAGGER -2021;daggerdbl;DOUBLE DAGGER -F6D3;dblGrave;CAPITAL DOUBLE GRAVE ACCENT -F6D6;dblgrave;DOUBLE GRAVE ACCENT -010F;dcaron;LATIN SMALL LETTER D WITH CARON -0111;dcroat;LATIN SMALL LETTER D WITH STROKE -00B0;degree;DEGREE SIGN -03B4;delta;GREEK SMALL LETTER DELTA -2666;diamond;BLACK DIAMOND SUIT -00A8;dieresis;DIAERESIS -F6D7;dieresisacute;DIAERESIS ACUTE ACCENT -F6D8;dieresisgrave;DIAERESIS GRAVE ACCENT -0385;dieresistonos;GREEK DIALYTIKA TONOS -00F7;divide;DIVISION SIGN -2593;dkshade;DARK SHADE -2584;dnblock;LOWER HALF BLOCK -0024;dollar;DOLLAR SIGN -F6E3;dollarinferior;SUBSCRIPT DOLLAR SIGN -F724;dollaroldstyle;OLDSTYLE DOLLAR SIGN -F6E4;dollarsuperior;SUPERSCRIPT DOLLAR SIGN -20AB;dong;DONG SIGN -02D9;dotaccent;DOT ABOVE -0323;dotbelowcomb;COMBINING DOT BELOW -0131;dotlessi;LATIN SMALL LETTER DOTLESS I -F6BE;dotlessj;LATIN SMALL LETTER DOTLESS J -22C5;dotmath;DOT OPERATOR -F6EB;dsuperior;SUPERSCRIPT LATIN SMALL LETTER D -0065;e;LATIN SMALL LETTER E -00E9;eacute;LATIN SMALL LETTER E WITH ACUTE -0115;ebreve;LATIN SMALL LETTER E WITH BREVE -011B;ecaron;LATIN SMALL LETTER E WITH CARON -00EA;ecircumflex;LATIN SMALL LETTER E WITH CIRCUMFLEX -00EB;edieresis;LATIN SMALL LETTER E WITH DIAERESIS -0117;edotaccent;LATIN SMALL LETTER E WITH DOT ABOVE -00E8;egrave;LATIN SMALL LETTER E WITH GRAVE -0038;eight;DIGIT EIGHT -2088;eightinferior;SUBSCRIPT EIGHT -F738;eightoldstyle;OLDSTYLE DIGIT EIGHT -2078;eightsuperior;SUPERSCRIPT EIGHT -2208;element;ELEMENT OF -2026;ellipsis;HORIZONTAL ELLIPSIS -0113;emacron;LATIN SMALL LETTER E WITH MACRON -2014;emdash;EM DASH -2205;emptyset;EMPTY SET -2013;endash;EN DASH -014B;eng;LATIN SMALL LETTER ENG -0119;eogonek;LATIN SMALL LETTER E WITH OGONEK -03B5;epsilon;GREEK SMALL LETTER EPSILON -03AD;epsilontonos;GREEK SMALL LETTER EPSILON WITH TONOS -003D;equal;EQUALS SIGN -2261;equivalence;IDENTICAL TO -212E;estimated;ESTIMATED SYMBOL -F6EC;esuperior;SUPERSCRIPT LATIN SMALL LETTER E -03B7;eta;GREEK SMALL LETTER ETA -03AE;etatonos;GREEK SMALL LETTER ETA WITH TONOS -00F0;eth;LATIN SMALL LETTER ETH -0021;exclam;EXCLAMATION MARK -203C;exclamdbl;DOUBLE EXCLAMATION MARK -00A1;exclamdown;INVERTED EXCLAMATION MARK -F7A1;exclamdownsmall;SMALL CAPITAL INVERTED EXCLAMATION MARK -F721;exclamsmall;SMALL CAPITAL EXCLAMATION MARK -2203;existential;THERE EXISTS -0066;f;LATIN SMALL LETTER F -2640;female;FEMALE SIGN -FB00;ff;LATIN SMALL LIGATURE FF -FB03;ffi;LATIN SMALL LIGATURE FFI -FB04;ffl;LATIN SMALL LIGATURE FFL -FB01;fi;LATIN SMALL LIGATURE FI -2012;figuredash;FIGURE DASH -25A0;filledbox;BLACK SQUARE -25AC;filledrect;BLACK RECTANGLE -0035;five;DIGIT FIVE -215D;fiveeighths;VULGAR FRACTION FIVE EIGHTHS -2085;fiveinferior;SUBSCRIPT FIVE -F735;fiveoldstyle;OLDSTYLE DIGIT FIVE -2075;fivesuperior;SUPERSCRIPT FIVE -FB02;fl;LATIN SMALL LIGATURE FL -0192;florin;LATIN SMALL LETTER F WITH HOOK -0034;four;DIGIT FOUR -2084;fourinferior;SUBSCRIPT FOUR -F734;fouroldstyle;OLDSTYLE DIGIT FOUR -2074;foursuperior;SUPERSCRIPT FOUR -2044;fraction;FRACTION SLASH -2215;fraction;DIVISION SLASH;Duplicate -20A3;franc;FRENCH FRANC SIGN -0067;g;LATIN SMALL LETTER G -03B3;gamma;GREEK SMALL LETTER GAMMA -011F;gbreve;LATIN SMALL LETTER G WITH BREVE -01E7;gcaron;LATIN SMALL LETTER G WITH CARON -011D;gcircumflex;LATIN SMALL LETTER G WITH CIRCUMFLEX -0123;gcommaaccent;LATIN SMALL LETTER G WITH CEDILLA -0121;gdotaccent;LATIN SMALL LETTER G WITH DOT ABOVE -00DF;germandbls;LATIN SMALL LETTER SHARP S -2207;gradient;NABLA -0060;grave;GRAVE ACCENT -0300;gravecomb;COMBINING GRAVE ACCENT -003E;greater;GREATER-THAN SIGN -2265;greaterequal;GREATER-THAN OR EQUAL TO -00AB;guillemotleft;LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -00BB;guillemotright;RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -2039;guilsinglleft;SINGLE LEFT-POINTING ANGLE QUOTATION MARK -203A;guilsinglright;SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -0068;h;LATIN SMALL LETTER H -0127;hbar;LATIN SMALL LETTER H WITH STROKE -0125;hcircumflex;LATIN SMALL LETTER H WITH CIRCUMFLEX -2665;heart;BLACK HEART SUIT -0309;hookabovecomb;COMBINING HOOK ABOVE -2302;house;HOUSE -02DD;hungarumlaut;DOUBLE ACUTE ACCENT -002D;hyphen;HYPHEN-MINUS -00AD;hyphen;SOFT HYPHEN;Duplicate -F6E5;hypheninferior;SUBSCRIPT HYPHEN-MINUS -F6E6;hyphensuperior;SUPERSCRIPT HYPHEN-MINUS -0069;i;LATIN SMALL LETTER I -00ED;iacute;LATIN SMALL LETTER I WITH ACUTE -012D;ibreve;LATIN SMALL LETTER I WITH BREVE -00EE;icircumflex;LATIN SMALL LETTER I WITH CIRCUMFLEX -00EF;idieresis;LATIN SMALL LETTER I WITH DIAERESIS -00EC;igrave;LATIN SMALL LETTER I WITH GRAVE -0133;ij;LATIN SMALL LIGATURE IJ -012B;imacron;LATIN SMALL LETTER I WITH MACRON -221E;infinity;INFINITY -222B;integral;INTEGRAL -2321;integralbt;BOTTOM HALF INTEGRAL -F8F5;integralex;INTEGRAL EXTENDER -2320;integraltp;TOP HALF INTEGRAL -2229;intersection;INTERSECTION -25D8;invbullet;INVERSE BULLET -25D9;invcircle;INVERSE WHITE CIRCLE -263B;invsmileface;BLACK SMILING FACE -012F;iogonek;LATIN SMALL LETTER I WITH OGONEK -03B9;iota;GREEK SMALL LETTER IOTA -03CA;iotadieresis;GREEK SMALL LETTER IOTA WITH DIALYTIKA -0390;iotadieresistonos;GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -03AF;iotatonos;GREEK SMALL LETTER IOTA WITH TONOS -F6ED;isuperior;SUPERSCRIPT LATIN SMALL LETTER I -0129;itilde;LATIN SMALL LETTER I WITH TILDE -006A;j;LATIN SMALL LETTER J -0135;jcircumflex;LATIN SMALL LETTER J WITH CIRCUMFLEX -006B;k;LATIN SMALL LETTER K -03BA;kappa;GREEK SMALL LETTER KAPPA -0137;kcommaaccent;LATIN SMALL LETTER K WITH CEDILLA -0138;kgreenlandic;LATIN SMALL LETTER KRA -006C;l;LATIN SMALL LETTER L -013A;lacute;LATIN SMALL LETTER L WITH ACUTE -03BB;lambda;GREEK SMALL LETTER LAMDA -013E;lcaron;LATIN SMALL LETTER L WITH CARON -013C;lcommaaccent;LATIN SMALL LETTER L WITH CEDILLA -0140;ldot;LATIN SMALL LETTER L WITH MIDDLE DOT -003C;less;LESS-THAN SIGN -2264;lessequal;LESS-THAN OR EQUAL TO -258C;lfblock;LEFT HALF BLOCK -20A4;lira;LIRA SIGN -F6C0;ll;LATIN SMALL LETTER LL -2227;logicaland;LOGICAL AND -00AC;logicalnot;NOT SIGN -2228;logicalor;LOGICAL OR -017F;longs;LATIN SMALL LETTER LONG S -25CA;lozenge;LOZENGE -0142;lslash;LATIN SMALL LETTER L WITH STROKE -F6EE;lsuperior;SUPERSCRIPT LATIN SMALL LETTER L -2591;ltshade;LIGHT SHADE -006D;m;LATIN SMALL LETTER M -00AF;macron;MACRON -02C9;macron;MODIFIER LETTER MACRON;Duplicate -2642;male;MALE SIGN -2212;minus;MINUS SIGN -2032;minute;PRIME -F6EF;msuperior;SUPERSCRIPT LATIN SMALL LETTER M -00B5;mu;MICRO SIGN -03BC;mu;GREEK SMALL LETTER MU;Duplicate -00D7;multiply;MULTIPLICATION SIGN -266A;musicalnote;EIGHTH NOTE -266B;musicalnotedbl;BEAMED EIGHTH NOTES -006E;n;LATIN SMALL LETTER N -0144;nacute;LATIN SMALL LETTER N WITH ACUTE -0149;napostrophe;LATIN SMALL LETTER N PRECEDED BY APOSTROPHE -0148;ncaron;LATIN SMALL LETTER N WITH CARON -0146;ncommaaccent;LATIN SMALL LETTER N WITH CEDILLA -0039;nine;DIGIT NINE -2089;nineinferior;SUBSCRIPT NINE -F739;nineoldstyle;OLDSTYLE DIGIT NINE -2079;ninesuperior;SUPERSCRIPT NINE -2209;notelement;NOT AN ELEMENT OF -2260;notequal;NOT EQUAL TO -2284;notsubset;NOT A SUBSET OF -207F;nsuperior;SUPERSCRIPT LATIN SMALL LETTER N -00F1;ntilde;LATIN SMALL LETTER N WITH TILDE -03BD;nu;GREEK SMALL LETTER NU -0023;numbersign;NUMBER SIGN -006F;o;LATIN SMALL LETTER O -00F3;oacute;LATIN SMALL LETTER O WITH ACUTE -014F;obreve;LATIN SMALL LETTER O WITH BREVE -00F4;ocircumflex;LATIN SMALL LETTER O WITH CIRCUMFLEX -00F6;odieresis;LATIN SMALL LETTER O WITH DIAERESIS -0153;oe;LATIN SMALL LIGATURE OE -02DB;ogonek;OGONEK -00F2;ograve;LATIN SMALL LETTER O WITH GRAVE -01A1;ohorn;LATIN SMALL LETTER O WITH HORN -0151;ohungarumlaut;LATIN SMALL LETTER O WITH DOUBLE ACUTE -014D;omacron;LATIN SMALL LETTER O WITH MACRON -03C9;omega;GREEK SMALL LETTER OMEGA -03D6;omega1;GREEK PI SYMBOL -03CE;omegatonos;GREEK SMALL LETTER OMEGA WITH TONOS -03BF;omicron;GREEK SMALL LETTER OMICRON -03CC;omicrontonos;GREEK SMALL LETTER OMICRON WITH TONOS -0031;one;DIGIT ONE -2024;onedotenleader;ONE DOT LEADER -215B;oneeighth;VULGAR FRACTION ONE EIGHTH -F6DC;onefitted;PROPORTIONAL DIGIT ONE -00BD;onehalf;VULGAR FRACTION ONE HALF -2081;oneinferior;SUBSCRIPT ONE -F731;oneoldstyle;OLDSTYLE DIGIT ONE -00BC;onequarter;VULGAR FRACTION ONE QUARTER -00B9;onesuperior;SUPERSCRIPT ONE -2153;onethird;VULGAR FRACTION ONE THIRD -25E6;openbullet;WHITE BULLET -00AA;ordfeminine;FEMININE ORDINAL INDICATOR -00BA;ordmasculine;MASCULINE ORDINAL INDICATOR -221F;orthogonal;RIGHT ANGLE -00F8;oslash;LATIN SMALL LETTER O WITH STROKE -01FF;oslashacute;LATIN SMALL LETTER O WITH STROKE AND ACUTE -F6F0;osuperior;SUPERSCRIPT LATIN SMALL LETTER O -00F5;otilde;LATIN SMALL LETTER O WITH TILDE -0070;p;LATIN SMALL LETTER P -00B6;paragraph;PILCROW SIGN -0028;parenleft;LEFT PARENTHESIS -F8ED;parenleftbt;LEFT PAREN BOTTOM -F8EC;parenleftex;LEFT PAREN EXTENDER -208D;parenleftinferior;SUBSCRIPT LEFT PARENTHESIS -207D;parenleftsuperior;SUPERSCRIPT LEFT PARENTHESIS -F8EB;parenlefttp;LEFT PAREN TOP -0029;parenright;RIGHT PARENTHESIS -F8F8;parenrightbt;RIGHT PAREN BOTTOM -F8F7;parenrightex;RIGHT PAREN EXTENDER -208E;parenrightinferior;SUBSCRIPT RIGHT PARENTHESIS -207E;parenrightsuperior;SUPERSCRIPT RIGHT PARENTHESIS -F8F6;parenrighttp;RIGHT PAREN TOP -2202;partialdiff;PARTIAL DIFFERENTIAL -0025;percent;PERCENT SIGN -002E;period;FULL STOP -00B7;periodcentered;MIDDLE DOT -2219;periodcentered;BULLET OPERATOR;Duplicate -F6E7;periodinferior;SUBSCRIPT FULL STOP -F6E8;periodsuperior;SUPERSCRIPT FULL STOP -22A5;perpendicular;UP TACK -2030;perthousand;PER MILLE SIGN -20A7;peseta;PESETA SIGN -03C6;phi;GREEK SMALL LETTER PHI -03D5;phi1;GREEK PHI SYMBOL -03C0;pi;GREEK SMALL LETTER PI -002B;plus;PLUS SIGN -00B1;plusminus;PLUS-MINUS SIGN -211E;prescription;PRESCRIPTION TAKE -220F;product;N-ARY PRODUCT -2282;propersubset;SUBSET OF -2283;propersuperset;SUPERSET OF -221D;proportional;PROPORTIONAL TO -03C8;psi;GREEK SMALL LETTER PSI -0071;q;LATIN SMALL LETTER Q -003F;question;QUESTION MARK -00BF;questiondown;INVERTED QUESTION MARK -F7BF;questiondownsmall;SMALL CAPITAL INVERTED QUESTION MARK -F73F;questionsmall;SMALL CAPITAL QUESTION MARK -0022;quotedbl;QUOTATION MARK -201E;quotedblbase;DOUBLE LOW-9 QUOTATION MARK -201C;quotedblleft;LEFT DOUBLE QUOTATION MARK -201D;quotedblright;RIGHT DOUBLE QUOTATION MARK -2018;quoteleft;LEFT SINGLE QUOTATION MARK -201B;quotereversed;SINGLE HIGH-REVERSED-9 QUOTATION MARK -2019;quoteright;RIGHT SINGLE QUOTATION MARK -201A;quotesinglbase;SINGLE LOW-9 QUOTATION MARK -0027;quotesingle;APOSTROPHE -0072;r;LATIN SMALL LETTER R -0155;racute;LATIN SMALL LETTER R WITH ACUTE -221A;radical;SQUARE ROOT -F8E5;radicalex;RADICAL EXTENDER -0159;rcaron;LATIN SMALL LETTER R WITH CARON -0157;rcommaaccent;LATIN SMALL LETTER R WITH CEDILLA -2286;reflexsubset;SUBSET OF OR EQUAL TO -2287;reflexsuperset;SUPERSET OF OR EQUAL TO -00AE;registered;REGISTERED SIGN -F8E8;registersans;REGISTERED SIGN SANS SERIF -F6DA;registerserif;REGISTERED SIGN SERIF -2310;revlogicalnot;REVERSED NOT SIGN -03C1;rho;GREEK SMALL LETTER RHO -02DA;ring;RING ABOVE -F6F1;rsuperior;SUPERSCRIPT LATIN SMALL LETTER R -2590;rtblock;RIGHT HALF BLOCK -F6DD;rupiah;RUPIAH SIGN -0073;s;LATIN SMALL LETTER S -015B;sacute;LATIN SMALL LETTER S WITH ACUTE -0161;scaron;LATIN SMALL LETTER S WITH CARON -015F;scedilla;LATIN SMALL LETTER S WITH CEDILLA -F6C2;scedilla;LATIN SMALL LETTER S WITH CEDILLA;Duplicate -015D;scircumflex;LATIN SMALL LETTER S WITH CIRCUMFLEX -0219;scommaaccent;LATIN SMALL LETTER S WITH COMMA BELOW -2033;second;DOUBLE PRIME -00A7;section;SECTION SIGN -003B;semicolon;SEMICOLON -0037;seven;DIGIT SEVEN -215E;seveneighths;VULGAR FRACTION SEVEN EIGHTHS -2087;seveninferior;SUBSCRIPT SEVEN -F737;sevenoldstyle;OLDSTYLE DIGIT SEVEN -2077;sevensuperior;SUPERSCRIPT SEVEN -2592;shade;MEDIUM SHADE -03C3;sigma;GREEK SMALL LETTER SIGMA -03C2;sigma1;GREEK SMALL LETTER FINAL SIGMA -223C;similar;TILDE OPERATOR -0036;six;DIGIT SIX -2086;sixinferior;SUBSCRIPT SIX -F736;sixoldstyle;OLDSTYLE DIGIT SIX -2076;sixsuperior;SUPERSCRIPT SIX -002F;slash;SOLIDUS -263A;smileface;WHITE SMILING FACE -0020;space;SPACE -00A0;space;NO-BREAK SPACE;Duplicate -2660;spade;BLACK SPADE SUIT -F6F2;ssuperior;SUPERSCRIPT LATIN SMALL LETTER S -00A3;sterling;POUND SIGN -220B;suchthat;CONTAINS AS MEMBER -2211;summation;N-ARY SUMMATION -263C;sun;WHITE SUN WITH RAYS -0074;t;LATIN SMALL LETTER T -03C4;tau;GREEK SMALL LETTER TAU -0167;tbar;LATIN SMALL LETTER T WITH STROKE -0165;tcaron;LATIN SMALL LETTER T WITH CARON -0163;tcommaaccent;LATIN SMALL LETTER T WITH CEDILLA -021B;tcommaaccent;LATIN SMALL LETTER T WITH COMMA BELOW;Duplicate -2234;therefore;THEREFORE -03B8;theta;GREEK SMALL LETTER THETA -03D1;theta1;GREEK THETA SYMBOL -00FE;thorn;LATIN SMALL LETTER THORN -0033;three;DIGIT THREE -215C;threeeighths;VULGAR FRACTION THREE EIGHTHS -2083;threeinferior;SUBSCRIPT THREE -F733;threeoldstyle;OLDSTYLE DIGIT THREE -00BE;threequarters;VULGAR FRACTION THREE QUARTERS -F6DE;threequartersemdash;THREE QUARTERS EM DASH -00B3;threesuperior;SUPERSCRIPT THREE -02DC;tilde;SMALL TILDE -0303;tildecomb;COMBINING TILDE -0384;tonos;GREEK TONOS -2122;trademark;TRADE MARK SIGN -F8EA;trademarksans;TRADE MARK SIGN SANS SERIF -F6DB;trademarkserif;TRADE MARK SIGN SERIF -25BC;triagdn;BLACK DOWN-POINTING TRIANGLE -25C4;triaglf;BLACK LEFT-POINTING POINTER -25BA;triagrt;BLACK RIGHT-POINTING POINTER -25B2;triagup;BLACK UP-POINTING TRIANGLE -F6F3;tsuperior;SUPERSCRIPT LATIN SMALL LETTER T -0032;two;DIGIT TWO -2025;twodotenleader;TWO DOT LEADER -2082;twoinferior;SUBSCRIPT TWO -F732;twooldstyle;OLDSTYLE DIGIT TWO -00B2;twosuperior;SUPERSCRIPT TWO -2154;twothirds;VULGAR FRACTION TWO THIRDS -0075;u;LATIN SMALL LETTER U -00FA;uacute;LATIN SMALL LETTER U WITH ACUTE -016D;ubreve;LATIN SMALL LETTER U WITH BREVE -00FB;ucircumflex;LATIN SMALL LETTER U WITH CIRCUMFLEX -00FC;udieresis;LATIN SMALL LETTER U WITH DIAERESIS -00F9;ugrave;LATIN SMALL LETTER U WITH GRAVE -01B0;uhorn;LATIN SMALL LETTER U WITH HORN -0171;uhungarumlaut;LATIN SMALL LETTER U WITH DOUBLE ACUTE -016B;umacron;LATIN SMALL LETTER U WITH MACRON -005F;underscore;LOW LINE -2017;underscoredbl;DOUBLE LOW LINE -222A;union;UNION -2200;universal;FOR ALL -0173;uogonek;LATIN SMALL LETTER U WITH OGONEK -2580;upblock;UPPER HALF BLOCK -03C5;upsilon;GREEK SMALL LETTER UPSILON -03CB;upsilondieresis;GREEK SMALL LETTER UPSILON WITH DIALYTIKA -03B0;upsilondieresistonos;GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -03CD;upsilontonos;GREEK SMALL LETTER UPSILON WITH TONOS -016F;uring;LATIN SMALL LETTER U WITH RING ABOVE -0169;utilde;LATIN SMALL LETTER U WITH TILDE -0076;v;LATIN SMALL LETTER V -0077;w;LATIN SMALL LETTER W -1E83;wacute;LATIN SMALL LETTER W WITH ACUTE -0175;wcircumflex;LATIN SMALL LETTER W WITH CIRCUMFLEX -1E85;wdieresis;LATIN SMALL LETTER W WITH DIAERESIS -2118;weierstrass;SCRIPT CAPITAL P -1E81;wgrave;LATIN SMALL LETTER W WITH GRAVE -0078;x;LATIN SMALL LETTER X -03BE;xi;GREEK SMALL LETTER XI -0079;y;LATIN SMALL LETTER Y -00FD;yacute;LATIN SMALL LETTER Y WITH ACUTE -0177;ycircumflex;LATIN SMALL LETTER Y WITH CIRCUMFLEX -00FF;ydieresis;LATIN SMALL LETTER Y WITH DIAERESIS -00A5;yen;YEN SIGN -1EF3;ygrave;LATIN SMALL LETTER Y WITH GRAVE -007A;z;LATIN SMALL LETTER Z -017A;zacute;LATIN SMALL LETTER Z WITH ACUTE -017E;zcaron;LATIN SMALL LETTER Z WITH CARON -017C;zdotaccent;LATIN SMALL LETTER Z WITH DOT ABOVE -0030;zero;DIGIT ZERO -2080;zeroinferior;SUBSCRIPT ZERO -F730;zerooldstyle;OLDSTYLE DIGIT ZERO -2070;zerosuperior;SUPERSCRIPT ZERO -03B6;zeta;GREEK SMALL LETTER ZETA -""" - - -t1_bias = 0 -glyph_list = [] - - -def adobe_glyph_names(): - """return the list of glyph names from the adobe list""" - - lines = string.split( adobe_glyph_list, '\n' ) - glyphs = [] - - for line in lines: - if line: - fields = string.split( line, ';' ) -# print fields[0] + ' - ' + fields[1] - glyphs.append( fields[1] ) - - return glyphs - - -def adobe_glyph_values(): - """return the list of glyph names and their unicode values""" - - lines = string.split( adobe_glyph_list, '\n' ) - glyphs = [] - values = [] - - for line in lines: - if line: - fields = string.split( line, ';' ) -# print fields[0] + ' - ' + fields[1] - glyphs.append( fields[1] ) - values.append( fields[0] ) - - return glyphs, values - - -def filter_glyph_names( alist, filter ): - """filter 'alist' by taking _out_ all glyph names that are in 'filter'""" - - count = 0 - extras = [] - - for name in alist: - try: - filtered_index = filter.index( name ) - except: - extras.append( name ) - - 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_glyph_list( file, base_list, adobe_list ): - write = file.write - - name_list = [] - - write( " static const char* const ps_glyph_names[] =\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 - - -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() - - write( "\n" ) - write( " static const unsigned short ps_names_to_unicode[" + \ - repr( len( sid_list ) + len( adobe_list ) + 1 ) + "] =\n" ) - write( " {\n" ) - - for name in sid_list: - try: - index = agl_names.index( name ) - write( " 0x" + agl_unicodes[index] + ",\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] + ",\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" ) - - -def dump_encoding( file, encoding_name, encoding_list ): - """dumps a given encoding""" - - write = file.write - - 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" ) - - -def main(): - """main program body""" - - if len( sys.argv ) != 2: - print __doc__ % sys.argv[0] - sys.exit( 1 ) - - file = open( sys.argv[1], "w\n" ) - write = file.write - - 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 = filter_glyph_names( mac_standard_names, adobe_glyph_names() ) - mac_extras = filter_glyph_names( mac_extras, 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. - # - 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( "/* */\n" ) - write( "/* PostScript glyph names (specification only). */\n" ) - write( "/* */\n" ) - write( "/* Copyright 2000-2001 by */\n" ) - write( "/* David Turner, Robert Wilhelm, and Werner Lemberg. */\n" ) - write( "/* */\n" ) - write( "/* This file is part of the FreeType project, and may only be used, */\n" ) - write( "/* modified, and distributed under the terms of the FreeType project */\n" ) - write( "/* license, LICENSE.TXT. By continuing to use, modify, or distribute */\n" ) - write( "/* this file you indicate that you have read the license and */\n" ) - write( "/* understand and accept it fully. */\n" ) - write( "/* */\n" ) - write( "/***************************************************************************/\n" ) - write( "\n" ) - write( "\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) - # - name_list = dump_glyph_list( file, base_list, adobe_list ) - - # 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 ) - - dump_encoding( file, "t1_standard_encoding", t1_standard_encoding ) - dump_encoding( file, "t1_expert_encoding", t1_expert_encoding ) - - write( "/* END */\n" ) - - -# Now run the main routine -# -main() - - -# END +#!/usr/bin/env python +# + +# +# FreeType 2 glyph name 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. + + +"""\ + +usage: %s + + This very simple python script is used to generate 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 + + +# This table is used to name the glyph according to the Macintosh +# specification. It is used by the TrueType Postscript names table +# +# see http://fonts.apple.com/TTRefMan/RM06/Chap6post.html +# for the official list +# +mac_standard_names = \ +[ + # 0 + ".notdef", ".null", "nonmarkingreturn", "space", "exclam", + "quotedbl", "numbersign", "dollar", "percent", "ampersand", + + # 10 + "quotesingle", "parenleft", "parenright", "asterisk", "plus", + "comma", "hyphen", "period", "slash", "zero", + + # 20 + "one", "two", "three", "four", "five", + "six", "seven", "eight", "nine", "colon", + + # 30 + "semicolon", "less", "equal", "greater", "question", + "at", "A", "B", "C", "D", + + # 40 + "E", "F", "G", "H", "I", + "J", "K", "L", "M", "N", + + # 50 + "O", "P", "Q", "R", "S", + "T", "U", "V", "W", "X", + + # 60 + "Y", "Z", "bracketleft", "backslash", "bracketright", + "asciicircum", "underscore", "grave", "a", "b", + + # 70 + "c", "d", "e", "f", "g", + "h", "i", "j", "k", "l", + + # 80 + "m", "n", "o", "p", "q", + "r", "s", "t", "u", "v", + + # 90 + "w", "x", "y", "z", "braceleft", + "bar", "braceright", "asciitilde", "Adieresis", "Aring", + + # 100 + "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", + "aacute", "agrave", "acircumflex", "adieresis", "atilde", + + # 110 + "aring", "ccedilla", "eacute", "egrave", "ecircumflex", + "edieresis", "iacute", "igrave", "icircumflex", "idieresis", + + # 120 + "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", + "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", + + # 130 + "dagger", "degree", "cent", "sterling", "section", + "bullet", "paragraph", "germandbls", "registered", "copyright", + + # 140 + "trademark", "acute", "dieresis", "notequal", "AE", + "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", + + # 150 + "yen", "mu", "partialdiff", "summation", "product", + "pi", "integral", "ordfeminine", "ordmasculine", "Omega", + + # 160 + "ae", "oslash", "questiondown", "exclamdown", "logicalnot", + "radical", "florin", "approxequal", "Delta", "guillemotleft", + + # 170 + "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", + "Otilde", "OE", "oe", "endash", "emdash", + + # 180 + "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", + "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", + + # 190 + "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", + "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", + "Acircumflex", + + # 200 + "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", + "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", + + # 210 + "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", + "dotlessi", "circumflex", "tilde", "macron", "breve", + + # 220 + "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", + "caron", "Lslash", "lslash", "Scaron", "scaron", + + # 230 + "Zcaron", "zcaron", "brokenbar", "Eth", "eth", + "Yacute", "yacute", "Thorn", "thorn", "minus", + + # 240 + "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", + "onequarter", "threequarters", "franc", "Gbreve", "gbreve", + + # 250 + "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", + "Ccaron", "ccaron", "dcroat" +] + + +# 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 +# +sid_standard_names = \ +[ + # 0 + ".notdef", "space", "exclam", "quotedbl", "numbersign", + "dollar", "percent", "ampersand", "quoteright", "parenleft", + + # 10 + "parenright", "asterisk", "plus", "comma", "hyphen", + "period", "slash", "zero", "one", "two", + + # 20 + "three", "four", "five", "six", "seven", + "eight", "nine", "colon", "semicolon", "less", + + # 30 + "equal", "greater", "question", "at", "A", + "B", "C", "D", "E", "F", + + # 40 + "G", "H", "I", "J", "K", + "L", "M", "N", "O", "P", + + # 50 + "Q", "R", "S", "T", "U", + "V", "W", "X", "Y", "Z", + + # 60 + "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", + "quoteleft", "a", "b", "c", "d", + + # 70 + "e", "f", "g", "h", "i", + "j", "k", "l", "m", "n", + + # 80 + "o", "p", "q", "r", "s", + "t", "u", "v", "w", "x", + + # 90 + "y", "z", "braceleft", "bar", "braceright", + "asciitilde", "exclamdown", "cent", "sterling", "fraction", + + # 100 + "yen", "florin", "section", "currency", "quotesingle", + "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", + + # 110 + "fl", "endash", "dagger", "daggerdbl", "periodcentered", + "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", + + # 120 + "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", + "acute", "circumflex", "tilde", "macron", "breve", + + # 130 + "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", + "ogonek", "caron", "emdash", "AE", "ordfeminine", + + # 140 + "Lslash", "Oslash", "OE", "ordmasculine", "ae", + "dotlessi", "lslash", "oslash", "oe", "germandbls", + + # 150 + "onesuperior", "logicalnot", "mu", "trademark", "Eth", + "onehalf", "plusminus", "Thorn", "onequarter", "divide", + + # 160 + "brokenbar", "degree", "thorn", "threequarters", "twosuperior", + "registered", "minus", "eth", "multiply", "threesuperior", + + # 170 + "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", + "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", + + # 180 + "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", + "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", + + # 190 + "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", + "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", + + # 200 + "aacute", "acircumflex", "adieresis", "agrave", "aring", + "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", + + # 210 + "egrave", "iacute", "icircumflex", "idieresis", "igrave", + "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", + + # 220 + "otilde", "scaron", "uacute", "ucircumflex", "udieresis", + "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", + + # 230 + "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", + "Acutesmall", + "parenleftsuperior", "parenrightsuperior", "twodotenleader", + "onedotenleader", "zerooldstyle", + + # 240 + "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", + "commasuperior", + + # 250 + "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", + "bsuperior", + "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", + + # 260 + "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", + "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", + + # 270 + "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", + "Asmall", + "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", + + # 280 + "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", + "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", + + # 290 + "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", + "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", + + # 300 + "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", + "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", + "Dieresissmall", + + # 310 + "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", + "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", + "questiondownsmall", + + # 320 + "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", + "twothirds", "zerosuperior", "foursuperior", "fivesuperior", + "sixsuperior", + + # 330 + "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", + "oneinferior", + "twoinferior", "threeinferior", "fourinferior", "fiveinferior", + "sixinferior", + + # 340 + "seveninferior", "eightinferior", "nineinferior", "centinferior", + "dollarinferior", + "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", + "Acircumflexsmall", + + # 350 + "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", + "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", + "Igravesmall", + + # 360 + "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", + "Ntildesmall", + "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", + "Odieresissmall", + + # 370 + "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", + "001.000", + + # 380 + "001.001", "001.002", "001.003", "Black", "Bold", + "Book", "Light", "Medium", "Regular", "Roman", + + # 390 + "Semibold" +] + + +# this table maps character code of the Adobe Standard Type 1 +# encoding to glyph indexes in the sid_standard_names table +# +t1_standard_encoding = \ +[ + 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 +] + + +# this table maps character code of the Adobe Expert Type 1 +# encoding to glyph indexes in the sid_standard_names table +# +t1_expert_encoding = \ +[ + 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 data has been taken literally from the file `glyphlist.txt', +# version 1.2, 22 Oct 1998. It is available from +# +# http://partners.adobe.com/asn/developer/typeforum/unicodegn.html +# +adobe_glyph_list = """\ +0041;A;LATIN CAPITAL LETTER A +00C6;AE;LATIN CAPITAL LETTER AE +01FC;AEacute;LATIN CAPITAL LETTER AE WITH ACUTE +F7E6;AEsmall;LATIN SMALL CAPITAL LETTER AE +00C1;Aacute;LATIN CAPITAL LETTER A WITH ACUTE +F7E1;Aacutesmall;LATIN SMALL CAPITAL LETTER A WITH ACUTE +0102;Abreve;LATIN CAPITAL LETTER A WITH BREVE +00C2;Acircumflex;LATIN CAPITAL LETTER A WITH CIRCUMFLEX +F7E2;Acircumflexsmall;LATIN SMALL CAPITAL LETTER A WITH CIRCUMFLEX +F6C9;Acute;CAPITAL ACUTE ACCENT +F7B4;Acutesmall;SMALL CAPITAL ACUTE ACCENT +00C4;Adieresis;LATIN CAPITAL LETTER A WITH DIAERESIS +F7E4;Adieresissmall;LATIN SMALL CAPITAL LETTER A WITH DIAERESIS +00C0;Agrave;LATIN CAPITAL LETTER A WITH GRAVE +F7E0;Agravesmall;LATIN SMALL CAPITAL LETTER A WITH GRAVE +0391;Alpha;GREEK CAPITAL LETTER ALPHA +0386;Alphatonos;GREEK CAPITAL LETTER ALPHA WITH TONOS +0100;Amacron;LATIN CAPITAL LETTER A WITH MACRON +0104;Aogonek;LATIN CAPITAL LETTER A WITH OGONEK +00C5;Aring;LATIN CAPITAL LETTER A WITH RING ABOVE +01FA;Aringacute;LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE +F7E5;Aringsmall;LATIN SMALL CAPITAL LETTER A WITH RING ABOVE +F761;Asmall;LATIN SMALL CAPITAL LETTER A +00C3;Atilde;LATIN CAPITAL LETTER A WITH TILDE +F7E3;Atildesmall;LATIN SMALL CAPITAL LETTER A WITH TILDE +0042;B;LATIN CAPITAL LETTER B +0392;Beta;GREEK CAPITAL LETTER BETA +F6F4;Brevesmall;SMALL CAPITAL BREVE +F762;Bsmall;LATIN SMALL CAPITAL LETTER B +0043;C;LATIN CAPITAL LETTER C +0106;Cacute;LATIN CAPITAL LETTER C WITH ACUTE +F6CA;Caron;CAPITAL CARON +F6F5;Caronsmall;SMALL CAPITAL CARON +010C;Ccaron;LATIN CAPITAL LETTER C WITH CARON +00C7;Ccedilla;LATIN CAPITAL LETTER C WITH CEDILLA +F7E7;Ccedillasmall;LATIN SMALL CAPITAL LETTER C WITH CEDILLA +0108;Ccircumflex;LATIN CAPITAL LETTER C WITH CIRCUMFLEX +010A;Cdotaccent;LATIN CAPITAL LETTER C WITH DOT ABOVE +F7B8;Cedillasmall;SMALL CAPITAL CEDILLA +03A7;Chi;GREEK CAPITAL LETTER CHI +F6F6;Circumflexsmall;SMALL CAPITAL MODIFIER LETTER CIRCUMFLEX ACCENT +F763;Csmall;LATIN SMALL CAPITAL LETTER C +0044;D;LATIN CAPITAL LETTER D +010E;Dcaron;LATIN CAPITAL LETTER D WITH CARON +0110;Dcroat;LATIN CAPITAL LETTER D WITH STROKE +2206;Delta;INCREMENT +0394;Delta;GREEK CAPITAL LETTER DELTA;Duplicate +F6CB;Dieresis;CAPITAL DIAERESIS +F6CC;DieresisAcute;CAPITAL DIAERESIS ACUTE ACCENT +F6CD;DieresisGrave;CAPITAL DIAERESIS GRAVE ACCENT +F7A8;Dieresissmall;SMALL CAPITAL DIAERESIS +F6F7;Dotaccentsmall;SMALL CAPITAL DOT ABOVE +F764;Dsmall;LATIN SMALL CAPITAL LETTER D +0045;E;LATIN CAPITAL LETTER E +00C9;Eacute;LATIN CAPITAL LETTER E WITH ACUTE +F7E9;Eacutesmall;LATIN SMALL CAPITAL LETTER E WITH ACUTE +0114;Ebreve;LATIN CAPITAL LETTER E WITH BREVE +011A;Ecaron;LATIN CAPITAL LETTER E WITH CARON +00CA;Ecircumflex;LATIN CAPITAL LETTER E WITH CIRCUMFLEX +F7EA;Ecircumflexsmall;LATIN SMALL CAPITAL LETTER E WITH CIRCUMFLEX +00CB;Edieresis;LATIN CAPITAL LETTER E WITH DIAERESIS +F7EB;Edieresissmall;LATIN SMALL CAPITAL LETTER E WITH DIAERESIS +0116;Edotaccent;LATIN CAPITAL LETTER E WITH DOT ABOVE +00C8;Egrave;LATIN CAPITAL LETTER E WITH GRAVE +F7E8;Egravesmall;LATIN SMALL CAPITAL LETTER E WITH GRAVE +0112;Emacron;LATIN CAPITAL LETTER E WITH MACRON +014A;Eng;LATIN CAPITAL LETTER ENG +0118;Eogonek;LATIN CAPITAL LETTER E WITH OGONEK +0395;Epsilon;GREEK CAPITAL LETTER EPSILON +0388;Epsilontonos;GREEK CAPITAL LETTER EPSILON WITH TONOS +F765;Esmall;LATIN SMALL CAPITAL LETTER E +0397;Eta;GREEK CAPITAL LETTER ETA +0389;Etatonos;GREEK CAPITAL LETTER ETA WITH TONOS +00D0;Eth;LATIN CAPITAL LETTER ETH +F7F0;Ethsmall;LATIN SMALL CAPITAL LETTER ETH +20AC;Euro;EURO SIGN +0046;F;LATIN CAPITAL LETTER F +F766;Fsmall;LATIN SMALL CAPITAL LETTER F +0047;G;LATIN CAPITAL LETTER G +0393;Gamma;GREEK CAPITAL LETTER GAMMA +011E;Gbreve;LATIN CAPITAL LETTER G WITH BREVE +01E6;Gcaron;LATIN CAPITAL LETTER G WITH CARON +011C;Gcircumflex;LATIN CAPITAL LETTER G WITH CIRCUMFLEX +0122;Gcommaaccent;LATIN CAPITAL LETTER G WITH CEDILLA +0120;Gdotaccent;LATIN CAPITAL LETTER G WITH DOT ABOVE +F6CE;Grave;CAPITAL GRAVE ACCENT +F760;Gravesmall;SMALL CAPITAL GRAVE ACCENT +F767;Gsmall;LATIN SMALL CAPITAL LETTER G +0048;H;LATIN CAPITAL LETTER H +25CF;H18533;BLACK CIRCLE +25AA;H18543;BLACK SMALL SQUARE +25AB;H18551;WHITE SMALL SQUARE +25A1;H22073;WHITE SQUARE +0126;Hbar;LATIN CAPITAL LETTER H WITH STROKE +0124;Hcircumflex;LATIN CAPITAL LETTER H WITH CIRCUMFLEX +F768;Hsmall;LATIN SMALL CAPITAL LETTER H +F6CF;Hungarumlaut;CAPITAL DOUBLE ACUTE ACCENT +F6F8;Hungarumlautsmall;SMALL CAPITAL DOUBLE ACUTE ACCENT +0049;I;LATIN CAPITAL LETTER I +0132;IJ;LATIN CAPITAL LIGATURE IJ +00CD;Iacute;LATIN CAPITAL LETTER I WITH ACUTE +F7ED;Iacutesmall;LATIN SMALL CAPITAL LETTER I WITH ACUTE +012C;Ibreve;LATIN CAPITAL LETTER I WITH BREVE +00CE;Icircumflex;LATIN CAPITAL LETTER I WITH CIRCUMFLEX +F7EE;Icircumflexsmall;LATIN SMALL CAPITAL LETTER I WITH CIRCUMFLEX +00CF;Idieresis;LATIN CAPITAL LETTER I WITH DIAERESIS +F7EF;Idieresissmall;LATIN SMALL CAPITAL LETTER I WITH DIAERESIS +0130;Idotaccent;LATIN CAPITAL LETTER I WITH DOT ABOVE +2111;Ifraktur;BLACK-LETTER CAPITAL I +00CC;Igrave;LATIN CAPITAL LETTER I WITH GRAVE +F7EC;Igravesmall;LATIN SMALL CAPITAL LETTER I WITH GRAVE +012A;Imacron;LATIN CAPITAL LETTER I WITH MACRON +012E;Iogonek;LATIN CAPITAL LETTER I WITH OGONEK +0399;Iota;GREEK CAPITAL LETTER IOTA +03AA;Iotadieresis;GREEK CAPITAL LETTER IOTA WITH DIALYTIKA +038A;Iotatonos;GREEK CAPITAL LETTER IOTA WITH TONOS +F769;Ismall;LATIN SMALL CAPITAL LETTER I +0128;Itilde;LATIN CAPITAL LETTER I WITH TILDE +004A;J;LATIN CAPITAL LETTER J +0134;Jcircumflex;LATIN CAPITAL LETTER J WITH CIRCUMFLEX +F76A;Jsmall;LATIN SMALL CAPITAL LETTER J +004B;K;LATIN CAPITAL LETTER K +039A;Kappa;GREEK CAPITAL LETTER KAPPA +0136;Kcommaaccent;LATIN CAPITAL LETTER K WITH CEDILLA +F76B;Ksmall;LATIN SMALL CAPITAL LETTER K +004C;L;LATIN CAPITAL LETTER L +F6BF;LL;LATIN CAPITAL LETTER LL +0139;Lacute;LATIN CAPITAL LETTER L WITH ACUTE +039B;Lambda;GREEK CAPITAL LETTER LAMDA +013D;Lcaron;LATIN CAPITAL LETTER L WITH CARON +013B;Lcommaaccent;LATIN CAPITAL LETTER L WITH CEDILLA +013F;Ldot;LATIN CAPITAL LETTER L WITH MIDDLE DOT +0141;Lslash;LATIN CAPITAL LETTER L WITH STROKE +F6F9;Lslashsmall;LATIN SMALL CAPITAL LETTER L WITH STROKE +F76C;Lsmall;LATIN SMALL CAPITAL LETTER L +004D;M;LATIN CAPITAL LETTER M +F6D0;Macron;CAPITAL MACRON +F7AF;Macronsmall;SMALL CAPITAL MACRON +F76D;Msmall;LATIN SMALL CAPITAL LETTER M +039C;Mu;GREEK CAPITAL LETTER MU +004E;N;LATIN CAPITAL LETTER N +0143;Nacute;LATIN CAPITAL LETTER N WITH ACUTE +0147;Ncaron;LATIN CAPITAL LETTER N WITH CARON +0145;Ncommaaccent;LATIN CAPITAL LETTER N WITH CEDILLA +F76E;Nsmall;LATIN SMALL CAPITAL LETTER N +00D1;Ntilde;LATIN CAPITAL LETTER N WITH TILDE +F7F1;Ntildesmall;LATIN SMALL CAPITAL LETTER N WITH TILDE +039D;Nu;GREEK CAPITAL LETTER NU +004F;O;LATIN CAPITAL LETTER O +0152;OE;LATIN CAPITAL LIGATURE OE +F6FA;OEsmall;LATIN SMALL CAPITAL LIGATURE OE +00D3;Oacute;LATIN CAPITAL LETTER O WITH ACUTE +F7F3;Oacutesmall;LATIN SMALL CAPITAL LETTER O WITH ACUTE +014E;Obreve;LATIN CAPITAL LETTER O WITH BREVE +00D4;Ocircumflex;LATIN CAPITAL LETTER O WITH CIRCUMFLEX +F7F4;Ocircumflexsmall;LATIN SMALL CAPITAL LETTER O WITH CIRCUMFLEX +00D6;Odieresis;LATIN CAPITAL LETTER O WITH DIAERESIS +F7F6;Odieresissmall;LATIN SMALL CAPITAL LETTER O WITH DIAERESIS +F6FB;Ogoneksmall;SMALL CAPITAL OGONEK +00D2;Ograve;LATIN CAPITAL LETTER O WITH GRAVE +F7F2;Ogravesmall;LATIN SMALL CAPITAL LETTER O WITH GRAVE +01A0;Ohorn;LATIN CAPITAL LETTER O WITH HORN +0150;Ohungarumlaut;LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +014C;Omacron;LATIN CAPITAL LETTER O WITH MACRON +2126;Omega;OHM SIGN +03A9;Omega;GREEK CAPITAL LETTER OMEGA;Duplicate +038F;Omegatonos;GREEK CAPITAL LETTER OMEGA WITH TONOS +039F;Omicron;GREEK CAPITAL LETTER OMICRON +038C;Omicrontonos;GREEK CAPITAL LETTER OMICRON WITH TONOS +00D8;Oslash;LATIN CAPITAL LETTER O WITH STROKE +01FE;Oslashacute;LATIN CAPITAL LETTER O WITH STROKE AND ACUTE +F7F8;Oslashsmall;LATIN SMALL CAPITAL LETTER O WITH STROKE +F76F;Osmall;LATIN SMALL CAPITAL LETTER O +00D5;Otilde;LATIN CAPITAL LETTER O WITH TILDE +F7F5;Otildesmall;LATIN SMALL CAPITAL LETTER O WITH TILDE +0050;P;LATIN CAPITAL LETTER P +03A6;Phi;GREEK CAPITAL LETTER PHI +03A0;Pi;GREEK CAPITAL LETTER PI +03A8;Psi;GREEK CAPITAL LETTER PSI +F770;Psmall;LATIN SMALL CAPITAL LETTER P +0051;Q;LATIN CAPITAL LETTER Q +F771;Qsmall;LATIN SMALL CAPITAL LETTER Q +0052;R;LATIN CAPITAL LETTER R +0154;Racute;LATIN CAPITAL LETTER R WITH ACUTE +0158;Rcaron;LATIN CAPITAL LETTER R WITH CARON +0156;Rcommaaccent;LATIN CAPITAL LETTER R WITH CEDILLA +211C;Rfraktur;BLACK-LETTER CAPITAL R +03A1;Rho;GREEK CAPITAL LETTER RHO +F6FC;Ringsmall;SMALL CAPITAL RING ABOVE +F772;Rsmall;LATIN SMALL CAPITAL LETTER R +0053;S;LATIN CAPITAL LETTER S +250C;SF010000;BOX DRAWINGS LIGHT DOWN AND RIGHT +2514;SF020000;BOX DRAWINGS LIGHT UP AND RIGHT +2510;SF030000;BOX DRAWINGS LIGHT DOWN AND LEFT +2518;SF040000;BOX DRAWINGS LIGHT UP AND LEFT +253C;SF050000;BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL +252C;SF060000;BOX DRAWINGS LIGHT DOWN AND HORIZONTAL +2534;SF070000;BOX DRAWINGS LIGHT UP AND HORIZONTAL +251C;SF080000;BOX DRAWINGS LIGHT VERTICAL AND RIGHT +2524;SF090000;BOX DRAWINGS LIGHT VERTICAL AND LEFT +2500;SF100000;BOX DRAWINGS LIGHT HORIZONTAL +2502;SF110000;BOX DRAWINGS LIGHT VERTICAL +2561;SF190000;BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE +2562;SF200000;BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE +2556;SF210000;BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE +2555;SF220000;BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE +2563;SF230000;BOX DRAWINGS DOUBLE VERTICAL AND LEFT +2551;SF240000;BOX DRAWINGS DOUBLE VERTICAL +2557;SF250000;BOX DRAWINGS DOUBLE DOWN AND LEFT +255D;SF260000;BOX DRAWINGS DOUBLE UP AND LEFT +255C;SF270000;BOX DRAWINGS UP DOUBLE AND LEFT SINGLE +255B;SF280000;BOX DRAWINGS UP SINGLE AND LEFT DOUBLE +255E;SF360000;BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE +255F;SF370000;BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE +255A;SF380000;BOX DRAWINGS DOUBLE UP AND RIGHT +2554;SF390000;BOX DRAWINGS DOUBLE DOWN AND RIGHT +2569;SF400000;BOX DRAWINGS DOUBLE UP AND HORIZONTAL +2566;SF410000;BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL +2560;SF420000;BOX DRAWINGS DOUBLE VERTICAL AND RIGHT +2550;SF430000;BOX DRAWINGS DOUBLE HORIZONTAL +256C;SF440000;BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL +2567;SF450000;BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE +2568;SF460000;BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE +2564;SF470000;BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE +2565;SF480000;BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE +2559;SF490000;BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE +2558;SF500000;BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE +2552;SF510000;BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE +2553;SF520000;BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE +256B;SF530000;BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE +256A;SF540000;BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE +015A;Sacute;LATIN CAPITAL LETTER S WITH ACUTE +0160;Scaron;LATIN CAPITAL LETTER S WITH CARON +F6FD;Scaronsmall;LATIN SMALL CAPITAL LETTER S WITH CARON +015E;Scedilla;LATIN CAPITAL LETTER S WITH CEDILLA +F6C1;Scedilla;LATIN CAPITAL LETTER S WITH CEDILLA;Duplicate +015C;Scircumflex;LATIN CAPITAL LETTER S WITH CIRCUMFLEX +0218;Scommaaccent;LATIN CAPITAL LETTER S WITH COMMA BELOW +03A3;Sigma;GREEK CAPITAL LETTER SIGMA +F773;Ssmall;LATIN SMALL CAPITAL LETTER S +0054;T;LATIN CAPITAL LETTER T +03A4;Tau;GREEK CAPITAL LETTER TAU +0166;Tbar;LATIN CAPITAL LETTER T WITH STROKE +0164;Tcaron;LATIN CAPITAL LETTER T WITH CARON +0162;Tcommaaccent;LATIN CAPITAL LETTER T WITH CEDILLA +021A;Tcommaaccent;LATIN CAPITAL LETTER T WITH COMMA BELOW;Duplicate +0398;Theta;GREEK CAPITAL LETTER THETA +00DE;Thorn;LATIN CAPITAL LETTER THORN +F7FE;Thornsmall;LATIN SMALL CAPITAL LETTER THORN +F6FE;Tildesmall;SMALL CAPITAL SMALL TILDE +F774;Tsmall;LATIN SMALL CAPITAL LETTER T +0055;U;LATIN CAPITAL LETTER U +00DA;Uacute;LATIN CAPITAL LETTER U WITH ACUTE +F7FA;Uacutesmall;LATIN SMALL CAPITAL LETTER U WITH ACUTE +016C;Ubreve;LATIN CAPITAL LETTER U WITH BREVE +00DB;Ucircumflex;LATIN CAPITAL LETTER U WITH CIRCUMFLEX +F7FB;Ucircumflexsmall;LATIN SMALL CAPITAL LETTER U WITH CIRCUMFLEX +00DC;Udieresis;LATIN CAPITAL LETTER U WITH DIAERESIS +F7FC;Udieresissmall;LATIN SMALL CAPITAL LETTER U WITH DIAERESIS +00D9;Ugrave;LATIN CAPITAL LETTER U WITH GRAVE +F7F9;Ugravesmall;LATIN SMALL CAPITAL LETTER U WITH GRAVE +01AF;Uhorn;LATIN CAPITAL LETTER U WITH HORN +0170;Uhungarumlaut;LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +016A;Umacron;LATIN CAPITAL LETTER U WITH MACRON +0172;Uogonek;LATIN CAPITAL LETTER U WITH OGONEK +03A5;Upsilon;GREEK CAPITAL LETTER UPSILON +03D2;Upsilon1;GREEK UPSILON WITH HOOK SYMBOL +03AB;Upsilondieresis;GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA +038E;Upsilontonos;GREEK CAPITAL LETTER UPSILON WITH TONOS +016E;Uring;LATIN CAPITAL LETTER U WITH RING ABOVE +F775;Usmall;LATIN SMALL CAPITAL LETTER U +0168;Utilde;LATIN CAPITAL LETTER U WITH TILDE +0056;V;LATIN CAPITAL LETTER V +F776;Vsmall;LATIN SMALL CAPITAL LETTER V +0057;W;LATIN CAPITAL LETTER W +1E82;Wacute;LATIN CAPITAL LETTER W WITH ACUTE +0174;Wcircumflex;LATIN CAPITAL LETTER W WITH CIRCUMFLEX +1E84;Wdieresis;LATIN CAPITAL LETTER W WITH DIAERESIS +1E80;Wgrave;LATIN CAPITAL LETTER W WITH GRAVE +F777;Wsmall;LATIN SMALL CAPITAL LETTER W +0058;X;LATIN CAPITAL LETTER X +039E;Xi;GREEK CAPITAL LETTER XI +F778;Xsmall;LATIN SMALL CAPITAL LETTER X +0059;Y;LATIN CAPITAL LETTER Y +00DD;Yacute;LATIN CAPITAL LETTER Y WITH ACUTE +F7FD;Yacutesmall;LATIN SMALL CAPITAL LETTER Y WITH ACUTE +0176;Ycircumflex;LATIN CAPITAL LETTER Y WITH CIRCUMFLEX +0178;Ydieresis;LATIN CAPITAL LETTER Y WITH DIAERESIS +F7FF;Ydieresissmall;LATIN SMALL CAPITAL LETTER Y WITH DIAERESIS +1EF2;Ygrave;LATIN CAPITAL LETTER Y WITH GRAVE +F779;Ysmall;LATIN SMALL CAPITAL LETTER Y +005A;Z;LATIN CAPITAL LETTER Z +0179;Zacute;LATIN CAPITAL LETTER Z WITH ACUTE +017D;Zcaron;LATIN CAPITAL LETTER Z WITH CARON +F6FF;Zcaronsmall;LATIN SMALL CAPITAL LETTER Z WITH CARON +017B;Zdotaccent;LATIN CAPITAL LETTER Z WITH DOT ABOVE +0396;Zeta;GREEK CAPITAL LETTER ZETA +F77A;Zsmall;LATIN SMALL CAPITAL LETTER Z +0061;a;LATIN SMALL LETTER A +00E1;aacute;LATIN SMALL LETTER A WITH ACUTE +0103;abreve;LATIN SMALL LETTER A WITH BREVE +00E2;acircumflex;LATIN SMALL LETTER A WITH CIRCUMFLEX +00B4;acute;ACUTE ACCENT +0301;acutecomb;COMBINING ACUTE ACCENT +00E4;adieresis;LATIN SMALL LETTER A WITH DIAERESIS +00E6;ae;LATIN SMALL LETTER AE +01FD;aeacute;LATIN SMALL LETTER AE WITH ACUTE +2015;afii00208;HORIZONTAL BAR +0410;afii10017;CYRILLIC CAPITAL LETTER A +0411;afii10018;CYRILLIC CAPITAL LETTER BE +0412;afii10019;CYRILLIC CAPITAL LETTER VE +0413;afii10020;CYRILLIC CAPITAL LETTER GHE +0414;afii10021;CYRILLIC CAPITAL LETTER DE +0415;afii10022;CYRILLIC CAPITAL LETTER IE +0401;afii10023;CYRILLIC CAPITAL LETTER IO +0416;afii10024;CYRILLIC CAPITAL LETTER ZHE +0417;afii10025;CYRILLIC CAPITAL LETTER ZE +0418;afii10026;CYRILLIC CAPITAL LETTER I +0419;afii10027;CYRILLIC CAPITAL LETTER SHORT I +041A;afii10028;CYRILLIC CAPITAL LETTER KA +041B;afii10029;CYRILLIC CAPITAL LETTER EL +041C;afii10030;CYRILLIC CAPITAL LETTER EM +041D;afii10031;CYRILLIC CAPITAL LETTER EN +041E;afii10032;CYRILLIC CAPITAL LETTER O +041F;afii10033;CYRILLIC CAPITAL LETTER PE +0420;afii10034;CYRILLIC CAPITAL LETTER ER +0421;afii10035;CYRILLIC CAPITAL LETTER ES +0422;afii10036;CYRILLIC CAPITAL LETTER TE +0423;afii10037;CYRILLIC CAPITAL LETTER U +0424;afii10038;CYRILLIC CAPITAL LETTER EF +0425;afii10039;CYRILLIC CAPITAL LETTER HA +0426;afii10040;CYRILLIC CAPITAL LETTER TSE +0427;afii10041;CYRILLIC CAPITAL LETTER CHE +0428;afii10042;CYRILLIC CAPITAL LETTER SHA +0429;afii10043;CYRILLIC CAPITAL LETTER SHCHA +042A;afii10044;CYRILLIC CAPITAL LETTER HARD SIGN +042B;afii10045;CYRILLIC CAPITAL LETTER YERU +042C;afii10046;CYRILLIC CAPITAL LETTER SOFT SIGN +042D;afii10047;CYRILLIC CAPITAL LETTER E +042E;afii10048;CYRILLIC CAPITAL LETTER YU +042F;afii10049;CYRILLIC CAPITAL LETTER YA +0490;afii10050;CYRILLIC CAPITAL LETTER GHE WITH UPTURN +0402;afii10051;CYRILLIC CAPITAL LETTER DJE +0403;afii10052;CYRILLIC CAPITAL LETTER GJE +0404;afii10053;CYRILLIC CAPITAL LETTER UKRAINIAN IE +0405;afii10054;CYRILLIC CAPITAL LETTER DZE +0406;afii10055;CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +0407;afii10056;CYRILLIC CAPITAL LETTER YI +0408;afii10057;CYRILLIC CAPITAL LETTER JE +0409;afii10058;CYRILLIC CAPITAL LETTER LJE +040A;afii10059;CYRILLIC CAPITAL LETTER NJE +040B;afii10060;CYRILLIC CAPITAL LETTER TSHE +040C;afii10061;CYRILLIC CAPITAL LETTER KJE +040E;afii10062;CYRILLIC CAPITAL LETTER SHORT U +F6C4;afii10063;CYRILLIC SMALL LETTER GHE VARIANT +F6C5;afii10064;CYRILLIC SMALL LETTER BE VARIANT +0430;afii10065;CYRILLIC SMALL LETTER A +0431;afii10066;CYRILLIC SMALL LETTER BE +0432;afii10067;CYRILLIC SMALL LETTER VE +0433;afii10068;CYRILLIC SMALL LETTER GHE +0434;afii10069;CYRILLIC SMALL LETTER DE +0435;afii10070;CYRILLIC SMALL LETTER IE +0451;afii10071;CYRILLIC SMALL LETTER IO +0436;afii10072;CYRILLIC SMALL LETTER ZHE +0437;afii10073;CYRILLIC SMALL LETTER ZE +0438;afii10074;CYRILLIC SMALL LETTER I +0439;afii10075;CYRILLIC SMALL LETTER SHORT I +043A;afii10076;CYRILLIC SMALL LETTER KA +043B;afii10077;CYRILLIC SMALL LETTER EL +043C;afii10078;CYRILLIC SMALL LETTER EM +043D;afii10079;CYRILLIC SMALL LETTER EN +043E;afii10080;CYRILLIC SMALL LETTER O +043F;afii10081;CYRILLIC SMALL LETTER PE +0440;afii10082;CYRILLIC SMALL LETTER ER +0441;afii10083;CYRILLIC SMALL LETTER ES +0442;afii10084;CYRILLIC SMALL LETTER TE +0443;afii10085;CYRILLIC SMALL LETTER U +0444;afii10086;CYRILLIC SMALL LETTER EF +0445;afii10087;CYRILLIC SMALL LETTER HA +0446;afii10088;CYRILLIC SMALL LETTER TSE +0447;afii10089;CYRILLIC SMALL LETTER CHE +0448;afii10090;CYRILLIC SMALL LETTER SHA +0449;afii10091;CYRILLIC SMALL LETTER SHCHA +044A;afii10092;CYRILLIC SMALL LETTER HARD SIGN +044B;afii10093;CYRILLIC SMALL LETTER YERU +044C;afii10094;CYRILLIC SMALL LETTER SOFT SIGN +044D;afii10095;CYRILLIC SMALL LETTER E +044E;afii10096;CYRILLIC SMALL LETTER YU +044F;afii10097;CYRILLIC SMALL LETTER YA +0491;afii10098;CYRILLIC SMALL LETTER GHE WITH UPTURN +0452;afii10099;CYRILLIC SMALL LETTER DJE +0453;afii10100;CYRILLIC SMALL LETTER GJE +0454;afii10101;CYRILLIC SMALL LETTER UKRAINIAN IE +0455;afii10102;CYRILLIC SMALL LETTER DZE +0456;afii10103;CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +0457;afii10104;CYRILLIC SMALL LETTER YI +0458;afii10105;CYRILLIC SMALL LETTER JE +0459;afii10106;CYRILLIC SMALL LETTER LJE +045A;afii10107;CYRILLIC SMALL LETTER NJE +045B;afii10108;CYRILLIC SMALL LETTER TSHE +045C;afii10109;CYRILLIC SMALL LETTER KJE +045E;afii10110;CYRILLIC SMALL LETTER SHORT U +040F;afii10145;CYRILLIC CAPITAL LETTER DZHE +0462;afii10146;CYRILLIC CAPITAL LETTER YAT +0472;afii10147;CYRILLIC CAPITAL LETTER FITA +0474;afii10148;CYRILLIC CAPITAL LETTER IZHITSA +F6C6;afii10192;CYRILLIC SMALL LETTER DE VARIANT +045F;afii10193;CYRILLIC SMALL LETTER DZHE +0463;afii10194;CYRILLIC SMALL LETTER YAT +0473;afii10195;CYRILLIC SMALL LETTER FITA +0475;afii10196;CYRILLIC SMALL LETTER IZHITSA +F6C7;afii10831;CYRILLIC SMALL LETTER PE VARIANT +F6C8;afii10832;CYRILLIC SMALL LETTER TE VARIANT +04D9;afii10846;CYRILLIC SMALL LETTER SCHWA +200E;afii299;LEFT-TO-RIGHT MARK +200F;afii300;RIGHT-TO-LEFT MARK +200D;afii301;ZERO WIDTH JOINER +066A;afii57381;ARABIC PERCENT SIGN +060C;afii57388;ARABIC COMMA +0660;afii57392;ARABIC-INDIC DIGIT ZERO +0661;afii57393;ARABIC-INDIC DIGIT ONE +0662;afii57394;ARABIC-INDIC DIGIT TWO +0663;afii57395;ARABIC-INDIC DIGIT THREE +0664;afii57396;ARABIC-INDIC DIGIT FOUR +0665;afii57397;ARABIC-INDIC DIGIT FIVE +0666;afii57398;ARABIC-INDIC DIGIT SIX +0667;afii57399;ARABIC-INDIC DIGIT SEVEN +0668;afii57400;ARABIC-INDIC DIGIT EIGHT +0669;afii57401;ARABIC-INDIC DIGIT NINE +061B;afii57403;ARABIC SEMICOLON +061F;afii57407;ARABIC QUESTION MARK +0621;afii57409;ARABIC LETTER HAMZA +0622;afii57410;ARABIC LETTER ALEF WITH MADDA ABOVE +0623;afii57411;ARABIC LETTER ALEF WITH HAMZA ABOVE +0624;afii57412;ARABIC LETTER WAW WITH HAMZA ABOVE +0625;afii57413;ARABIC LETTER ALEF WITH HAMZA BELOW +0626;afii57414;ARABIC LETTER YEH WITH HAMZA ABOVE +0627;afii57415;ARABIC LETTER ALEF +0628;afii57416;ARABIC LETTER BEH +0629;afii57417;ARABIC LETTER TEH MARBUTA +062A;afii57418;ARABIC LETTER TEH +062B;afii57419;ARABIC LETTER THEH +062C;afii57420;ARABIC LETTER JEEM +062D;afii57421;ARABIC LETTER HAH +062E;afii57422;ARABIC LETTER KHAH +062F;afii57423;ARABIC LETTER DAL +0630;afii57424;ARABIC LETTER THAL +0631;afii57425;ARABIC LETTER REH +0632;afii57426;ARABIC LETTER ZAIN +0633;afii57427;ARABIC LETTER SEEN +0634;afii57428;ARABIC LETTER SHEEN +0635;afii57429;ARABIC LETTER SAD +0636;afii57430;ARABIC LETTER DAD +0637;afii57431;ARABIC LETTER TAH +0638;afii57432;ARABIC LETTER ZAH +0639;afii57433;ARABIC LETTER AIN +063A;afii57434;ARABIC LETTER GHAIN +0640;afii57440;ARABIC TATWEEL +0641;afii57441;ARABIC LETTER FEH +0642;afii57442;ARABIC LETTER QAF +0643;afii57443;ARABIC LETTER KAF +0644;afii57444;ARABIC LETTER LAM +0645;afii57445;ARABIC LETTER MEEM +0646;afii57446;ARABIC LETTER NOON +0648;afii57448;ARABIC LETTER WAW +0649;afii57449;ARABIC LETTER ALEF MAKSURA +064A;afii57450;ARABIC LETTER YEH +064B;afii57451;ARABIC FATHATAN +064C;afii57452;ARABIC DAMMATAN +064D;afii57453;ARABIC KASRATAN +064E;afii57454;ARABIC FATHA +064F;afii57455;ARABIC DAMMA +0650;afii57456;ARABIC KASRA +0651;afii57457;ARABIC SHADDA +0652;afii57458;ARABIC SUKUN +0647;afii57470;ARABIC LETTER HEH +06A4;afii57505;ARABIC LETTER VEH +067E;afii57506;ARABIC LETTER PEH +0686;afii57507;ARABIC LETTER TCHEH +0698;afii57508;ARABIC LETTER JEH +06AF;afii57509;ARABIC LETTER GAF +0679;afii57511;ARABIC LETTER TTEH +0688;afii57512;ARABIC LETTER DDAL +0691;afii57513;ARABIC LETTER RREH +06BA;afii57514;ARABIC LETTER NOON GHUNNA +06D2;afii57519;ARABIC LETTER YEH BARREE +06D5;afii57534;ARABIC LETTER AE +20AA;afii57636;NEW SHEQEL SIGN +05BE;afii57645;HEBREW PUNCTUATION MAQAF +05C3;afii57658;HEBREW PUNCTUATION SOF PASUQ +05D0;afii57664;HEBREW LETTER ALEF +05D1;afii57665;HEBREW LETTER BET +05D2;afii57666;HEBREW LETTER GIMEL +05D3;afii57667;HEBREW LETTER DALET +05D4;afii57668;HEBREW LETTER HE +05D5;afii57669;HEBREW LETTER VAV +05D6;afii57670;HEBREW LETTER ZAYIN +05D7;afii57671;HEBREW LETTER HET +05D8;afii57672;HEBREW LETTER TET +05D9;afii57673;HEBREW LETTER YOD +05DA;afii57674;HEBREW LETTER FINAL KAF +05DB;afii57675;HEBREW LETTER KAF +05DC;afii57676;HEBREW LETTER LAMED +05DD;afii57677;HEBREW LETTER FINAL MEM +05DE;afii57678;HEBREW LETTER MEM +05DF;afii57679;HEBREW LETTER FINAL NUN +05E0;afii57680;HEBREW LETTER NUN +05E1;afii57681;HEBREW LETTER SAMEKH +05E2;afii57682;HEBREW LETTER AYIN +05E3;afii57683;HEBREW LETTER FINAL PE +05E4;afii57684;HEBREW LETTER PE +05E5;afii57685;HEBREW LETTER FINAL TSADI +05E6;afii57686;HEBREW LETTER TSADI +05E7;afii57687;HEBREW LETTER QOF +05E8;afii57688;HEBREW LETTER RESH +05E9;afii57689;HEBREW LETTER SHIN +05EA;afii57690;HEBREW LETTER TAV +FB2A;afii57694;HEBREW LETTER SHIN WITH SHIN DOT +FB2B;afii57695;HEBREW LETTER SHIN WITH SIN DOT +FB4B;afii57700;HEBREW LETTER VAV WITH HOLAM +FB1F;afii57705;HEBREW LIGATURE YIDDISH YOD YOD PATAH +05F0;afii57716;HEBREW LIGATURE YIDDISH DOUBLE VAV +05F1;afii57717;HEBREW LIGATURE YIDDISH VAV YOD +05F2;afii57718;HEBREW LIGATURE YIDDISH DOUBLE YOD +FB35;afii57723;HEBREW LETTER VAV WITH DAGESH +05B4;afii57793;HEBREW POINT HIRIQ +05B5;afii57794;HEBREW POINT TSERE +05B6;afii57795;HEBREW POINT SEGOL +05BB;afii57796;HEBREW POINT QUBUTS +05B8;afii57797;HEBREW POINT QAMATS +05B7;afii57798;HEBREW POINT PATAH +05B0;afii57799;HEBREW POINT SHEVA +05B2;afii57800;HEBREW POINT HATAF PATAH +05B1;afii57801;HEBREW POINT HATAF SEGOL +05B3;afii57802;HEBREW POINT HATAF QAMATS +05C2;afii57803;HEBREW POINT SIN DOT +05C1;afii57804;HEBREW POINT SHIN DOT +05B9;afii57806;HEBREW POINT HOLAM +05BC;afii57807;HEBREW POINT DAGESH OR MAPIQ +05BD;afii57839;HEBREW POINT METEG +05BF;afii57841;HEBREW POINT RAFE +05C0;afii57842;HEBREW PUNCTUATION PASEQ +02BC;afii57929;MODIFIER LETTER APOSTROPHE +2105;afii61248;CARE OF +2113;afii61289;SCRIPT SMALL L +2116;afii61352;NUMERO SIGN +202C;afii61573;POP DIRECTIONAL FORMATTING +202D;afii61574;LEFT-TO-RIGHT OVERRIDE +202E;afii61575;RIGHT-TO-LEFT OVERRIDE +200C;afii61664;ZERO WIDTH NON-JOINER +066D;afii63167;ARABIC FIVE POINTED STAR +02BD;afii64937;MODIFIER LETTER REVERSED COMMA +00E0;agrave;LATIN SMALL LETTER A WITH GRAVE +2135;aleph;ALEF SYMBOL +03B1;alpha;GREEK SMALL LETTER ALPHA +03AC;alphatonos;GREEK SMALL LETTER ALPHA WITH TONOS +0101;amacron;LATIN SMALL LETTER A WITH MACRON +0026;ampersand;AMPERSAND +F726;ampersandsmall;SMALL CAPITAL AMPERSAND +2220;angle;ANGLE +2329;angleleft;LEFT-POINTING ANGLE BRACKET +232A;angleright;RIGHT-POINTING ANGLE BRACKET +0387;anoteleia;GREEK ANO TELEIA +0105;aogonek;LATIN SMALL LETTER A WITH OGONEK +2248;approxequal;ALMOST EQUAL TO +00E5;aring;LATIN SMALL LETTER A WITH RING ABOVE +01FB;aringacute;LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE +2194;arrowboth;LEFT RIGHT ARROW +21D4;arrowdblboth;LEFT RIGHT DOUBLE ARROW +21D3;arrowdbldown;DOWNWARDS DOUBLE ARROW +21D0;arrowdblleft;LEFTWARDS DOUBLE ARROW +21D2;arrowdblright;RIGHTWARDS DOUBLE ARROW +21D1;arrowdblup;UPWARDS DOUBLE ARROW +2193;arrowdown;DOWNWARDS ARROW +F8E7;arrowhorizex;HORIZONTAL ARROW EXTENDER +2190;arrowleft;LEFTWARDS ARROW +2192;arrowright;RIGHTWARDS ARROW +2191;arrowup;UPWARDS ARROW +2195;arrowupdn;UP DOWN ARROW +21A8;arrowupdnbse;UP DOWN ARROW WITH BASE +F8E6;arrowvertex;VERTICAL ARROW EXTENDER +005E;asciicircum;CIRCUMFLEX ACCENT +007E;asciitilde;TILDE +002A;asterisk;ASTERISK +2217;asteriskmath;ASTERISK OPERATOR +F6E9;asuperior;SUPERSCRIPT LATIN SMALL LETTER A +0040;at;COMMERCIAL AT +00E3;atilde;LATIN SMALL LETTER A WITH TILDE +0062;b;LATIN SMALL LETTER B +005C;backslash;REVERSE SOLIDUS +007C;bar;VERTICAL LINE +03B2;beta;GREEK SMALL LETTER BETA +2588;block;FULL BLOCK +F8F4;braceex;CURLY BRACKET EXTENDER +007B;braceleft;LEFT CURLY BRACKET +F8F3;braceleftbt;LEFT CURLY BRACKET BOTTOM +F8F2;braceleftmid;LEFT CURLY BRACKET MID +F8F1;bracelefttp;LEFT CURLY BRACKET TOP +007D;braceright;RIGHT CURLY BRACKET +F8FE;bracerightbt;RIGHT CURLY BRACKET BOTTOM +F8FD;bracerightmid;RIGHT CURLY BRACKET MID +F8FC;bracerighttp;RIGHT CURLY BRACKET TOP +005B;bracketleft;LEFT SQUARE BRACKET +F8F0;bracketleftbt;LEFT SQUARE BRACKET BOTTOM +F8EF;bracketleftex;LEFT SQUARE BRACKET EXTENDER +F8EE;bracketlefttp;LEFT SQUARE BRACKET TOP +005D;bracketright;RIGHT SQUARE BRACKET +F8FB;bracketrightbt;RIGHT SQUARE BRACKET BOTTOM +F8FA;bracketrightex;RIGHT SQUARE BRACKET EXTENDER +F8F9;bracketrighttp;RIGHT SQUARE BRACKET TOP +02D8;breve;BREVE +00A6;brokenbar;BROKEN BAR +F6EA;bsuperior;SUPERSCRIPT LATIN SMALL LETTER B +2022;bullet;BULLET +0063;c;LATIN SMALL LETTER C +0107;cacute;LATIN SMALL LETTER C WITH ACUTE +02C7;caron;CARON +21B5;carriagereturn;DOWNWARDS ARROW WITH CORNER LEFTWARDS +010D;ccaron;LATIN SMALL LETTER C WITH CARON +00E7;ccedilla;LATIN SMALL LETTER C WITH CEDILLA +0109;ccircumflex;LATIN SMALL LETTER C WITH CIRCUMFLEX +010B;cdotaccent;LATIN SMALL LETTER C WITH DOT ABOVE +00B8;cedilla;CEDILLA +00A2;cent;CENT SIGN +F6DF;centinferior;SUBSCRIPT CENT SIGN +F7A2;centoldstyle;OLDSTYLE CENT SIGN +F6E0;centsuperior;SUPERSCRIPT CENT SIGN +03C7;chi;GREEK SMALL LETTER CHI +25CB;circle;WHITE CIRCLE +2297;circlemultiply;CIRCLED TIMES +2295;circleplus;CIRCLED PLUS +02C6;circumflex;MODIFIER LETTER CIRCUMFLEX ACCENT +2663;club;BLACK CLUB SUIT +003A;colon;COLON +20A1;colonmonetary;COLON SIGN +002C;comma;COMMA +F6C3;commaaccent;COMMA BELOW +F6E1;commainferior;SUBSCRIPT COMMA +F6E2;commasuperior;SUPERSCRIPT COMMA +2245;congruent;APPROXIMATELY EQUAL TO +00A9;copyright;COPYRIGHT SIGN +F8E9;copyrightsans;COPYRIGHT SIGN SANS SERIF +F6D9;copyrightserif;COPYRIGHT SIGN SERIF +00A4;currency;CURRENCY SIGN +F6D1;cyrBreve;CAPITAL CYRILLIC BREVE +F6D2;cyrFlex;CAPITAL CYRILLIC CIRCUMFLEX +F6D4;cyrbreve;CYRILLIC BREVE +F6D5;cyrflex;CYRILLIC CIRCUMFLEX +0064;d;LATIN SMALL LETTER D +2020;dagger;DAGGER +2021;daggerdbl;DOUBLE DAGGER +F6D3;dblGrave;CAPITAL DOUBLE GRAVE ACCENT +F6D6;dblgrave;DOUBLE GRAVE ACCENT +010F;dcaron;LATIN SMALL LETTER D WITH CARON +0111;dcroat;LATIN SMALL LETTER D WITH STROKE +00B0;degree;DEGREE SIGN +03B4;delta;GREEK SMALL LETTER DELTA +2666;diamond;BLACK DIAMOND SUIT +00A8;dieresis;DIAERESIS +F6D7;dieresisacute;DIAERESIS ACUTE ACCENT +F6D8;dieresisgrave;DIAERESIS GRAVE ACCENT +0385;dieresistonos;GREEK DIALYTIKA TONOS +00F7;divide;DIVISION SIGN +2593;dkshade;DARK SHADE +2584;dnblock;LOWER HALF BLOCK +0024;dollar;DOLLAR SIGN +F6E3;dollarinferior;SUBSCRIPT DOLLAR SIGN +F724;dollaroldstyle;OLDSTYLE DOLLAR SIGN +F6E4;dollarsuperior;SUPERSCRIPT DOLLAR SIGN +20AB;dong;DONG SIGN +02D9;dotaccent;DOT ABOVE +0323;dotbelowcomb;COMBINING DOT BELOW +0131;dotlessi;LATIN SMALL LETTER DOTLESS I +F6BE;dotlessj;LATIN SMALL LETTER DOTLESS J +22C5;dotmath;DOT OPERATOR +F6EB;dsuperior;SUPERSCRIPT LATIN SMALL LETTER D +0065;e;LATIN SMALL LETTER E +00E9;eacute;LATIN SMALL LETTER E WITH ACUTE +0115;ebreve;LATIN SMALL LETTER E WITH BREVE +011B;ecaron;LATIN SMALL LETTER E WITH CARON +00EA;ecircumflex;LATIN SMALL LETTER E WITH CIRCUMFLEX +00EB;edieresis;LATIN SMALL LETTER E WITH DIAERESIS +0117;edotaccent;LATIN SMALL LETTER E WITH DOT ABOVE +00E8;egrave;LATIN SMALL LETTER E WITH GRAVE +0038;eight;DIGIT EIGHT +2088;eightinferior;SUBSCRIPT EIGHT +F738;eightoldstyle;OLDSTYLE DIGIT EIGHT +2078;eightsuperior;SUPERSCRIPT EIGHT +2208;element;ELEMENT OF +2026;ellipsis;HORIZONTAL ELLIPSIS +0113;emacron;LATIN SMALL LETTER E WITH MACRON +2014;emdash;EM DASH +2205;emptyset;EMPTY SET +2013;endash;EN DASH +014B;eng;LATIN SMALL LETTER ENG +0119;eogonek;LATIN SMALL LETTER E WITH OGONEK +03B5;epsilon;GREEK SMALL LETTER EPSILON +03AD;epsilontonos;GREEK SMALL LETTER EPSILON WITH TONOS +003D;equal;EQUALS SIGN +2261;equivalence;IDENTICAL TO +212E;estimated;ESTIMATED SYMBOL +F6EC;esuperior;SUPERSCRIPT LATIN SMALL LETTER E +03B7;eta;GREEK SMALL LETTER ETA +03AE;etatonos;GREEK SMALL LETTER ETA WITH TONOS +00F0;eth;LATIN SMALL LETTER ETH +0021;exclam;EXCLAMATION MARK +203C;exclamdbl;DOUBLE EXCLAMATION MARK +00A1;exclamdown;INVERTED EXCLAMATION MARK +F7A1;exclamdownsmall;SMALL CAPITAL INVERTED EXCLAMATION MARK +F721;exclamsmall;SMALL CAPITAL EXCLAMATION MARK +2203;existential;THERE EXISTS +0066;f;LATIN SMALL LETTER F +2640;female;FEMALE SIGN +FB00;ff;LATIN SMALL LIGATURE FF +FB03;ffi;LATIN SMALL LIGATURE FFI +FB04;ffl;LATIN SMALL LIGATURE FFL +FB01;fi;LATIN SMALL LIGATURE FI +2012;figuredash;FIGURE DASH +25A0;filledbox;BLACK SQUARE +25AC;filledrect;BLACK RECTANGLE +0035;five;DIGIT FIVE +215D;fiveeighths;VULGAR FRACTION FIVE EIGHTHS +2085;fiveinferior;SUBSCRIPT FIVE +F735;fiveoldstyle;OLDSTYLE DIGIT FIVE +2075;fivesuperior;SUPERSCRIPT FIVE +FB02;fl;LATIN SMALL LIGATURE FL +0192;florin;LATIN SMALL LETTER F WITH HOOK +0034;four;DIGIT FOUR +2084;fourinferior;SUBSCRIPT FOUR +F734;fouroldstyle;OLDSTYLE DIGIT FOUR +2074;foursuperior;SUPERSCRIPT FOUR +2044;fraction;FRACTION SLASH +2215;fraction;DIVISION SLASH;Duplicate +20A3;franc;FRENCH FRANC SIGN +0067;g;LATIN SMALL LETTER G +03B3;gamma;GREEK SMALL LETTER GAMMA +011F;gbreve;LATIN SMALL LETTER G WITH BREVE +01E7;gcaron;LATIN SMALL LETTER G WITH CARON +011D;gcircumflex;LATIN SMALL LETTER G WITH CIRCUMFLEX +0123;gcommaaccent;LATIN SMALL LETTER G WITH CEDILLA +0121;gdotaccent;LATIN SMALL LETTER G WITH DOT ABOVE +00DF;germandbls;LATIN SMALL LETTER SHARP S +2207;gradient;NABLA +0060;grave;GRAVE ACCENT +0300;gravecomb;COMBINING GRAVE ACCENT +003E;greater;GREATER-THAN SIGN +2265;greaterequal;GREATER-THAN OR EQUAL TO +00AB;guillemotleft;LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +00BB;guillemotright;RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +2039;guilsinglleft;SINGLE LEFT-POINTING ANGLE QUOTATION MARK +203A;guilsinglright;SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +0068;h;LATIN SMALL LETTER H +0127;hbar;LATIN SMALL LETTER H WITH STROKE +0125;hcircumflex;LATIN SMALL LETTER H WITH CIRCUMFLEX +2665;heart;BLACK HEART SUIT +0309;hookabovecomb;COMBINING HOOK ABOVE +2302;house;HOUSE +02DD;hungarumlaut;DOUBLE ACUTE ACCENT +002D;hyphen;HYPHEN-MINUS +00AD;hyphen;SOFT HYPHEN;Duplicate +F6E5;hypheninferior;SUBSCRIPT HYPHEN-MINUS +F6E6;hyphensuperior;SUPERSCRIPT HYPHEN-MINUS +0069;i;LATIN SMALL LETTER I +00ED;iacute;LATIN SMALL LETTER I WITH ACUTE +012D;ibreve;LATIN SMALL LETTER I WITH BREVE +00EE;icircumflex;LATIN SMALL LETTER I WITH CIRCUMFLEX +00EF;idieresis;LATIN SMALL LETTER I WITH DIAERESIS +00EC;igrave;LATIN SMALL LETTER I WITH GRAVE +0133;ij;LATIN SMALL LIGATURE IJ +012B;imacron;LATIN SMALL LETTER I WITH MACRON +221E;infinity;INFINITY +222B;integral;INTEGRAL +2321;integralbt;BOTTOM HALF INTEGRAL +F8F5;integralex;INTEGRAL EXTENDER +2320;integraltp;TOP HALF INTEGRAL +2229;intersection;INTERSECTION +25D8;invbullet;INVERSE BULLET +25D9;invcircle;INVERSE WHITE CIRCLE +263B;invsmileface;BLACK SMILING FACE +012F;iogonek;LATIN SMALL LETTER I WITH OGONEK +03B9;iota;GREEK SMALL LETTER IOTA +03CA;iotadieresis;GREEK SMALL LETTER IOTA WITH DIALYTIKA +0390;iotadieresistonos;GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS +03AF;iotatonos;GREEK SMALL LETTER IOTA WITH TONOS +F6ED;isuperior;SUPERSCRIPT LATIN SMALL LETTER I +0129;itilde;LATIN SMALL LETTER I WITH TILDE +006A;j;LATIN SMALL LETTER J +0135;jcircumflex;LATIN SMALL LETTER J WITH CIRCUMFLEX +006B;k;LATIN SMALL LETTER K +03BA;kappa;GREEK SMALL LETTER KAPPA +0137;kcommaaccent;LATIN SMALL LETTER K WITH CEDILLA +0138;kgreenlandic;LATIN SMALL LETTER KRA +006C;l;LATIN SMALL LETTER L +013A;lacute;LATIN SMALL LETTER L WITH ACUTE +03BB;lambda;GREEK SMALL LETTER LAMDA +013E;lcaron;LATIN SMALL LETTER L WITH CARON +013C;lcommaaccent;LATIN SMALL LETTER L WITH CEDILLA +0140;ldot;LATIN SMALL LETTER L WITH MIDDLE DOT +003C;less;LESS-THAN SIGN +2264;lessequal;LESS-THAN OR EQUAL TO +258C;lfblock;LEFT HALF BLOCK +20A4;lira;LIRA SIGN +F6C0;ll;LATIN SMALL LETTER LL +2227;logicaland;LOGICAL AND +00AC;logicalnot;NOT SIGN +2228;logicalor;LOGICAL OR +017F;longs;LATIN SMALL LETTER LONG S +25CA;lozenge;LOZENGE +0142;lslash;LATIN SMALL LETTER L WITH STROKE +F6EE;lsuperior;SUPERSCRIPT LATIN SMALL LETTER L +2591;ltshade;LIGHT SHADE +006D;m;LATIN SMALL LETTER M +00AF;macron;MACRON +02C9;macron;MODIFIER LETTER MACRON;Duplicate +2642;male;MALE SIGN +2212;minus;MINUS SIGN +2032;minute;PRIME +F6EF;msuperior;SUPERSCRIPT LATIN SMALL LETTER M +00B5;mu;MICRO SIGN +03BC;mu;GREEK SMALL LETTER MU;Duplicate +00D7;multiply;MULTIPLICATION SIGN +266A;musicalnote;EIGHTH NOTE +266B;musicalnotedbl;BEAMED EIGHTH NOTES +006E;n;LATIN SMALL LETTER N +0144;nacute;LATIN SMALL LETTER N WITH ACUTE +0149;napostrophe;LATIN SMALL LETTER N PRECEDED BY APOSTROPHE +0148;ncaron;LATIN SMALL LETTER N WITH CARON +0146;ncommaaccent;LATIN SMALL LETTER N WITH CEDILLA +0039;nine;DIGIT NINE +2089;nineinferior;SUBSCRIPT NINE +F739;nineoldstyle;OLDSTYLE DIGIT NINE +2079;ninesuperior;SUPERSCRIPT NINE +2209;notelement;NOT AN ELEMENT OF +2260;notequal;NOT EQUAL TO +2284;notsubset;NOT A SUBSET OF +207F;nsuperior;SUPERSCRIPT LATIN SMALL LETTER N +00F1;ntilde;LATIN SMALL LETTER N WITH TILDE +03BD;nu;GREEK SMALL LETTER NU +0023;numbersign;NUMBER SIGN +006F;o;LATIN SMALL LETTER O +00F3;oacute;LATIN SMALL LETTER O WITH ACUTE +014F;obreve;LATIN SMALL LETTER O WITH BREVE +00F4;ocircumflex;LATIN SMALL LETTER O WITH CIRCUMFLEX +00F6;odieresis;LATIN SMALL LETTER O WITH DIAERESIS +0153;oe;LATIN SMALL LIGATURE OE +02DB;ogonek;OGONEK +00F2;ograve;LATIN SMALL LETTER O WITH GRAVE +01A1;ohorn;LATIN SMALL LETTER O WITH HORN +0151;ohungarumlaut;LATIN SMALL LETTER O WITH DOUBLE ACUTE +014D;omacron;LATIN SMALL LETTER O WITH MACRON +03C9;omega;GREEK SMALL LETTER OMEGA +03D6;omega1;GREEK PI SYMBOL +03CE;omegatonos;GREEK SMALL LETTER OMEGA WITH TONOS +03BF;omicron;GREEK SMALL LETTER OMICRON +03CC;omicrontonos;GREEK SMALL LETTER OMICRON WITH TONOS +0031;one;DIGIT ONE +2024;onedotenleader;ONE DOT LEADER +215B;oneeighth;VULGAR FRACTION ONE EIGHTH +F6DC;onefitted;PROPORTIONAL DIGIT ONE +00BD;onehalf;VULGAR FRACTION ONE HALF +2081;oneinferior;SUBSCRIPT ONE +F731;oneoldstyle;OLDSTYLE DIGIT ONE +00BC;onequarter;VULGAR FRACTION ONE QUARTER +00B9;onesuperior;SUPERSCRIPT ONE +2153;onethird;VULGAR FRACTION ONE THIRD +25E6;openbullet;WHITE BULLET +00AA;ordfeminine;FEMININE ORDINAL INDICATOR +00BA;ordmasculine;MASCULINE ORDINAL INDICATOR +221F;orthogonal;RIGHT ANGLE +00F8;oslash;LATIN SMALL LETTER O WITH STROKE +01FF;oslashacute;LATIN SMALL LETTER O WITH STROKE AND ACUTE +F6F0;osuperior;SUPERSCRIPT LATIN SMALL LETTER O +00F5;otilde;LATIN SMALL LETTER O WITH TILDE +0070;p;LATIN SMALL LETTER P +00B6;paragraph;PILCROW SIGN +0028;parenleft;LEFT PARENTHESIS +F8ED;parenleftbt;LEFT PAREN BOTTOM +F8EC;parenleftex;LEFT PAREN EXTENDER +208D;parenleftinferior;SUBSCRIPT LEFT PARENTHESIS +207D;parenleftsuperior;SUPERSCRIPT LEFT PARENTHESIS +F8EB;parenlefttp;LEFT PAREN TOP +0029;parenright;RIGHT PARENTHESIS +F8F8;parenrightbt;RIGHT PAREN BOTTOM +F8F7;parenrightex;RIGHT PAREN EXTENDER +208E;parenrightinferior;SUBSCRIPT RIGHT PARENTHESIS +207E;parenrightsuperior;SUPERSCRIPT RIGHT PARENTHESIS +F8F6;parenrighttp;RIGHT PAREN TOP +2202;partialdiff;PARTIAL DIFFERENTIAL +0025;percent;PERCENT SIGN +002E;period;FULL STOP +00B7;periodcentered;MIDDLE DOT +2219;periodcentered;BULLET OPERATOR;Duplicate +F6E7;periodinferior;SUBSCRIPT FULL STOP +F6E8;periodsuperior;SUPERSCRIPT FULL STOP +22A5;perpendicular;UP TACK +2030;perthousand;PER MILLE SIGN +20A7;peseta;PESETA SIGN +03C6;phi;GREEK SMALL LETTER PHI +03D5;phi1;GREEK PHI SYMBOL +03C0;pi;GREEK SMALL LETTER PI +002B;plus;PLUS SIGN +00B1;plusminus;PLUS-MINUS SIGN +211E;prescription;PRESCRIPTION TAKE +220F;product;N-ARY PRODUCT +2282;propersubset;SUBSET OF +2283;propersuperset;SUPERSET OF +221D;proportional;PROPORTIONAL TO +03C8;psi;GREEK SMALL LETTER PSI +0071;q;LATIN SMALL LETTER Q +003F;question;QUESTION MARK +00BF;questiondown;INVERTED QUESTION MARK +F7BF;questiondownsmall;SMALL CAPITAL INVERTED QUESTION MARK +F73F;questionsmall;SMALL CAPITAL QUESTION MARK +0022;quotedbl;QUOTATION MARK +201E;quotedblbase;DOUBLE LOW-9 QUOTATION MARK +201C;quotedblleft;LEFT DOUBLE QUOTATION MARK +201D;quotedblright;RIGHT DOUBLE QUOTATION MARK +2018;quoteleft;LEFT SINGLE QUOTATION MARK +201B;quotereversed;SINGLE HIGH-REVERSED-9 QUOTATION MARK +2019;quoteright;RIGHT SINGLE QUOTATION MARK +201A;quotesinglbase;SINGLE LOW-9 QUOTATION MARK +0027;quotesingle;APOSTROPHE +0072;r;LATIN SMALL LETTER R +0155;racute;LATIN SMALL LETTER R WITH ACUTE +221A;radical;SQUARE ROOT +F8E5;radicalex;RADICAL EXTENDER +0159;rcaron;LATIN SMALL LETTER R WITH CARON +0157;rcommaaccent;LATIN SMALL LETTER R WITH CEDILLA +2286;reflexsubset;SUBSET OF OR EQUAL TO +2287;reflexsuperset;SUPERSET OF OR EQUAL TO +00AE;registered;REGISTERED SIGN +F8E8;registersans;REGISTERED SIGN SANS SERIF +F6DA;registerserif;REGISTERED SIGN SERIF +2310;revlogicalnot;REVERSED NOT SIGN +03C1;rho;GREEK SMALL LETTER RHO +02DA;ring;RING ABOVE +F6F1;rsuperior;SUPERSCRIPT LATIN SMALL LETTER R +2590;rtblock;RIGHT HALF BLOCK +F6DD;rupiah;RUPIAH SIGN +0073;s;LATIN SMALL LETTER S +015B;sacute;LATIN SMALL LETTER S WITH ACUTE +0161;scaron;LATIN SMALL LETTER S WITH CARON +015F;scedilla;LATIN SMALL LETTER S WITH CEDILLA +F6C2;scedilla;LATIN SMALL LETTER S WITH CEDILLA;Duplicate +015D;scircumflex;LATIN SMALL LETTER S WITH CIRCUMFLEX +0219;scommaaccent;LATIN SMALL LETTER S WITH COMMA BELOW +2033;second;DOUBLE PRIME +00A7;section;SECTION SIGN +003B;semicolon;SEMICOLON +0037;seven;DIGIT SEVEN +215E;seveneighths;VULGAR FRACTION SEVEN EIGHTHS +2087;seveninferior;SUBSCRIPT SEVEN +F737;sevenoldstyle;OLDSTYLE DIGIT SEVEN +2077;sevensuperior;SUPERSCRIPT SEVEN +2592;shade;MEDIUM SHADE +03C3;sigma;GREEK SMALL LETTER SIGMA +03C2;sigma1;GREEK SMALL LETTER FINAL SIGMA +223C;similar;TILDE OPERATOR +0036;six;DIGIT SIX +2086;sixinferior;SUBSCRIPT SIX +F736;sixoldstyle;OLDSTYLE DIGIT SIX +2076;sixsuperior;SUPERSCRIPT SIX +002F;slash;SOLIDUS +263A;smileface;WHITE SMILING FACE +0020;space;SPACE +00A0;space;NO-BREAK SPACE;Duplicate +2660;spade;BLACK SPADE SUIT +F6F2;ssuperior;SUPERSCRIPT LATIN SMALL LETTER S +00A3;sterling;POUND SIGN +220B;suchthat;CONTAINS AS MEMBER +2211;summation;N-ARY SUMMATION +263C;sun;WHITE SUN WITH RAYS +0074;t;LATIN SMALL LETTER T +03C4;tau;GREEK SMALL LETTER TAU +0167;tbar;LATIN SMALL LETTER T WITH STROKE +0165;tcaron;LATIN SMALL LETTER T WITH CARON +0163;tcommaaccent;LATIN SMALL LETTER T WITH CEDILLA +021B;tcommaaccent;LATIN SMALL LETTER T WITH COMMA BELOW;Duplicate +2234;therefore;THEREFORE +03B8;theta;GREEK SMALL LETTER THETA +03D1;theta1;GREEK THETA SYMBOL +00FE;thorn;LATIN SMALL LETTER THORN +0033;three;DIGIT THREE +215C;threeeighths;VULGAR FRACTION THREE EIGHTHS +2083;threeinferior;SUBSCRIPT THREE +F733;threeoldstyle;OLDSTYLE DIGIT THREE +00BE;threequarters;VULGAR FRACTION THREE QUARTERS +F6DE;threequartersemdash;THREE QUARTERS EM DASH +00B3;threesuperior;SUPERSCRIPT THREE +02DC;tilde;SMALL TILDE +0303;tildecomb;COMBINING TILDE +0384;tonos;GREEK TONOS +2122;trademark;TRADE MARK SIGN +F8EA;trademarksans;TRADE MARK SIGN SANS SERIF +F6DB;trademarkserif;TRADE MARK SIGN SERIF +25BC;triagdn;BLACK DOWN-POINTING TRIANGLE +25C4;triaglf;BLACK LEFT-POINTING POINTER +25BA;triagrt;BLACK RIGHT-POINTING POINTER +25B2;triagup;BLACK UP-POINTING TRIANGLE +F6F3;tsuperior;SUPERSCRIPT LATIN SMALL LETTER T +0032;two;DIGIT TWO +2025;twodotenleader;TWO DOT LEADER +2082;twoinferior;SUBSCRIPT TWO +F732;twooldstyle;OLDSTYLE DIGIT TWO +00B2;twosuperior;SUPERSCRIPT TWO +2154;twothirds;VULGAR FRACTION TWO THIRDS +0075;u;LATIN SMALL LETTER U +00FA;uacute;LATIN SMALL LETTER U WITH ACUTE +016D;ubreve;LATIN SMALL LETTER U WITH BREVE +00FB;ucircumflex;LATIN SMALL LETTER U WITH CIRCUMFLEX +00FC;udieresis;LATIN SMALL LETTER U WITH DIAERESIS +00F9;ugrave;LATIN SMALL LETTER U WITH GRAVE +01B0;uhorn;LATIN SMALL LETTER U WITH HORN +0171;uhungarumlaut;LATIN SMALL LETTER U WITH DOUBLE ACUTE +016B;umacron;LATIN SMALL LETTER U WITH MACRON +005F;underscore;LOW LINE +2017;underscoredbl;DOUBLE LOW LINE +222A;union;UNION +2200;universal;FOR ALL +0173;uogonek;LATIN SMALL LETTER U WITH OGONEK +2580;upblock;UPPER HALF BLOCK +03C5;upsilon;GREEK SMALL LETTER UPSILON +03CB;upsilondieresis;GREEK SMALL LETTER UPSILON WITH DIALYTIKA +03B0;upsilondieresistonos;GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS +03CD;upsilontonos;GREEK SMALL LETTER UPSILON WITH TONOS +016F;uring;LATIN SMALL LETTER U WITH RING ABOVE +0169;utilde;LATIN SMALL LETTER U WITH TILDE +0076;v;LATIN SMALL LETTER V +0077;w;LATIN SMALL LETTER W +1E83;wacute;LATIN SMALL LETTER W WITH ACUTE +0175;wcircumflex;LATIN SMALL LETTER W WITH CIRCUMFLEX +1E85;wdieresis;LATIN SMALL LETTER W WITH DIAERESIS +2118;weierstrass;SCRIPT CAPITAL P +1E81;wgrave;LATIN SMALL LETTER W WITH GRAVE +0078;x;LATIN SMALL LETTER X +03BE;xi;GREEK SMALL LETTER XI +0079;y;LATIN SMALL LETTER Y +00FD;yacute;LATIN SMALL LETTER Y WITH ACUTE +0177;ycircumflex;LATIN SMALL LETTER Y WITH CIRCUMFLEX +00FF;ydieresis;LATIN SMALL LETTER Y WITH DIAERESIS +00A5;yen;YEN SIGN +1EF3;ygrave;LATIN SMALL LETTER Y WITH GRAVE +007A;z;LATIN SMALL LETTER Z +017A;zacute;LATIN SMALL LETTER Z WITH ACUTE +017E;zcaron;LATIN SMALL LETTER Z WITH CARON +017C;zdotaccent;LATIN SMALL LETTER Z WITH DOT ABOVE +0030;zero;DIGIT ZERO +2080;zeroinferior;SUBSCRIPT ZERO +F730;zerooldstyle;OLDSTYLE DIGIT ZERO +2070;zerosuperior;SUPERSCRIPT ZERO +03B6;zeta;GREEK SMALL LETTER ZETA +""" + + +t1_bias = 0 +glyph_list = [] + + +def adobe_glyph_names(): + """return the list of glyph names from the adobe list""" + + lines = string.split( adobe_glyph_list, '\n' ) + glyphs = [] + + for line in lines: + if line: + fields = string.split( line, ';' ) +# print fields[0] + ' - ' + fields[1] + glyphs.append( fields[1] ) + + return glyphs + + +def adobe_glyph_values(): + """return the list of glyph names and their unicode values""" + + lines = string.split( adobe_glyph_list, '\n' ) + glyphs = [] + values = [] + + for line in lines: + if line: + fields = string.split( line, ';' ) +# print fields[0] + ' - ' + fields[1] + glyphs.append( fields[1] ) + values.append( fields[0] ) + + return glyphs, values + + +def filter_glyph_names( alist, filter ): + """filter 'alist' by taking _out_ all glyph names that are in 'filter'""" + + count = 0 + extras = [] + + for name in alist: + try: + filtered_index = filter.index( name ) + except: + extras.append( name ) + + 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_glyph_list( file, base_list, adobe_list ): + write = file.write + + name_list = [] + + write( " static const char* const ps_glyph_names[] =\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 + + +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() + + write( "\n" ) + write( " static const unsigned short ps_names_to_unicode[" + \ + repr( len( sid_list ) + len( adobe_list ) + 1 ) + "] =\n" ) + write( " {\n" ) + + for name in sid_list: + try: + index = agl_names.index( name ) + write( " 0x" + agl_unicodes[index] + ",\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] + ",\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" ) + + +def dump_encoding( file, encoding_name, encoding_list ): + """dumps a given encoding""" + + write = file.write + + 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" ) + + +def main(): + """main program body""" + + if len( sys.argv ) != 2: + print __doc__ % sys.argv[0] + sys.exit( 1 ) + + file = open( sys.argv[1], "w\n" ) + write = file.write + + 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 = filter_glyph_names( mac_standard_names, adobe_glyph_names() ) + mac_extras = filter_glyph_names( mac_extras, 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. + # + 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( "/* */\n" ) + write( "/* PostScript glyph names (specification only). */\n" ) + write( "/* */\n" ) + write( "/* Copyright 2000-2001 by */\n" ) + write( "/* David Turner, Robert Wilhelm, and Werner Lemberg. */\n" ) + write( "/* */\n" ) + write( "/* This file is part of the FreeType project, and may only be used, */\n" ) + write( "/* modified, and distributed under the terms of the FreeType project */\n" ) + write( "/* license, LICENSE.TXT. By continuing to use, modify, or distribute */\n" ) + write( "/* this file you indicate that you have read the license and */\n" ) + write( "/* understand and accept it fully. */\n" ) + write( "/* */\n" ) + write( "/***************************************************************************/\n" ) + write( "\n" ) + write( "\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) + # + name_list = dump_glyph_list( file, base_list, adobe_list ) + + # 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 ) + + dump_encoding( file, "t1_standard_encoding", t1_standard_encoding ) + dump_encoding( file, "t1_expert_encoding", t1_expert_encoding ) + + write( "/* END */\n" ) + + +# Now run the main routine +# +main() + + +# END diff --git a/src/libs/freetype2/tools/test_bbox.c b/src/libs/freetype2/tools/test_bbox.c index e085c5b3d6..5a76a647f5 100644 --- a/src/libs/freetype2/tools/test_bbox.c +++ b/src/libs/freetype2/tools/test_bbox.c @@ -1,160 +1,160 @@ -#include -#include FT_FREETYPE_H -#include FT_BBOX_H - - -#include /* for clock() */ - -/* SunOS 4.1.* does not define CLOCKS_PER_SEC, so include */ -/* to get the HZ macro which is the equivalent. */ -#if defined(__sun__) && !defined(SVR4) && !defined(__SVR4) -#include -#define CLOCKS_PER_SEC HZ -#endif - - static long - get_time( void ) - { - return clock() * 10000L / CLOCKS_PER_SEC; - } - - - - - /* test bbox computations */ - -#define XSCALE 65536 -#define XX(x) ((FT_Pos)(x*XSCALE)) -#define XVEC(x,y) { XX(x), XX(y) } -#define XVAL(x) ((x)/(1.0*XSCALE)) - - /* dummy outline #1 */ - static FT_Vector dummy_vec_1[4] = - { -#if 1 - XVEC( 408.9111, 535.3164 ), - XVEC( 455.8887, 634.396 ), - XVEC( -37.8765, 786.2207 ), - XVEC( 164.6074, 535.3164 ) -#else - { (FT_Int32)0x0198E93DL , (FT_Int32)0x021750FFL }, /* 408.9111, 535.3164 */ - { (FT_Int32)0x01C7E312L , (FT_Int32)0x027A6560L }, /* 455.8887, 634.3960 */ - { (FT_Int32)0xFFDA1F9EL , (FT_Int32)0x0312387FL }, /* -37.8765, 786.2207 */ - { (FT_Int32)0x00A49B7EL , (FT_Int32)0x021750FFL } /* 164.6074, 535.3164 */ -#endif - }; - - static char dummy_tag_1[4] = - { - FT_CURVE_TAG_ON, - FT_CURVE_TAG_CUBIC, - FT_CURVE_TAG_CUBIC, - FT_CURVE_TAG_ON - }; - - static short dummy_contour_1[1] = - { - 3 - }; - - static FT_Outline dummy_outline_1 = - { - 1, - 4, - dummy_vec_1, - dummy_tag_1, - dummy_contour_1, - 0 - }; - - - /* dummy outline #2 */ - static FT_Vector dummy_vec_2[4] = - { - XVEC( 100.0, 100.0 ), - XVEC( 100.0, 200.0 ), - XVEC( 200.0, 200.0 ), - XVEC( 200.0, 133.0 ) - }; - - static FT_Outline dummy_outline_2 = - { - 1, - 4, - dummy_vec_2, - dummy_tag_1, - dummy_contour_1, - 0 - }; - - - static void - dump_outline( FT_Outline* outline ) - { - FT_BBox bbox; - - /* compute and display cbox */ - FT_Outline_Get_CBox( outline, &bbox ); - printf( "cbox = [%.2f %.2f %.2f %.2f]\n", - XVAL( bbox.xMin ), - XVAL( bbox.yMin ), - XVAL( bbox.xMax ), - XVAL( bbox.yMax ) ); - - /* compute and display bbox */ - FT_Outline_Get_BBox( outline, &bbox ); - printf( "bbox = [%.2f %.2f %.2f %.2f]\n", - XVAL( bbox.xMin ), - XVAL( bbox.yMin ), - XVAL( bbox.xMax ), - XVAL( bbox.yMax ) ); - } - - - - static void - profile_outline( FT_Outline* outline, - long repeat ) - { - FT_BBox bbox; - long count; - long time0; - - time0 = get_time(); - for ( count = repeat; count > 0; count-- ) - FT_Outline_Get_CBox( outline, &bbox ); - - time0 = get_time() - time0; - printf( "time = %5.2f cbox = [%.2f %.2f %.2f %.2f]\n", - ((double)time0/10000.0), - XVAL( bbox.xMin ), - XVAL( bbox.yMin ), - XVAL( bbox.xMax ), - XVAL( bbox.yMax ) ); - - - time0 = get_time(); - for ( count = repeat; count > 0; count-- ) - FT_Outline_Get_BBox( outline, &bbox ); - - time0 = get_time() - time0; - printf( "time = %5.2f bbox = [%.2f %.2f %.2f %.2f]\n", - ((double)time0/10000.0), - XVAL( bbox.xMin ), - XVAL( bbox.yMin ), - XVAL( bbox.xMax ), - XVAL( bbox.yMax ) ); - } - -#define REPEAT 100000L - - int main( int argc, char** argv ) - { - printf( "outline #1\n" ); - profile_outline( &dummy_outline_1, REPEAT ); - - printf( "outline #2\n" ); - profile_outline( &dummy_outline_2, REPEAT ); - return 0; - } - +#include +#include FT_FREETYPE_H +#include FT_BBOX_H + + +#include /* for clock() */ + +/* SunOS 4.1.* does not define CLOCKS_PER_SEC, so include */ +/* to get the HZ macro which is the equivalent. */ +#if defined(__sun__) && !defined(SVR4) && !defined(__SVR4) +#include +#define CLOCKS_PER_SEC HZ +#endif + + static long + get_time( void ) + { + return clock() * 10000L / CLOCKS_PER_SEC; + } + + + + + /* test bbox computations */ + +#define XSCALE 65536 +#define XX(x) ((FT_Pos)(x*XSCALE)) +#define XVEC(x,y) { XX(x), XX(y) } +#define XVAL(x) ((x)/(1.0*XSCALE)) + + /* dummy outline #1 */ + static FT_Vector dummy_vec_1[4] = + { +#if 1 + XVEC( 408.9111, 535.3164 ), + XVEC( 455.8887, 634.396 ), + XVEC( -37.8765, 786.2207 ), + XVEC( 164.6074, 535.3164 ) +#else + { (FT_Int32)0x0198E93DL , (FT_Int32)0x021750FFL }, /* 408.9111, 535.3164 */ + { (FT_Int32)0x01C7E312L , (FT_Int32)0x027A6560L }, /* 455.8887, 634.3960 */ + { (FT_Int32)0xFFDA1F9EL , (FT_Int32)0x0312387FL }, /* -37.8765, 786.2207 */ + { (FT_Int32)0x00A49B7EL , (FT_Int32)0x021750FFL } /* 164.6074, 535.3164 */ +#endif + }; + + static char dummy_tag_1[4] = + { + FT_CURVE_TAG_ON, + FT_CURVE_TAG_CUBIC, + FT_CURVE_TAG_CUBIC, + FT_CURVE_TAG_ON + }; + + static short dummy_contour_1[1] = + { + 3 + }; + + static FT_Outline dummy_outline_1 = + { + 1, + 4, + dummy_vec_1, + dummy_tag_1, + dummy_contour_1, + 0 + }; + + + /* dummy outline #2 */ + static FT_Vector dummy_vec_2[4] = + { + XVEC( 100.0, 100.0 ), + XVEC( 100.0, 200.0 ), + XVEC( 200.0, 200.0 ), + XVEC( 200.0, 133.0 ) + }; + + static FT_Outline dummy_outline_2 = + { + 1, + 4, + dummy_vec_2, + dummy_tag_1, + dummy_contour_1, + 0 + }; + + + static void + dump_outline( FT_Outline* outline ) + { + FT_BBox bbox; + + /* compute and display cbox */ + FT_Outline_Get_CBox( outline, &bbox ); + printf( "cbox = [%.2f %.2f %.2f %.2f]\n", + XVAL( bbox.xMin ), + XVAL( bbox.yMin ), + XVAL( bbox.xMax ), + XVAL( bbox.yMax ) ); + + /* compute and display bbox */ + FT_Outline_Get_BBox( outline, &bbox ); + printf( "bbox = [%.2f %.2f %.2f %.2f]\n", + XVAL( bbox.xMin ), + XVAL( bbox.yMin ), + XVAL( bbox.xMax ), + XVAL( bbox.yMax ) ); + } + + + + static void + profile_outline( FT_Outline* outline, + long repeat ) + { + FT_BBox bbox; + long count; + long time0; + + time0 = get_time(); + for ( count = repeat; count > 0; count-- ) + FT_Outline_Get_CBox( outline, &bbox ); + + time0 = get_time() - time0; + printf( "time = %5.2f cbox = [%.2f %.2f %.2f %.2f]\n", + ((double)time0/10000.0), + XVAL( bbox.xMin ), + XVAL( bbox.yMin ), + XVAL( bbox.xMax ), + XVAL( bbox.yMax ) ); + + + time0 = get_time(); + for ( count = repeat; count > 0; count-- ) + FT_Outline_Get_BBox( outline, &bbox ); + + time0 = get_time() - time0; + printf( "time = %5.2f bbox = [%.2f %.2f %.2f %.2f]\n", + ((double)time0/10000.0), + XVAL( bbox.xMin ), + XVAL( bbox.yMin ), + XVAL( bbox.xMax ), + XVAL( bbox.yMax ) ); + } + +#define REPEAT 100000L + + int main( int argc, char** argv ) + { + printf( "outline #1\n" ); + profile_outline( &dummy_outline_1, REPEAT ); + + printf( "outline #2\n" ); + profile_outline( &dummy_outline_2, REPEAT ); + return 0; + } + diff --git a/src/libs/freetype2/tools/test_trig.c b/src/libs/freetype2/tools/test_trig.c index 8c8a544aa9..4b5111dea4 100644 --- a/src/libs/freetype2/tools/test_trig.c +++ b/src/libs/freetype2/tools/test_trig.c @@ -1,236 +1,236 @@ -#include -#include FT_FREETYPE_H -#include FT_TRIGONOMETRY_H - -#include -#include - -#define PI 3.14159265358979323846 -#define SPI (PI/FT_ANGLE_PI) - -/* the precision in 16.16 fixed float points of the checks. Expect */ -/* between 2 and 5 noise LSB bits during operations, due to */ -/* rounding errors.. */ -#define THRESHOLD 64 - - static error = 0; - - static void - test_cos( void ) - { - FT_Fixed f1, f2; - double d1, d2; - int i; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - f1 = FT_Cos(i); - d1 = f1/65536.0; - d2 = cos( i*SPI ); - f2 = (FT_Fixed)(d2*65536.0); - - if ( abs( f2-f1 ) > THRESHOLD ) - { - error = 1; - printf( "FT_Cos[%3d] = %.7f cos[%3d] = %.7f\n", - (i >> 16), f1/65536.0, (i >> 16), d2 ); - } - } - } - - - - static void - test_sin( void ) - { - FT_Fixed f1, f2; - double d1, d2; - int i; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - f1 = FT_Sin(i); - d1 = f1/65536.0; - d2 = sin( i*SPI ); - f2 = (FT_Fixed)(d2*65536.0); - - if ( abs( f2-f1 ) > THRESHOLD ) - { - error = 1; - printf( "FT_Sin[%3d] = %.7f sin[%3d] = %.7f\n", - (i >> 16), f1/65536.0, (i >> 16), d2 ); - } - } - } - - - static void - test_tan( void ) - { - FT_Fixed f1, f2; - double d1, d2; - int i; - - for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 ) - { - f1 = FT_Tan(i); - d1 = f1/65536.0; - d2 = tan( i*SPI ); - f2 = (FT_Fixed)(d2*65536.0); - - if ( abs( f2-f1 ) > THRESHOLD ) - { - error = 1; - printf( "FT_Tan[%3d] = %.7f tan[%3d] = %.7f\n", - (i >> 16), f1/65536.0, (i >> 16), d2 ); - } - } - } - - - static void - test_atan2( void ) - { - FT_Fixed c2, s2; - double l, a, c1, s1; - int i, j; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - l = 5.0; - a = i*SPI; - - c1 = l * cos(a); - s1 = l * sin(a); - - c2 = (FT_Fixed)(c1*65536.0); - s2 = (FT_Fixed)(s1*65536.0); - - j = FT_Atan2( c2, s2 ); - if ( j < 0 ) - j += FT_ANGLE_2PI; - - if ( abs( i - j ) > 1 ) - { - printf( "FT_Atan2( %.7f, %.7f ) = %.5f, atan = %.5f\n", - c2/65536.0, s2/65536.0, j/65536.0, i/65536.0 ); - } - } - } - - static void - test_unit( void ) - { - FT_Vector v; - double a, c1, s1; - FT_Fixed c2, s2; - int i; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - FT_Vector_Unit( &v, i ); - a = ( i*SPI ); - c1 = cos(a); - s1 = sin(a); - c2 = (FT_Fixed)(c1*65536.0); - s2 = (FT_Fixed)(s1*65536.0); - - if ( abs( v.x-c2 ) > THRESHOLD || - abs( v.y-s2 ) > THRESHOLD ) - { - error = 1; - printf( "FT_Vector_Unit[%3d] = ( %.7f, %.7f ) vec = ( %.7f, %.7f )\n", - (i >> 16), - v.x/65536.0, v.y/65536.0, - c1, s1 ); - } - } - } - - - static void - test_length( void ) - { - FT_Vector v; - FT_Fixed l, l2; - int i; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - l = (FT_Fixed)(500.0*65536.0); - v.x = (FT_Fixed)( l * cos( i*SPI ) ); - v.y = (FT_Fixed)( l * sin( i*SPI ) ); - l2 = FT_Vector_Length( &v ); - - if ( abs( l2-l ) > THRESHOLD ) - { - error = 1; - printf( "FT_Length( %.7f, %.7f ) = %.5f, length = %.5f\n", - v.x/65536.0, v.y/65536.0, l2/65536.0, l/65536.0 ); - } - } - } - - - static void - test_rotate( void ) - { - FT_Fixed c2, s2, c4, s4; - FT_Vector v; - double l, ra, a, c1, s1, cra, sra, c3, s3; - int i, j, rotate; - - for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000 ) - { - ra = rotate*SPI; - cra = cos( ra ); - sra = sin( ra ); - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - l = 500.0; - a = i*SPI; - - c1 = l * cos(a); - s1 = l * sin(a); - - v.x = c2 = (FT_Fixed)(c1*65536.0); - v.y = s2 = (FT_Fixed)(s1*65536.0); - - FT_Vector_Rotate( &v, rotate ); - - c3 = c1 * cra - s1 * sra; - s3 = c1 * sra + s1 * cra; - - c4 = (FT_Fixed)(c3*65536.0); - s4 = (FT_Fixed)(s3*65536.0); - - if ( abs( c4 - v.x ) > THRESHOLD || - abs( s4 - v.y ) > THRESHOLD ) - { - error = 1; - printf( "FT_Rotate( (%.7f,%.7f), %.5f ) = ( %.7f, %.7f ), rot = ( %.7f, %.7f )\n", - c1, s1, ra, - c2/65536.0, s2/65536.0, - c4/65536.0, s4/65536.0 ); - } - } - } - } - - - int main( void ) - { - test_cos(); - test_sin(); - test_tan(); - test_atan2(); - test_unit(); - test_length(); - test_rotate(); - - if (!error) - printf( "trigonometry test ok !\n" ); - - return !error; - } +#include +#include FT_FREETYPE_H +#include FT_TRIGONOMETRY_H + +#include +#include + +#define PI 3.14159265358979323846 +#define SPI (PI/FT_ANGLE_PI) + +/* the precision in 16.16 fixed float points of the checks. Expect */ +/* between 2 and 5 noise LSB bits during operations, due to */ +/* rounding errors.. */ +#define THRESHOLD 64 + + static error = 0; + + static void + test_cos( void ) + { + FT_Fixed f1, f2; + double d1, d2; + int i; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + f1 = FT_Cos(i); + d1 = f1/65536.0; + d2 = cos( i*SPI ); + f2 = (FT_Fixed)(d2*65536.0); + + if ( abs( f2-f1 ) > THRESHOLD ) + { + error = 1; + printf( "FT_Cos[%3d] = %.7f cos[%3d] = %.7f\n", + (i >> 16), f1/65536.0, (i >> 16), d2 ); + } + } + } + + + + static void + test_sin( void ) + { + FT_Fixed f1, f2; + double d1, d2; + int i; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + f1 = FT_Sin(i); + d1 = f1/65536.0; + d2 = sin( i*SPI ); + f2 = (FT_Fixed)(d2*65536.0); + + if ( abs( f2-f1 ) > THRESHOLD ) + { + error = 1; + printf( "FT_Sin[%3d] = %.7f sin[%3d] = %.7f\n", + (i >> 16), f1/65536.0, (i >> 16), d2 ); + } + } + } + + + static void + test_tan( void ) + { + FT_Fixed f1, f2; + double d1, d2; + int i; + + for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 ) + { + f1 = FT_Tan(i); + d1 = f1/65536.0; + d2 = tan( i*SPI ); + f2 = (FT_Fixed)(d2*65536.0); + + if ( abs( f2-f1 ) > THRESHOLD ) + { + error = 1; + printf( "FT_Tan[%3d] = %.7f tan[%3d] = %.7f\n", + (i >> 16), f1/65536.0, (i >> 16), d2 ); + } + } + } + + + static void + test_atan2( void ) + { + FT_Fixed c2, s2; + double l, a, c1, s1; + int i, j; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + l = 5.0; + a = i*SPI; + + c1 = l * cos(a); + s1 = l * sin(a); + + c2 = (FT_Fixed)(c1*65536.0); + s2 = (FT_Fixed)(s1*65536.0); + + j = FT_Atan2( c2, s2 ); + if ( j < 0 ) + j += FT_ANGLE_2PI; + + if ( abs( i - j ) > 1 ) + { + printf( "FT_Atan2( %.7f, %.7f ) = %.5f, atan = %.5f\n", + c2/65536.0, s2/65536.0, j/65536.0, i/65536.0 ); + } + } + } + + static void + test_unit( void ) + { + FT_Vector v; + double a, c1, s1; + FT_Fixed c2, s2; + int i; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + FT_Vector_Unit( &v, i ); + a = ( i*SPI ); + c1 = cos(a); + s1 = sin(a); + c2 = (FT_Fixed)(c1*65536.0); + s2 = (FT_Fixed)(s1*65536.0); + + if ( abs( v.x-c2 ) > THRESHOLD || + abs( v.y-s2 ) > THRESHOLD ) + { + error = 1; + printf( "FT_Vector_Unit[%3d] = ( %.7f, %.7f ) vec = ( %.7f, %.7f )\n", + (i >> 16), + v.x/65536.0, v.y/65536.0, + c1, s1 ); + } + } + } + + + static void + test_length( void ) + { + FT_Vector v; + FT_Fixed l, l2; + int i; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + l = (FT_Fixed)(500.0*65536.0); + v.x = (FT_Fixed)( l * cos( i*SPI ) ); + v.y = (FT_Fixed)( l * sin( i*SPI ) ); + l2 = FT_Vector_Length( &v ); + + if ( abs( l2-l ) > THRESHOLD ) + { + error = 1; + printf( "FT_Length( %.7f, %.7f ) = %.5f, length = %.5f\n", + v.x/65536.0, v.y/65536.0, l2/65536.0, l/65536.0 ); + } + } + } + + + static void + test_rotate( void ) + { + FT_Fixed c2, s2, c4, s4; + FT_Vector v; + double l, ra, a, c1, s1, cra, sra, c3, s3; + int i, j, rotate; + + for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000 ) + { + ra = rotate*SPI; + cra = cos( ra ); + sra = sin( ra ); + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + l = 500.0; + a = i*SPI; + + c1 = l * cos(a); + s1 = l * sin(a); + + v.x = c2 = (FT_Fixed)(c1*65536.0); + v.y = s2 = (FT_Fixed)(s1*65536.0); + + FT_Vector_Rotate( &v, rotate ); + + c3 = c1 * cra - s1 * sra; + s3 = c1 * sra + s1 * cra; + + c4 = (FT_Fixed)(c3*65536.0); + s4 = (FT_Fixed)(s3*65536.0); + + if ( abs( c4 - v.x ) > THRESHOLD || + abs( s4 - v.y ) > THRESHOLD ) + { + error = 1; + printf( "FT_Rotate( (%.7f,%.7f), %.5f ) = ( %.7f, %.7f ), rot = ( %.7f, %.7f )\n", + c1, s1, ra, + c2/65536.0, s2/65536.0, + c4/65536.0, s4/65536.0 ); + } + } + } + } + + + int main( void ) + { + test_cos(); + test_sin(); + test_tan(); + test_atan2(); + test_unit(); + test_length(); + test_rotate(); + + if (!error) + printf( "trigonometry test ok !\n" ); + + return !error; + } diff --git a/src/libs/freetype2/truetype/descrip.mms b/src/libs/freetype2/truetype/descrip.mms index e30ee1b3f8..c596c2455f 100644 --- a/src/libs/freetype2/truetype/descrip.mms +++ b/src/libs/freetype2/truetype/descrip.mms @@ -20,4 +20,4 @@ OBJS=truetype.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/truetype/module.mk b/src/libs/freetype2/truetype/module.mk index bb042beae1..60279f51a0 100644 --- a/src/libs/freetype2/truetype/module.mk +++ b/src/libs/freetype2/truetype/module.mk @@ -19,4 +19,4 @@ add_truetype_driver: $(OPEN_DRIVER)tt_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)truetype $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/truetype/rules.mk b/src/libs/freetype2/truetype/rules.mk index 7c1f3e3a62..4e00022a64 100644 --- a/src/libs/freetype2/truetype/rules.mk +++ b/src/libs/freetype2/truetype/rules.mk @@ -68,4 +68,4 @@ $(OBJ_)%.$O: $(TT_DIR_)%.c $(FREETYPE_H) $(TT_DRV_H) DRV_OBJS_S += $(TT_DRV_OBJ_S) DRV_OBJS_M += $(TT_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/truetype/truetype.c b/src/libs/freetype2/truetype/truetype.c index 1ed3cebc99..c2fe42ab7f 100644 --- a/src/libs/freetype2/truetype/truetype.c +++ b/src/libs/freetype2/truetype/truetype.c @@ -29,4 +29,4 @@ #endif -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttdriver.c b/src/libs/freetype2/truetype/ttdriver.c index c61c4eb706..965747edac 100644 --- a/src/libs/freetype2/truetype/ttdriver.c +++ b/src/libs/freetype2/truetype/ttdriver.c @@ -190,32 +190,39 @@ FT_UInt horz_resolution, FT_UInt vert_resolution ) { - FT_Size_Metrics* metrics = &size->root.metrics; - TT_Face face = (TT_Face)size->root.face; + FT_Size_Metrics* metrics = &size->root.metrics; + FT_Size_Metrics* metrics2 = &size->metrics; + TT_Face face = (TT_Face)size->root.face; FT_Long dim_x, dim_y; + *metrics2 = *metrics; + /* This bit flag, when set, indicates that the pixel size must be */ /* truncated to an integer. Nearly all TrueType fonts have this */ /* bit set, as hinting won't work really well otherwise. */ /* */ - /* However, for those rare fonts who do not set it, we override */ - /* the default computations performed by the base layer. I */ - /* really don't know whether this is useful, but hey, that's the */ - /* spec :-) */ - /* */ - if ( ( face->header.Flags & 8 ) == 0 ) + if ( ( face->header.Flags & 8 ) != 0 ) { - /* Compute pixel sizes in 26.6 units */ - dim_x = ( char_width * horz_resolution + 36 ) / 72; - dim_y = ( char_height * vert_resolution + 36 ) / 72; - - metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); - metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); - - metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); - metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); + /* we need to use rounding in the following computations. Otherwise, + * the resulting hinted outlines will be very slightly distorted + */ + dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; + dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; } + else + { + dim_x = ( ( char_width * horz_resolution + 36 ) / 72 ); + dim_y = ( ( char_height * vert_resolution + 36 ) / 72 ); + } + + /* we only modify "metrics2", not "metrics", so these changes have */ + /* no effect on the result of the auto-hinter when it is used */ + /* */ + metrics2->x_ppem = (FT_UShort)( dim_x >> 6 ); + metrics2->y_ppem = (FT_UShort)( dim_y >> 6 ); + metrics2->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); + metrics2->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); size->ttmetrics.valid = FALSE; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS @@ -256,6 +263,7 @@ /* many things have been pre-computed by the base layer */ + size->metrics = size->root.metrics; size->ttmetrics.valid = FALSE; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS size->strike_index = 0xFFFF; @@ -417,4 +425,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttdriver.h b/src/libs/freetype2/truetype/ttdriver.h index f6f26e4b59..f6dbcd0521 100644 --- a/src/libs/freetype2/truetype/ttdriver.h +++ b/src/libs/freetype2/truetype/ttdriver.h @@ -35,4 +35,4 @@ FT_END_HEADER #endif /* __TTDRIVER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/tterrors.h b/src/libs/freetype2/truetype/tterrors.h index d317c70e0e..10e39297d4 100644 --- a/src/libs/freetype2/truetype/tterrors.h +++ b/src/libs/freetype2/truetype/tterrors.h @@ -37,4 +37,4 @@ #endif /* __TTERRORS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttgload.c b/src/libs/freetype2/truetype/ttgload.c index c5f26542b6..8d64c1d59f 100644 --- a/src/libs/freetype2/truetype/ttgload.c +++ b/src/libs/freetype2/truetype/ttgload.c @@ -58,6 +58,15 @@ #define UNSCALED_COMPONENT_OFFSET 0x1000 +/* Maximum recursion depth we allow for composite glyphs. + * The TrueType spec doesn't say anything about recursion, + * so it isn't clear that recursion is allowed at all. But + * we'll be generous. + */ +#define TT_MAX_COMPOSITE_RECURSE 5 + + + /*************************************************************************/ /* */ /* */ @@ -747,7 +756,8 @@ /* */ static FT_Error load_truetype_glyph( TT_Loader loader, - FT_UInt glyph_index ) + FT_UInt glyph_index, + FT_UInt recurse_count ) { #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER @@ -769,6 +779,11 @@ FT_Bool glyph_data_loaded = 0; #endif + if ( recurse_count >= TT_MAX_COMPOSITE_RECURSE ) + { + error = TT_Err_Invalid_Composite; + goto Exit; + } /* check glyph index */ if ( glyph_index >= (FT_UInt)face->root.num_glyphs ) @@ -793,42 +808,33 @@ FT_Short left_bearing = 0; FT_UShort advance_width = 0; -#ifdef FT_CONFIG_OPTION_INCREMENTAL - FT_Bool metrics_found = FALSE; + Get_HMetrics( face, glyph_index, + (FT_Bool)!( loader->load_flags & + FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), + &left_bearing, + &advance_width ); +#ifdef FT_CONFIG_OPTION_INCREMENTAL /* If this is an incrementally loaded font see if there are */ /* overriding metrics for this glyph. */ if ( face->root.internal->incremental_interface && face->root.internal->incremental_interface->funcs->get_glyph_metrics ) { - FT_Incremental_MetricsRec m; - + FT_Incremental_MetricsRec metrics; + metrics.bearing_x = left_bearing; + metrics.bearing_y = 0; + metrics.advance = advance_width; error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( face->root.internal->incremental_interface->object, - glyph_index, FALSE, &m, &metrics_found ); + glyph_index, FALSE, &metrics ); if ( error ) goto Exit; - left_bearing = (FT_Short)m.bearing_x; - advance_width = (FT_UShort)m.advance; + left_bearing = (FT_Short)metrics.bearing_x; + advance_width = (FT_UShort)metrics.advance; } - if ( !metrics_found ) - Get_HMetrics( face, glyph_index, - (FT_Bool)!( loader->load_flags & - FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), - &left_bearing, - &advance_width ); - -#else - - Get_HMetrics( face, glyph_index, - (FT_Bool)!( loader->load_flags & - FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), - &left_bearing, - &advance_width ); - #endif /* FT_CONFIG_OPTION_INCREMENTAL */ loader->left_bearing = left_bearing; @@ -985,7 +991,7 @@ /***********************************************************************/ /* otherwise, load a composite! */ - else + else if ( contours_count == -1 ) { TT_GlyphSlot glyph = (TT_GlyphSlot)loader->glyph; FT_UInt start_point; @@ -1059,7 +1065,8 @@ num_base_points = gloader->base.outline.n_points; - error = load_truetype_glyph( loader, subglyph->index ); + error = load_truetype_glyph( loader, subglyph->index, + recurse_count+1 ); if ( error ) goto Fail; @@ -1310,7 +1317,6 @@ 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; @@ -1326,6 +1332,12 @@ } /* end of composite loading */ } + else + { + /* invalid composite count ( negative but not -1 ) */ + error = TT_Err_Invalid_Outline; + goto Fail; + } /***********************************************************************/ /***********************************************************************/ @@ -1427,33 +1439,9 @@ FT_Pos left; /* scaled vertical left side bearing */ FT_Pos top; /* scaled vertical top side bearing */ FT_Pos advance; /* scaled vertical advance height */ - FT_Bool metrics_found = FALSE; - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - /* If this is an incrementally loaded font see if there are */ - /* overriding metrics for this glyph. */ - if ( face->root.internal->incremental_interface && - face->root.internal->incremental_interface->funcs->get_glyph_metrics ) - { - FT_Incremental_MetricsRec m; - FT_Error error = - face->root.internal->incremental_interface->funcs->get_glyph_metrics( - face->root.internal->incremental_interface->object, - glyph_index, TRUE, &m, &metrics_found ); - - - if ( error ) - return error; - - top_bearing = (FT_Short)m.bearing_y; - advance_height = (FT_UShort)m.advance; - } - -#endif /* FT_CONFIG_OPTION_INCREMENTAL */ /* Get the unscaled top bearing and advance height. */ - if ( !metrics_found && face->vertical_info && + if ( face->vertical_info && face->vertical.number_Of_VMetrics > 0 ) { /* Don't assume that both the vertical header and vertical */ @@ -1494,8 +1482,35 @@ } } +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* If this is an incrementally loaded font see if there are */ + /* overriding metrics for this glyph. */ + if ( face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; + FT_Error error = 0; + + metrics.bearing_x = 0; + metrics.bearing_y = top_bearing; + metrics.advance = advance_height; + error = + face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, TRUE, &metrics ); + + if ( error ) + return error; + + top_bearing = (FT_Short)metrics.bearing_y; + advance_height = (FT_UShort)metrics.advance; + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + /* We must adjust the top_bearing value from the bounding box given */ - /* in the glyph header to te bounding box calculated with */ + /* in the glyph header to the bounding box calculated with */ /* FT_Get_Outline_CBox(). */ /* scale the metrics */ @@ -1757,7 +1772,7 @@ glyph->format = FT_GLYPH_FORMAT_OUTLINE; glyph->num_subglyphs = 0; - error = load_truetype_glyph( &loader, glyph_index ); + error = load_truetype_glyph( &loader, glyph_index, 0 ); if ( !error ) compute_glyph_metrics( &loader, glyph_index ); @@ -1780,4 +1795,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttgload.h b/src/libs/freetype2/truetype/ttgload.h index 04097134f5..3922d1c1a9 100644 --- a/src/libs/freetype2/truetype/ttgload.h +++ b/src/libs/freetype2/truetype/ttgload.h @@ -52,4 +52,4 @@ FT_END_HEADER #endif /* __TTGLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttinterp.c b/src/libs/freetype2/truetype/ttinterp.c index cee0f78a25..befb0be988 100644 --- a/src/libs/freetype2/truetype/ttinterp.c +++ b/src/libs/freetype2/truetype/ttinterp.c @@ -568,7 +568,7 @@ exec->FDefs = size->function_defs; exec->IDefs = size->instruction_defs; exec->tt_metrics = size->ttmetrics; - exec->metrics = size->root.metrics; + exec->metrics = size->metrics; exec->maxFunc = size->max_func; exec->maxIns = size->max_ins; @@ -7493,4 +7493,4 @@ #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttinterp.h b/src/libs/freetype2/truetype/ttinterp.h index e750963ff5..4cce641e9f 100644 --- a/src/libs/freetype2/truetype/ttinterp.h +++ b/src/libs/freetype2/truetype/ttinterp.h @@ -314,4 +314,4 @@ FT_END_HEADER #endif /* __TTINTERP_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttobjs.c b/src/libs/freetype2/truetype/ttobjs.c index 827350d0cb..5a24deda98 100644 --- a/src/libs/freetype2/truetype/ttobjs.c +++ b/src/libs/freetype2/truetype/ttobjs.c @@ -70,14 +70,17 @@ { FT_Memory memory = zone->memory; + if ( memory ) + { + FT_FREE( zone->contours ); + FT_FREE( zone->tags ); + FT_FREE( zone->cur ); + FT_FREE( zone->org ); - FT_FREE( zone->contours ); - FT_FREE( zone->tags ); - FT_FREE( zone->cur ); - FT_FREE( zone->org ); - - zone->max_points = zone->n_points = 0; - zone->max_contours = zone->n_contours = 0; + zone->max_points = zone->n_points = 0; + zone->max_contours = zone->n_contours = 0; + zone->memory = NULL; + } } @@ -541,7 +544,7 @@ face = (TT_Face)size->root.face; - metrics = &size->root.metrics; + metrics = &size->metrics; if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 ) return TT_Err_Invalid_PPem; @@ -568,14 +571,15 @@ /* Compute root ascender, descender, test height, and max_advance */ metrics->ascender = ( FT_MulFix( face->root.ascender, - metrics->y_scale ) + 63 ) & -64; + metrics->y_scale ) + 32 ) & -64; metrics->descender = ( FT_MulFix( face->root.descender, - metrics->y_scale ) + 0 ) & -64; + metrics->y_scale ) + 32 ) & -64; metrics->height = ( FT_MulFix( face->root.height, - metrics->y_scale ) + 63 ) & -64; + metrics->y_scale ) + 32 ) & -64; metrics->max_advance = ( FT_MulFix( face->root.max_advance_width, metrics->x_scale ) + 32 ) & -64; + #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS /* set to `invalid' by default */ size->strike_index = 0xFFFFU; @@ -690,7 +694,7 @@ SFNT_Service sfnt; - metrics = &size->root.metrics; + metrics = &size->metrics; if ( size->strike_index != 0xFFFFU ) return TT_Err_Ok; @@ -728,8 +732,8 @@ sbit_metrics->descender; /* XXX: Is this correct? */ - sbit_metrics->max_advance = ( strike->hori.min_origin_SB + - strike->hori.max_width + + sbit_metrics->max_advance = ( strike->hori.min_origin_SB + + strike->hori.max_width + strike->hori.min_advance_SB ) << 6; size->strike_index = strike_index; @@ -858,4 +862,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttobjs.h b/src/libs/freetype2/truetype/ttobjs.h index 28bcdc4258..d0ede02051 100644 --- a/src/libs/freetype2/truetype/ttobjs.h +++ b/src/libs/freetype2/truetype/ttobjs.h @@ -311,6 +311,7 @@ FT_BEGIN_HEADER { FT_SizeRec root; + FT_Size_Metrics metrics; /* slightly different from the root metrics */ TT_Size_Metrics ttmetrics; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS @@ -419,4 +420,4 @@ FT_END_HEADER #endif /* __TTOBJS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttpload.c b/src/libs/freetype2/truetype/ttpload.c index 4066cd7c28..c6e65d768b 100644 --- a/src/libs/freetype2/truetype/ttpload.c +++ b/src/libs/freetype2/truetype/ttpload.c @@ -261,4 +261,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/truetype/ttpload.h b/src/libs/freetype2/truetype/ttpload.h index 3f8cd64ff7..a8941736a4 100644 --- a/src/libs/freetype2/truetype/ttpload.h +++ b/src/libs/freetype2/truetype/ttpload.h @@ -45,4 +45,4 @@ FT_END_HEADER #endif /* __TTPLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/descrip.mms b/src/libs/freetype2/type1/descrip.mms index 8f028f6ff4..75a9c14689 100644 --- a/src/libs/freetype2/type1/descrip.mms +++ b/src/libs/freetype2/type1/descrip.mms @@ -20,4 +20,4 @@ OBJS=type1.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/type1/module.mk b/src/libs/freetype2/type1/module.mk index 82d9355ba3..277bd7259c 100644 --- a/src/libs/freetype2/type1/module.mk +++ b/src/libs/freetype2/type1/module.mk @@ -19,4 +19,4 @@ add_type1_driver: $(OPEN_DRIVER)t1_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)type1 $(ECHO_DRIVER_DESC)Postscript font files with extension *.pfa or *.pfb$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/type1/rules.mk b/src/libs/freetype2/type1/rules.mk index 49a4e4ad1d..ba2f7c3d1d 100644 --- a/src/libs/freetype2/type1/rules.mk +++ b/src/libs/freetype2/type1/rules.mk @@ -70,4 +70,4 @@ $(OBJ_)%.$O: $(T1_DIR_)%.c $(FREETYPE_H) $(T1_DRV_H) DRV_OBJS_S += $(T1_DRV_OBJ_S) DRV_OBJS_M += $(T1_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/type1/t1afm.c b/src/libs/freetype2/type1/t1afm.c index 71ccd1ea74..adfb084037 100644 --- a/src/libs/freetype2/type1/t1afm.c +++ b/src/libs/freetype2/type1/t1afm.c @@ -279,4 +279,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1afm.h b/src/libs/freetype2/type1/t1afm.h index 77cc6a6e95..2e46efea45 100644 --- a/src/libs/freetype2/type1/t1afm.h +++ b/src/libs/freetype2/type1/t1afm.h @@ -63,4 +63,4 @@ FT_END_HEADER #endif /* __T1AFM_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1driver.c b/src/libs/freetype2/type1/t1driver.c index b255f9d7cb..682b4fa3ec 100644 --- a/src/libs/freetype2/type1/t1driver.c +++ b/src/libs/freetype2/type1/t1driver.c @@ -276,4 +276,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1driver.h b/src/libs/freetype2/type1/t1driver.h index ad429440de..9ede430483 100644 --- a/src/libs/freetype2/type1/t1driver.h +++ b/src/libs/freetype2/type1/t1driver.h @@ -35,4 +35,4 @@ FT_END_HEADER #endif /* __T1DRIVER_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1errors.h b/src/libs/freetype2/type1/t1errors.h index 81221c343d..05fe9bf4a9 100644 --- a/src/libs/freetype2/type1/t1errors.h +++ b/src/libs/freetype2/type1/t1errors.h @@ -37,4 +37,4 @@ #endif /* __T1ERRORS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1gload.c b/src/libs/freetype2/type1/t1gload.c index 0a3155db3f..2f95163434 100644 --- a/src/libs/freetype2/type1/t1gload.c +++ b/src/libs/freetype2/type1/t1gload.c @@ -76,7 +76,7 @@ glyph_index, char_string ); else -#endif +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ /* For ordinary fonts get the character data stored in the face record. */ { @@ -95,23 +95,21 @@ if ( !error && face->root.internal->incremental_interface && face->root.internal->incremental_interface->funcs->get_glyph_metrics ) { - FT_Bool found = FALSE; FT_Incremental_MetricsRec metrics; - + metrics.bearing_x = decoder->builder.left_bearing.x; + metrics.bearing_y = decoder->builder.left_bearing.y; + metrics.advance = decoder->builder.advance.x; error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( face->root.internal->incremental_interface->object, - glyph_index, FALSE, &metrics, &found ); - if ( found ) - { - decoder->builder.left_bearing.x = metrics.bearing_x; - decoder->builder.left_bearing.y = metrics.bearing_y; - decoder->builder.advance.x = metrics.advance; - decoder->builder.advance.y = 0; - } + glyph_index, FALSE, &metrics ); + decoder->builder.left_bearing.x = metrics.bearing_x; + decoder->builder.left_bearing.y = metrics.bearing_y; + decoder->builder.advance.x = metrics.advance; + decoder->builder.advance.y = 0; } -#endif +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ return error; } @@ -137,7 +135,7 @@ face->root.internal->incremental_interface->object, &glyph_data ); } -#endif +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ return error; } @@ -413,4 +411,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1gload.h b/src/libs/freetype2/type1/t1gload.h index 0324a0d154..ccce3c0824 100644 --- a/src/libs/freetype2/type1/t1gload.h +++ b/src/libs/freetype2/type1/t1gload.h @@ -43,4 +43,4 @@ FT_END_HEADER #endif /* __T1GLOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1load.c b/src/libs/freetype2/type1/t1load.c index 70fda88d7a..3d6e139318 100644 --- a/src/libs/freetype2/type1/t1load.c +++ b/src/libs/freetype2/type1/t1load.c @@ -779,17 +779,25 @@ static int - is_alpha( FT_Byte c ) + is_name_char( FT_Byte c ) { - /* Note: we must accept "+" as a valid character, as it is used in */ - /* embedded type1 fonts in PDF documents. */ - /* */ - return ( ft_isalnum( c ) || - c == '.' || - c == '_' || - c == '-' || - c == '+' ); - } + /* Note: PostScript allows any non-delimiting, non-whitespace */ + /* in a name (PS Ref Manual, 3rd Ed, p31) */ + /* PostScript delimiters include (,),<,>,[,],{,},/ and % */ + + return ( c != '(' && + c != ')' && + c != '<' && + c != '>' && + c != '[' && + c != ']' && + c != '{' && + c != '}' && + c != '/' && + c != '%' && + ! is_space( c ) + ); + } static int @@ -861,7 +869,7 @@ cur++; cur2 = cur; - while ( cur2 < limit && is_alpha( *cur2 ) ) + while ( cur2 < limit && is_name_char( *cur2 ) ) cur2++; len = cur2 - cur; @@ -1070,7 +1078,7 @@ FT_PtrDist len; - while ( cur2 < limit && is_alpha( *cur2 ) ) + while ( cur2 < limit && is_name_char( *cur2 ) ) cur2++; len = cur2 - cur - 1; @@ -1133,6 +1141,14 @@ /* with synthetic fonts, it's possible we get here twice */ return; + if ( parser->root.cursor + 2 > parser->root.limit && + parser->root.cursor[0] == '[' && + parser->root.cursor[1] == ']' ) + { + /* empty array */ + return; + } + loader->num_subrs = (FT_Int)T1_ToInt( parser ); if ( parser->root.error ) return; @@ -1304,7 +1320,7 @@ FT_PtrDist len; - while ( cur2 < limit && is_alpha( *cur2 ) ) + while ( cur2 < limit && is_name_char( *cur2 ) ) cur2++; len = cur2 - cur - 1; @@ -1483,9 +1499,9 @@ /* now add the special functions... */ T1_FIELD_CALLBACK( "FontName", parse_font_name ) -#if 0 +#if 0 T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox ) -#endif +#endif T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix ) T1_FIELD_CALLBACK( "Encoding", parse_encoding ) T1_FIELD_CALLBACK( "Subrs", parse_subrs ) @@ -1564,7 +1580,7 @@ cur++; cur2 = cur; - while ( cur2 < limit && is_alpha( *cur2 ) ) + while ( cur2 < limit && is_name_char( *cur2 ) ) cur2++; len = cur2 - cur; @@ -1788,4 +1804,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1load.h b/src/libs/freetype2/type1/t1load.h index 804a010450..f7635fd50f 100644 --- a/src/libs/freetype2/type1/t1load.h +++ b/src/libs/freetype2/type1/t1load.h @@ -81,4 +81,4 @@ FT_END_HEADER #endif /* __T1LOAD_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1objs.c b/src/libs/freetype2/type1/t1objs.c index 59e7cb6864..27f44dd642 100644 --- a/src/libs/freetype2/type1/t1objs.c +++ b/src/libs/freetype2/type1/t1objs.c @@ -538,4 +538,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1objs.h b/src/libs/freetype2/type1/t1objs.h index 9aeb10dd22..5435da0ca7 100644 --- a/src/libs/freetype2/type1/t1objs.h +++ b/src/libs/freetype2/type1/t1objs.h @@ -167,4 +167,4 @@ FT_END_HEADER #endif /* __T1OBJS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1parse.c b/src/libs/freetype2/type1/t1parse.c index c1783f0293..294409a8f2 100644 --- a/src/libs/freetype2/type1/t1parse.c +++ b/src/libs/freetype2/type1/t1parse.c @@ -457,4 +457,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1parse.h b/src/libs/freetype2/type1/t1parse.h index ecc206739e..2c8948d343 100644 --- a/src/libs/freetype2/type1/t1parse.h +++ b/src/libs/freetype2/type1/t1parse.h @@ -132,4 +132,4 @@ FT_END_HEADER #endif /* __T1PARSE_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/t1tokens.h b/src/libs/freetype2/type1/t1tokens.h index dea50547b8..3669713d16 100644 --- a/src/libs/freetype2/type1/t1tokens.h +++ b/src/libs/freetype2/type1/t1tokens.h @@ -77,4 +77,4 @@ T1_FIELD_BBOX("FontBBox", xMin ) -/* END */ +/* END */ diff --git a/src/libs/freetype2/type1/type1.c b/src/libs/freetype2/type1/type1.c index ccc12be103..862729d05c 100644 --- a/src/libs/freetype2/type1/type1.c +++ b/src/libs/freetype2/type1/type1.c @@ -30,4 +30,4 @@ #endif -/* END */ +/* END */ diff --git a/src/libs/freetype2/type42/descrip.mms b/src/libs/freetype2/type42/descrip.mms index a52ba06fb0..83062cc576 100644 --- a/src/libs/freetype2/type42/descrip.mms +++ b/src/libs/freetype2/type42/descrip.mms @@ -20,4 +20,4 @@ OBJS=type42.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/type42/module.mk b/src/libs/freetype2/type42/module.mk index ceaea41b08..a2c02988b4 100644 --- a/src/libs/freetype2/type42/module.mk +++ b/src/libs/freetype2/type42/module.mk @@ -19,4 +19,4 @@ add_type42_driver: $(OPEN_DRIVER)t42_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)type42 $(ECHO_DRIVER_DESC)Type 42 font files with no known extension$(ECHO_DRIVER_DONE) -# EOF +# EOF diff --git a/src/libs/freetype2/type42/rules.mk b/src/libs/freetype2/type42/rules.mk index f991449f5f..82be9d7a62 100644 --- a/src/libs/freetype2/type42/rules.mk +++ b/src/libs/freetype2/type42/rules.mk @@ -66,4 +66,4 @@ $(OBJ_)%.$O: $(T42_DIR_)%.c $(FREETYPE_H) $(T42_DRV_H) DRV_OBJS_S += $(T42_DRV_OBJ_S) DRV_OBJS_M += $(T42_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/type42/t42drivr.c b/src/libs/freetype2/type42/t42drivr.c index 65bf2e8aaf..0466a34b1b 100644 --- a/src/libs/freetype2/type42/t42drivr.c +++ b/src/libs/freetype2/type42/t42drivr.c @@ -166,4 +166,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/type42/t42drivr.h b/src/libs/freetype2/type42/t42drivr.h index 98b7410b67..69f80447ae 100644 --- a/src/libs/freetype2/type42/t42drivr.h +++ b/src/libs/freetype2/type42/t42drivr.h @@ -35,4 +35,4 @@ FT_END_HEADER #endif /* __T42DRIVR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type42/t42error.h b/src/libs/freetype2/type42/t42error.h index cb6642b747..e1dc4e5161 100644 --- a/src/libs/freetype2/type42/t42error.h +++ b/src/libs/freetype2/type42/t42error.h @@ -37,4 +37,4 @@ #endif /* __T42ERROR_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type42/t42objs.c b/src/libs/freetype2/type42/t42objs.c index dcc807701f..cbe2f34aaa 100644 --- a/src/libs/freetype2/type42/t42objs.c +++ b/src/libs/freetype2/type42/t42objs.c @@ -560,17 +560,10 @@ static void - ft_glyphslot_clear( FT_GlyphSlot slot ) + t42_glyphslot_clear( FT_GlyphSlot slot ) { /* free bitmap if needed */ - if ( slot->flags & FT_GLYPH_OWN_BITMAP ) - { - FT_Memory memory = FT_FACE_MEMORY( slot->face ); - - - FT_FREE( slot->bitmap.buffer ); - slot->flags &= ~FT_GLYPH_OWN_BITMAP; - } + ft_glyphslot_free_bitmap( slot ); /* clear all public fields in the glyph slot */ FT_ZERO( &slot->metrics ); @@ -603,7 +596,7 @@ FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz; - ft_glyphslot_clear( t42slot->ttslot ); + t42_glyphslot_clear( t42slot->ttslot ); error = ttclazz->load_glyph( t42slot->ttslot, t42size->ttsize, glyph_index, @@ -634,4 +627,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/type42/t42objs.h b/src/libs/freetype2/type42/t42objs.h index 6fb176917e..ab16b34621 100644 --- a/src/libs/freetype2/type42/t42objs.h +++ b/src/libs/freetype2/type42/t42objs.h @@ -123,4 +123,4 @@ FT_END_HEADER #endif /* __T42OBJS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type42/t42parse.c b/src/libs/freetype2/type42/t42parse.c index 8bb2e7ba6c..ab286ad7ff 100644 --- a/src/libs/freetype2/type42/t42parse.c +++ b/src/libs/freetype2/type42/t42parse.c @@ -991,4 +991,4 @@ } -/* END */ +/* END */ diff --git a/src/libs/freetype2/type42/t42parse.h b/src/libs/freetype2/type42/t42parse.h index 9bcb657309..8f45209cce 100644 --- a/src/libs/freetype2/type42/t42parse.h +++ b/src/libs/freetype2/type42/t42parse.h @@ -86,4 +86,4 @@ FT_END_HEADER #endif /* __T42PARSE_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/type42/type42.c b/src/libs/freetype2/type42/type42.c index d13df56b10..f70d9d24ed 100644 --- a/src/libs/freetype2/type42/type42.c +++ b/src/libs/freetype2/type42/type42.c @@ -22,4 +22,4 @@ #include "t42parse.c" #include "t42drivr.c" -/* END */ +/* END */ diff --git a/src/libs/freetype2/winfonts/descrip.mms b/src/libs/freetype2/winfonts/descrip.mms index 475cdbb6bd..a0d03c52e4 100644 --- a/src/libs/freetype2/winfonts/descrip.mms +++ b/src/libs/freetype2/winfonts/descrip.mms @@ -20,4 +20,4 @@ OBJS=winfnt.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) -# EOF +# EOF diff --git a/src/libs/freetype2/winfonts/fnterrs.h b/src/libs/freetype2/winfonts/fnterrs.h index ea80909715..61563c8a02 100644 --- a/src/libs/freetype2/winfonts/fnterrs.h +++ b/src/libs/freetype2/winfonts/fnterrs.h @@ -38,4 +38,4 @@ #endif /* __FNTERRS_H__ */ -/* END */ +/* END */ diff --git a/src/libs/freetype2/winfonts/module.mk b/src/libs/freetype2/winfonts/module.mk index 99be845c19..cdff1c1bbf 100644 --- a/src/libs/freetype2/winfonts/module.mk +++ b/src/libs/freetype2/winfonts/module.mk @@ -18,4 +18,4 @@ make_module_list: add_windows_driver add_windows_driver: $(OPEN_DRIVER)winfnt_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)winfnt $(ECHO_DRIVER_DESC)Windows bitmap fonts with extension *.fnt or *.fon$(ECHO_DRIVER_DONE) - + diff --git a/src/libs/freetype2/winfonts/rules.mk b/src/libs/freetype2/winfonts/rules.mk index 994eef8330..daf07883aa 100644 --- a/src/libs/freetype2/winfonts/rules.mk +++ b/src/libs/freetype2/winfonts/rules.mk @@ -62,4 +62,4 @@ $(OBJ_)%.$O: $(FNT_DIR_)%.c $(FREETYPE_H) $(FNT_DRV_H) DRV_OBJS_S += $(FNT_DRV_OBJ_S) DRV_OBJS_M += $(FNT_DRV_OBJ_M) -# EOF +# EOF diff --git a/src/libs/freetype2/winfonts/winfnt.c b/src/libs/freetype2/winfonts/winfnt.c index 21ff6dfade..c110b7bffd 100644 --- a/src/libs/freetype2/winfonts/winfnt.c +++ b/src/libs/freetype2/winfonts/winfnt.c @@ -17,6 +17,7 @@ #include +#include FT_WINFONTS_H #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_OBJECTS_H @@ -68,9 +69,9 @@ const FT_Frame_Field winfnt_header_fields[] = { #undef FT_STRUCTURE -#define FT_STRUCTURE WinFNT_HeaderRec +#define FT_STRUCTURE FT_WinFNT_HeaderRec - FT_FRAME_START( 134 ), + FT_FRAME_START( 146 ), FT_FRAME_USHORT_LE( version ), FT_FRAME_ULONG_LE ( file_size ), FT_FRAME_BYTES ( copyright, 60 ), @@ -106,7 +107,7 @@ FT_FRAME_USHORT_LE( B_space ), FT_FRAME_USHORT_LE( C_space ), FT_FRAME_USHORT_LE( color_table_offset ), - FT_FRAME_BYTES ( reserved, 4 ), + FT_FRAME_BYTES ( reserved1, 16 ), FT_FRAME_END }; @@ -127,8 +128,8 @@ fnt_font_load( FNT_Font font, FT_Stream stream ) { - FT_Error error; - WinFNT_Header header = &font->header; + FT_Error error; + FT_WinFNT_Header header = &font->header; /* first of all, read the FNT header */ @@ -145,6 +146,17 @@ goto Exit; } + /* Version 2 doesn't have these fields */ + if ( header->version == 0x200 ) + { + header->flags = 0; + header->A_space = 0; + header->B_space = 0; + header->C_space = 0; + + header->color_table_offset = 0; + } + if ( header->file_type & 1 ) { FT_TRACE2(( "[can't handle vector FNT fonts]\n" )); @@ -592,7 +604,7 @@ len = new_format ? 6 : 4; /* jump to glyph entry */ - p = font->fnt_frame + 118 + len * glyph_index; + p = font->fnt_frame + ( new_format ? 146 : 118 ) + len * glyph_index; bitmap->width = FT_NEXT_SHORT_LE( p ); @@ -606,32 +618,18 @@ /* allocate and build bitmap */ { - FT_Memory memory = FT_FACE_MEMORY( slot->face ); FT_Int pitch = ( bitmap->width + 7 ) >> 3; - FT_Byte* column; - FT_Byte* write; bitmap->pitch = pitch; bitmap->rows = font->header.pixel_height; bitmap->pixel_mode = FT_PIXEL_MODE_MONO; - if ( FT_ALLOC( bitmap->buffer, pitch * bitmap->rows ) ) - goto Exit; - - column = (FT_Byte*)bitmap->buffer; - - for ( ; pitch > 0; pitch--, column++ ) - { - FT_Byte* limit = p + bitmap->rows; - - - for ( write = column; p < limit; p++, write += bitmap->pitch ) - write[0] = p[0]; - } + /* note: we don't allocate a new buffer for the bitmap since we */ + /* already store the images in the FT_Face */ + ft_glyphslot_set_bitmap( slot, p ); } - slot->flags = FT_GLYPH_OWN_BITMAP; slot->bitmap_left = 0; slot->bitmap_top = font->header.ascent; slot->format = FT_GLYPH_FORMAT_BITMAP; @@ -688,4 +686,4 @@ }; -/* END */ +/* END */ diff --git a/src/libs/freetype2/winfonts/winfnt.h b/src/libs/freetype2/winfonts/winfnt.h index 4ba85e0b23..64e11ff84e 100644 --- a/src/libs/freetype2/winfonts/winfnt.h +++ b/src/libs/freetype2/winfonts/winfnt.h @@ -36,4 +36,4 @@ FT_END_HEADER #endif /* __WINFNT_H__ */ -/* END */ +/* END */